Skip to content

Menu: Align group labels and separators with indented item labels. - #83993

Merged
jameskoster merged 2 commits into
trunkfrom
menu-align-group-labels
Oct 2, 2026
Merged

jameskoster merged 2 commits into
trunkfrom
menu-align-group-labels

Conversation

@jameskoster

Copy link
Copy Markdown
Contributor

Follow-up to #81564.

What?

Align Menu group labels and separators with item labels when a radio or checkbox column indents those labels.

Why?

A radio or checkbox reserves a column for the whole menu, so every item label shifts right. Group headings and dividers kept the original inset, which left them sitting to the left of the text and made the menu harder to scan.

How?

Group labels and separators now start after the shared selection track and end with the item content column. Prefix icons stay in their own per-group column, so an icon in one group does not shift headings and dividers in the rest of the menu. --wp-ui-menu-group-head-padding-inline still nudges both edges; its default adds no extra offset.

Testing Instructions

  1. Open a post and open the Options menu.
  2. Confirm the View, Editor, and Tools headings, and the dividers between them, line up with labels such as Appearance, Visual editor, and Keyboard shortcuts.
  3. In Storybook, open Components / @wordpress-ui / Menu and check Default, Checkbox items, and Radio items.
  4. Confirm a menu with no radio or checkbox still uses the original heading and divider inset.
  5. Confirm a prefix icon indents only the labels in its own group, not every heading and divider in the menu.

Testing Instructions for Keyboard

  1. Move focus to the Options button and press Enter to open the menu.
  2. Move through the items with the arrow keys.
  3. Confirm the item order, roles, and shortcuts are unchanged. This change is visual alignment only.

Screenshots or screencast

Before After
Screenshot 2026-10-01 at 15 49 17 Screenshot 2026-10-01 at 15 43 14

Use of AI Tools

Cursor (Grok 4.7) assisted with the implementation. The change was reviewed before commit.

When a radio or checkbox column shifts item labels, headings and dividers follow that same inset so the menu reads as one column.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jameskoster
jameskoster requested a review from a team as a code owner October 1, 2026 14:50
@jameskoster jameskoster added [Type] Enhancement A suggestion for improvement. Design System Issues related to the system of combining components according to best practices. [Package] UI /packages/ui labels Oct 1, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@jameskoster
jameskoster requested review from a team and richtabor October 1, 2026 14:51
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: fcoveram <fcoveram@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

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

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: +328 B (0%)

Total Size: 8.25 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 516 kB +61 B (+0.01%)
build/scripts/components/index.min.js 333 kB +54 B (+0.02%)
build/scripts/edit-site/index.min.js 382 kB +63 B (+0.02%)
build/scripts/editor/index.min.js 616 kB +89 B (+0.01%)
build/scripts/media-utils/index.min.js 206 kB +61 B (+0.03%)

910974a Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 34780a3 trunk % Change
timeToFirstByte 56.5 ms +14.69% -2.48% 55.75 ms +4.84% -2.06% 1.35%
largestContentfulPaint 98 ms +6.12% -6.12% 98 ms +2.04% -10.2% 0%
lcpMinusTtfb 36.95 ms +12.45% -8.66% 39.2 ms +13.39% -14.16% -5.74%
wpBeforeTemplate 27.29 ms +23.45% -1.1% 27.15 ms +9.24% -1.47% 0.52%
wpTemplate 24.88 ms +6.35% -3.01% 24.11 ms +4.81% -2.45% 3.19%
wpTotal 52.56 ms +14.19% -2.63% 51.73 ms +4.85% -1.86% 1.6%
wpMemoryUsage 7.62 MB +0% -0% 7.59 MB +0% -0% 0.46%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric 34780a3 trunk % Change
timeToFirstByte 47.15 ms +5.73% -2.76% 44.85 ms +6.13% -1% 5.13%
largestContentfulPaint 104 ms +3.85% -3.85% 100 ms +2% -2% 4%
lcpMinusTtfb 56.85 ms +1.76% -3.17% 54.8 ms +1.28% -3.47% 3.74%
wpBeforeTemplate 24.79 ms +6.09% -1.53% 23.73 ms +6.41% -1.39% 4.47%
wpTemplate 18.66 ms +2.2% -3.22% 17.85 ms +2.35% -1.18% 4.54%
wpTotal 43.78 ms +5.94% -2.79% 41.64 ms +6.53% -1.01% 5.14%
wpMemoryUsage 6.25 MB +0% -0% 6.20 MB +0% -0% 0.71%
wpDbQueries 14 +0% -0% 14 +0% -0% 0%

media-processing

Metric 34780a3 trunk % Change
mediaProcessingJpeg 418.45 ms +0.67% -1.6% 413.12 ms +1.18% -1.04% 1.29%
mediaProcessingAvif 6201.25 ms +0.16% -0.3% 6202.84 ms +0.18% -0.2% -0.03%
mediaProcessingJpegToAvif 4321.11 ms +0.83% -0.41% 4314.49 ms +0.16% -0.15% 0.15%

media-upload

Metric 34780a3 trunk % Change
jpegUploadProcessing 1466.66 ms +33.24% -2.53% 1435.8 ms +1.1% -1.15% 2.15%
pngUploadProcessing 210.64 ms +5.54% -14.8% 217.05 ms +3.42% -20.24% -2.95%
largeJpegUploadProcessing 1425.44 ms +0.6% -0.87% 1416.12 ms +0.99% -0.12% 0.66%
multipleImageUploadProcessing 1607.78 ms +9.97% -1.65% 1602.43 ms +25.84% -3.12% 0.33%

post-editor

Metric 34780a3 trunk % Change
serverResponse 417.38 ms +1.06% -5.79% 422.8 ms +4.25% -8.23% -1.28%
firstPaint 246.07 ms +16.8% -18.22% 222.64 ms +6.85% -10.87% 10.52%
domContentLoaded 1061 ms +1.6% -1.58% 1073.39 ms +1.86% -1.91% -1.15%
loaded 1062.04 ms +1.59% -1.56% 1074.76 ms +1.87% -1.93% -1.18%
firstContentfulPaint 446.98 ms +3.6% -2.71% 444.34 ms +3.74% -2.26% 0.59%
firstBlock 3062.41 ms +2.37% -0.94% 3219.14 ms +1.56% -2.27% -4.87%
type 17.83 ms +1.91% -2.8% 19.67 ms +7.47% -4.78% -9.35%
typeWithoutInspector 17.17 ms +3.09% -2.27% 18.38 ms +2.5% -2.72% -6.58%
typeWithTopToolbar 22.76 ms +2.68% -5.05% 25.22 ms +2.7% -2.22% -9.75%
typeContainer 7.92 ms +7.2% -4.29% 8.78 ms +4.33% -6.38% -9.79%
focus 65.88 ms +14.97% -2.09% 69.74 ms +0.89% -3.5% -5.53%
firstFocus 188.13 ms +0% -0% 176.8 ms +0% -0% 6.41%
selectAll 482.44 ms +0.57% -0.63% 515.03 ms +1.61% -1.46% -6.33%
listViewOpen 56.1 ms +7.59% -10.53% 61.72 ms +6.71% -9.38% -9.11%
inserterOpen 22.39 ms +9.25% -13.09% 24.16 ms +17.09% -7.91% -7.33%
inserterHover 2.39 ms +8.37% -13.39% 2.32 ms +6.47% -9.48% 3.02%
inserterSearch 7.75 ms +5.68% -3.35% 8.72 ms +4.82% -2.75% -11.12%
loadPatterns 643.89 ms +2.53% -3.42% 650.21 ms +5.26% -1.04% -0.97%
wpTotal 406.39 ms +0.79% -6.1% 411.58 ms +4.22% -8.47% -1.26%
wpMemoryUsage 13.17 MB +0% -0% 13.13 MB +0% -0% 0.28%
wpDbQueries 54 +0% -0% 54 +0% -1.85% 0%

site-editor

Metric 34780a3 trunk % Change
serverResponse 500.26 ms +3.81% -6.72% 505.63 ms +1.42% -1.74% -1.06%
firstPaint 267.04 ms +62.8% -14.16% 234.75 ms +34.69% -15.59% 13.76%
domContentLoaded 1134.42 ms +1.02% -0.89% 1121.4 ms +1.65% -0.94% 1.16%
loaded 1135.82 ms +1% -0.89% 1122.63 ms +1.65% -0.94% 1.17%
firstContentfulPaint 446.06 ms +1.86% -1.45% 449.12 ms +1.27% -0.99% -0.68%
firstBlock 4182.56 ms +3.02% -1.16% 4124.09 ms +1.27% -0.35% 1.42%
type 17.38 ms +8.17% -8.34% 17.26 ms +4.92% -3.07% 0.7%
navigate 115.98 ms +15.23% -5.55% 116.22 ms +2.22% -2.58% -0.21%
loadPatterns 1288.42 ms +12.62% -3.61% 1268.11 ms +1.73% -2.01% 1.6%
loadPages 1041.8 ms +2.89% -0.78% 1054.52 ms +2.26% -2.01% -1.21%
wpTotal 490.62 ms +3.76% -6.92% 495.95 ms +1.41% -1.81% -1.07%
wpMemoryUsage 12.14 MB +0% -0% 12.09 MB +0% -0% 0.41%
wpDbQueries 43 +2.33% -0% 43.5 +1.15% -1.15% -1.15%

910974a Run

@jasmussen

Copy link
Copy Markdown
Contributor

Seems a good small step. One thing I'd love is to make the icons smaller, and to make the reserved space/indentation on the left smaller too. Not in this branch, but is that feasible now we have stroke icons?

@mirka

mirka commented Oct 2, 2026

Copy link
Copy Markdown
Member

Would you like us to change the group label alignment for the other item popup components as well? We currently do this:

Searchable select

@jasmussen

Copy link
Copy Markdown
Contributor

If you're asking me, re: the items on the left, I want to note that it's a soft feeling. I don't think what we have is very poor, I think it's very close and able to benefit from just small iterative PRs like this one. I'm a fan of your work, all of you. So to answer: I think it's a matter of freeing up about 12 to 18px of space on the indented side of menus. About making menu items about as small as we can make them. The MacOS menu bar is actually a good model to follow:

image

The icon is about 18x18, there's about 4px of outer padding, 6px of inner padding, very little gap. I defer to you all on what's possible.

@ciampo

ciampo commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Would you like us to change the group label alignment for the other item popup components as well? We currently do this:

My expectation would be that yes, we should apply the same feedback where applicable to other components

I think it's a matter of freeing up about 12 to 18px of space on the indented side of menus

I agree and I think we need more changes:

  • keep the alignment of group labels and separators with the start of the item content (as done in this PR)
  • move the checkmark / radio to the left, make that column smaller, all to shift the item content to the left as much as possible a leave a smaller empty gap to the left of non-radio/checkbox items (MacOS is a good example)
  • consider marking the prefix icon's size smaller
  • tweak remaining spacing as needed

More controversial choices:

  • we've discussed this many times, but it keeps coming back: maybe we should just always use a checkmark icon (instead of radio dots). It doesn't seem to be particularly recognizable by end users, which defeats the point of using it. Always using a checkmark will also make the new component feel closer to the legacy menu
  • Re. Group labels, assess whether, in the current configuration, they "hurt" the ease of scanning / visual balance. I noticed that MacOS menus rarely use them, and when they do, they are not all caps
Screenshot 2026-10-02 at 09 34 22

@mirka

mirka commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Group labels, assess whether, in the current configuration, they "hurt" the ease of scanning / visual balance.

Menus may be a special case, but for the selection popups, I tried to establish in the documented patterns that groups with labels don't need separators:

Grouped select Select with separator

@fcoveram

fcoveram commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Here my thoughts:

  • +1 to align group labels and separators with item labels
  • +1 to @mirka’s question on aligning the same elements in other popovers. That also applies to the emoji search happening in Add emoji picker with Autocomplete grid  #83538
  • +1 to make the radio/check column width narrow.
  • +1 to @jasmussen’s idea of making the icon smaller. Maybe 20px works well.

we've discussed this many times, but it keeps coming back: maybe we should just always use a checkmark icon (instead of radio dots).

But how is it recognizable before interacting which options are single-select or multi-select? To me, this is the main problem, and the check or dot visual language is already used in checkboxes and radio buttons, so there is nothing new to learn.

Re. Group labels, assess whether, in the current configuration, they "hurt" the ease of scanning / visual balance. I noticed that MacOS menus rarely use them, and when they do, they are not all caps

I was thinking about this too. I don’t dislike the all caps version, but as part of the practices, we need to avoid using it because menus are contextual to the element that triggered them. The ellipsis menu in the Editor is trickier because it gathers different types of actions, but in most cases, the options displayed are already contextualized. IE, the ellipsis menu of a block in the ListView sidebar.

In addition to the above, I was thinking about using icons to highlight certain items. In the Editor’s options menu, showing an icon for the “Style” item makes sense, as it’s a section some users might not be aware of, but “Export” seems unnecessary, as the action is widely understood and the help text clearly explains what it does.

CleanShot 2026-10-02 at 10 00 04@2x

The rule that makes sense there is to show an icon on all group items if one item shows it.

@Mamaduka

Mamaduka commented Oct 2, 2026

Copy link
Copy Markdown
Member

A small update: this is how the options menu looks now. We removed the export icon.

The items in the Panels submenu are usually from 3rd parties, where we have less control. Icons could help there to differentiate sources (in most cases).

Screenshot

CleanShot 2026-10-02 at 12 14 47

@ciampo

ciampo commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Menus may be a special case, but for the selection popups, I tried to establish in the documented patterns that groups with labels don't need separators:

Good point, we should understand if we need separators in menus. My instinct says "yes", but curious to hear what others think, too

we've discussed this many times, but it keeps coming back: maybe we should just always use a checkmark icon (instead of radio dots).

But how is it recognizable before interacting which options are single-select or multi-select? To me, this is the main problem, and the check or dot visual language is already used in checkboxes and radio buttons, so there is nothing new to learn.

I know, and I was strongly in favour of radio dots.

But we keep getting pushback from design and product stakeholders, and users don't always seem to understand what the radio dot means anyway.

So that's why I'm proposing we use checkmark: it makes the new menu closer to the legacy (ie. less overwhelming), it trades off a better visual affordance of the behaviour, for fewer "signals" to scan.

I now believe that we should use checkmarks, at least initially, and separately investigate if / how to put radios back in a way that is aestatically more pleasing and more clear to end users .

MacOS doesn't use radios, for example. Base UI examples don't either

Screenshot 2026-10-02 at 10 20 31

The rule that makes sense there is to show an icon on all group items if one item shows it.

Yes, but this is tricky to enforce at the component level: we can mention it more prominently in the docs, and potentially even add dev-time warnings for it, but ultimately consumers will have to add those icons themselves.

@Mamaduka

Mamaduka commented Oct 2, 2026

Copy link
Copy Markdown
Member

Yes, but this is tricky to enforce at the component level: we can mention it more prominently in the docs, and potentially even add dev-time warnings for it, but ultimately consumers will have to add those icons themselves.

