Skip to content

Admin bar: Make command palette prominent in the center#11796

Open
fushar wants to merge 6 commits into
WordPress:trunkfrom
fushar:command-palette-centered
Open

Admin bar: Make command palette prominent in the center#11796
fushar wants to merge 6 commits into
WordPress:trunkfrom
fushar:command-palette-centered

Conversation

@fushar
Copy link
Copy Markdown

@fushar fushar commented May 11, 2026

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.

Desktop Mobile
scheme-modern-normal image

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.

Normal Hover
image image

Here's how it looks like on all color schemes:

Normal Hover
scheme-modern-normal scheme-modern-hover
scheme-fresh-normal scheme-fresh-hover
scheme-light-normal scheme-light-hover
scheme-blue-normal scheme-blue-hover
scheme-coffee-normal scheme-coffee-hover
scheme-ectoplasm-normal scheme-ectoplasm-hover
scheme-midnight-normal scheme-midnight-hover
scheme-ocean-normal scheme-ocean-hover
scheme-sunrise-normal scheme-sunrise-hover

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.

ellatrix and others added 5 commits May 11, 2026 12:36
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>
@fushar fushar force-pushed the command-palette-centered branch from 35f3743 to 4c82dca Compare May 11, 2026 12:10
@fushar fushar changed the title Command palette centered Admin bar: make command palette prominent in the center May 11, 2026
@fushar fushar changed the title Admin bar: make command palette prominent in the center Admin bar: Make command palette prominent in the center May 11, 2026
@github-actions
Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@fushar fushar marked this pull request as ready for review May 12, 2026 01:22
@github-actions
Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props ellatrix, fushar.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Copy Markdown
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants