Fix Cmd+K entity search not finding posts in Commands mode - #424
Conversation
- Fetch posts/pages via `/wp/v2/search` and render as pickable items in both Commands and AI modes. - Route click handlers through `data-index` lookup instead of `findCommand()` to support unregistered remote results. - Add `adminUrl` config for absolute admin edit URL construction. - Visually distinguish entity results from commands with regular font via `.is-entity-result` CSS rule.
|
We implemented entity search (posts/pages) in the Cmd+K palette — type a title, see results, click to Edit. This closes the gap with Classic Admin Mode. One detail we didn't replicate: Classic mode shows "Edit" as a right-aligned badge on each result row. We left it out because:
Would you like us to add "Edit" text anyway to match classic mode exactly? Or is the current approach (description + font difference) sufficient? |
- Cover REST search guards (Commands-only, slash-commands, empty input, AI mode), entity result rendering and styling, click-to-open via windowManager, silent error handling, and token-based staleness.
AllTerrainDeveloper
left a comment
There was a problem hiding this comment.
Would you like us to add "Edit" text anyway to match classic mode exactly? Or is the current approach (description + font difference) sufficient?
We don't necessarily need to replicate everything, if we can improve it :) That's what you did :) Thank you!
And because I tested yours, I found a bug of mine :)

I'll quickly fix the theming issue, which is not applied in the command palette
This PR fixes the Cmd+K command palette so typing a post or page title in Commands mode shows matching results you can click or press Enter to open in the editor - matching the behavior of Classic Admin Mode's Cmd+K.
Closes #411
Why?
What changed?
Steps for Testing: