Repository navigation
Conversation
Move emoji names into item aria-label and tooltip, shrink popup to fit, close menu and tooltip with one Escape. See #85222. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +137 B (0%) Total Size: 8.55 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Custom Completer: should allow newlines after multiple option completions in
|
There was a problem hiding this comment.
Tested this in Playground against trunk — the narrower popup is a great improvement and no longer covers the note content, and the single-Escape dismiss works cleanly!
Before (trunk) |
After PR |
|---|---|
![]() |
![]() |
One quick visual observation:
Because Menu.CheckboxItem reserves space on the inline-start for the selection checkmark (.item-selection-indicator), unchecked emojis have a noticeable gap on the left and appear slightly off-center. Was keeping this indicator track intentional to preserve space for the checkmark, or is there room to center the emojis / tighten that start offset?
Not intentional; just a side effect. This is proof of concept PR. |
| <Menu.CheckboxItem | ||
| checked={ | ||
| !! reactions?.[ hexKey ] | ||
| ?.current_user_reaction | ||
| } | ||
| onCheckedChange={ () => | ||
| toggleReaction( hexKey ) | ||
| } | ||
| closeOnClick | ||
| aria-label={ label } | ||
| > | ||
| <Menu.ItemLabel> | ||
| <span | ||
| aria-hidden="true" | ||
| className="editor-collab-sidebar-panel__reaction-option-emoji" | ||
| > | ||
| { emoji } | ||
| </span> | ||
| </Menu.ItemLabel> | ||
| </Menu.CheckboxItem> |
There was a problem hiding this comment.
Could we also pass label={ label } to Menu.CheckboxItem? Moving the name out of the item text breaks letter-key navigation, such as typing c for Celebration, because Base UI doesn't use aria-label for that matching.
|
|
||
| // Emoji-only items; the Menu's 160px minimum is sized for text labels. | ||
| .editor-collab-sidebar-panel__reaction-picker { | ||
| --wp-ui-menu-min-width: 0; |
There was a problem hiding this comment.
This is technically not wrong, although I'm not sure if we'd prefer a straighwidth override instead (we're having mixed feelings about treating those CSS variables as public APIs, cc @mirka )
There was a problem hiding this comment.
Actually I was under the impression that we'd be using Base UI Menu directly here, not go through wp-ui. Was that too much?
There was a problem hiding this comment.
I can prototype it as well. Here are the cons of that approach, in my opinion:
- Need to reapply styles based on our system and keep them in sync when possible.
- Sets a precedent we might want to avoid.
Is it okay for packages to use Base UI directly, or do we have to wait for wp-ui?
There was a problem hiding this comment.
It's unclear whether a checkmark is really the appropriate design here, and in a recent chat @jameskoster @jasmussen @fcoveram had expressed a desire to override the item background colors as a custom case for emoji pickers. That's why I had in my mind that this would be a pretty custom implementation using Base UI directly. I might be underestimating the effort, but that was my impression 😄
Is it okay for packages to use Base UI directly
Not in the general case, but I think we have an agreement that emoji pickers are a special case. (With the possibility of it escalating to a proper component if there are more use cases.)
There was a problem hiding this comment.
Got it. I’ll try to prototype something tomorrow. Would be easier to discuss there.
|
I like the direction here, removing the emoji names is helpful. I'll give this a test! ps. for screenshots it would be nice to see the tooltip in action, as well as what a selected emoji looks like in the menu (eg. an emoji i've already added). |
|
Screencast testing: screencast.2026-10-27.08-24-57.mp4I don't really like the checkmarks for the selected state, previously I believe we were highlighting the emoji themselves with a darker background color. |
Nothing has changed in that regard; the version on trunk also uses checkmarks, that how menu handles checked state. |
|
Closing in favor of #85819. |


What?
See #85222.
The add-reaction picker shows only the emoji, with its name in a tooltip, and the popup shrinks to fit.
Why?
The name next to each emoji made the picker wide enough to cover the note being reacted to.
@wordpress/uiMenu has no horizontal orientation yet (#85289), so this keeps the vertical menu.How?
The emoji name moves to the item's
aria-labeland aTooltip, and the popup overrides--wp-ui-menu-min-width. The menu's open state is controlled so a single Escape closes it, since the focused item's tooltip otherwise takes the first Escape.Testing Instructions
Testing Instructions for Keyboard
Same.
Screenshots or screencast
Use of AI Tools
Assisted by Claude.