I think this doc is how most libraries or guidelines communicate similar requirements. "Yes, you can, but we recommend against it since it will look bad."

Warnings add extra complexity and could also be ignored by consumers.

@ciampo

ciampo commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

I opened #84015 stacked on top of this PR to work on spacing around checkbox/radio and prefix icon sizing.

I will also open a separate PR soon to test the "checkmark for radio items" change.

@ciampo ciampo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is an improvement over what we have on trunk 🚀

Implementation is clean and reuses current grid tracks

@jameskoster

Copy link
Copy Markdown
Contributor Author

My 2c:

  • Yes to indenting group labels (and dividers) across all popups.
  • Yes to narrowing the radio/checkmark column (again, across all popups).
  • Let’s try smaller icons.
  • I still see value in differentiating radio vs checkbox mechanics, but it’s not a hill I’ll die on.
  • Agree we should review group labels and dividers and codify the pattern. I don’t think group labels hurt scanning so long as they’re well aligned, but we should scrutinise when we use them. I don't think any of the labels here are adding much value:
Screenshot 2026-10-02 at 10 00 04

@fcoveram

fcoveram commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Implementation suggestions

I acknowledge the lack of control over what others can do, my suggestion points to the default system and the patterns we can document for designing menus. In that vein, the design itself suggests a preferred outcome, as showing just one icon adds empty space for the whole group and breaks the layout. Removing the icon in Export fixes that unnecessary indentation.

So the "Yes, you can, but we recommend against it since it will look bad” sounds good to me.

Checkmark or not

I trust you all instincts in using checkmark as a single language, I’m mainly concern of cases where both single- and multi-selection are side by side, but that can also be addressed by putting these elements inside submenus.

In that vein, given the extender’s flexibility and adaptability, can it automatically generate a menu instead of creating a set menu when only one item exists? A submenu with a single option is not a good decision. I haven’t looked at #82974 where this work happened.

CleanShot 2026-10-02 at 11 59 02@2x

Design idea

Here is an idea that involves all points mentioned by @jameskoster here

CleanShot 2026-10-02 at 12 11 32@2x

And here adapted to the current Editor's options menu in 7.1

CleanShot 2026-10-02 at 12 12 24@2x

Design

Link to Figma file in dev mode

@jameskoster

Copy link
Copy Markdown
Contributor Author

I'm going to merge this, let's continue to discuss the other details elsewhere.

@jameskoster
jameskoster merged commit 1ec14c8 into trunk Oct 2, 2026
130 of 132 checks passed
@jameskoster
jameskoster deleted the menu-align-group-labels branch October 2, 2026 11:05
@github-actions github-actions Bot added this to the Gutenberg 24.2 milestone Oct 2, 2026
widoz pushed a commit to widoz/gutenberg that referenced this pull request Oct 2, 2026
…ordPress#83993)

Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: fcoveram <fcoveram@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
@ciampo

ciampo commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

can it automatically generate a menu instead of creating a set menu when only one item exists?

That could be tricky, but not impossible. We'd need to check

One alternative is to treat those items as regular menu items instead of radio, ie. items that, when clicked, perform an action (open/pick a panel).

This is what MacOS does when choosing a window alignmen option:

Screenshot 2026-10-02 at 13 17 13

@Mamaduka

Mamaduka commented Oct 2, 2026

Copy link
Copy Markdown
Member

In that vein, given the extender’s flexibility and adaptability, can it automatically generate a menu instead of creating a set menu when only one item exists? A submenu with a single option is not a good decision.

Need to double-check the internals, but I think that should be possible. I'll have a look on Monday.

@ciampo

ciampo commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Trying an approach in #84033, which also adds an Inspector panel entry

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

Labels

Design System Issues related to the system of combining components according to best practices. [Package] UI /packages/ui [Type] Enhancement A suggestion for improvement.

Projects

Status: 💫 Done

Development

Successfully merging this pull request may close these issues.

6 participants