Admin bar: Make command palette prominent in the center#11796
Conversation
Instead of adding the command palette as a regular node in root-default, register it as its own group under root. This makes it a sibling `<ul>` to root-default and top-secondary, allowing flexbox centering on `.quicklinks` without being constrained to the `<li>` node structure. - Add `command-palette` as a group with `add_group()`, place the trigger node inside it as `command-palette-trigger` - Convert `.quicklinks` to `display: flex` for layout control - Both side groups use `flex: 1 1 0; min-width: fit-content` so they share equal space but never shrink their content - Command palette group uses `flex: 0 0 auto` to sit centered between them naturally Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35f3743 to
4c82dca
Compare
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
westonruter
left a comment
There was a problem hiding this comment.
Per Trac comment:
This has been previously discussed, in part:
Plugins very often add admin bar menu items, which puts real estate in the admin bar at a premium. This is especially so on smaller screen sizes, and extremely so for mobile. There would be no room for such a faux command palette search bar on mobile (although you are accounting for in [https://github.com//pull/11796 your PR]). To me there seems to be very little value to have a wide command palette bar taking up room in the admin bar which only serves the purpose as being a very large button which opens the actual command palette in a modal with its own input field. With the keyboard shortcut appearing in the admin bar, the intention is for users to use the keyboard to invoke the command palette anyway, and not to click the admin bar anyway.
I don't think core should do this.
Trac ticket: https://core.trac.wordpress.org/ticket/65219
This PR is an attempt to take #11171 to the finish line. On top of that PR, I improved mobile styles, background colors, and command palette overlay behavior.
Basically, we want to make the command palette "trigger node" more prominent in the center of the admin bar. On mobile viewport, to make the layout balanced, I propose to put the icon at top-right, together with the user avatar icon.
The trigger node is not an actual text input form. So, I made the following improvements:
Screen.Capture.on.2026-05-11.at.20-43-08.mp4
I used the following color variables, which is a bit different from the original PR. I believe the new color is more subtle and look better. It looks more like button than text input now.
Here's how it looks like on all color schemes:
The trigger node is responsive; it can reposition and resize itself in a crowded admin bar:
Screen.Capture.on.2026-05-11.at.22-08-05.mp4
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.7
Used for: CSS implementation under my supervision.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.