Skip to content

UI: Keep popup grid areas out of inline list parts - #86652

Merged
mirka merged 6 commits into
trunkfrom
fix/ui-inline-list-grid-areas
Nov 12, 2026
Merged

mirka merged 6 commits into
trunkfrom
fix/ui-inline-list-grid-areas

Conversation

@mirka

@mirka mirka commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

What?

See #86338.

Keeps an inline Autocomplete or Combobox list, empty state, and status from being placed in grid areas that only exist inside the item popup. When these parts render inline in a consumer's CSS grid, they now follow that grid like any other child.

Why?

The item popup is a grid with the named areas header, status, and main, and List, Empty, and Status were placed in those areas wherever they rendered. Inline, the parts render in the consumer's layout instead, where those names do not exist. In a grid, each unknown area name creates implicit lines, so the part lands in an extra implicit row and column, outside the tracks the consumer defined. The special characters picker in #86338 hit this with a fixed-height grid around Autocomplete.Empty and Autocomplete.List, and had to switch the wrapper to a flex column. Point 5 of #83538 (comment) describes the same mismatch.

The blast radius is narrow. Nothing changes for the higher-level components (Select, SearchableSelect, SearchableChipSelect, and their controls) or for Combobox and Autocomplete used with a popup, whose popups render the same as before. The change is only observable when Combobox or Autocomplete is used inline and List, Empty, or Status is a direct child of the consumer's own CSS grid. In that setup the parts were already misplaced. The only consumer that could break is one whose grid defines its own main or status areas and relies on these parts landing in them, which would now need to place them with a className. A quick audit of public third-party code that uses these primitives found no inline usage in a grid. The projects found all render the parts inside a popup, and the one inline consumer in this repository does not use a grid.

How?

The placements are scoped to descendants of the popup rather than direct children, so a consumer who wraps parts in a display: contents element inside the popup keeps the current layout. :where() keeps the specificity of each rule as it was, so existing consumer overrides still win as before.

Testing Instructions

  1. In Storybook, open Design System > Components > Form > Primitives > Autocomplete > Inline.
  2. In the browser developer tools, give the element around the list display: grid; grid-template-rows: auto minmax(0, 1fr).
  3. Type zzz in the input. "No commands found." should appear at the top of that element. On trunk, it appears at its bottom, offset to the right.
  4. Open the popups in the Select, Combobox, Autocomplete, and SearchableSelect stories, including the loading and empty states in the async stories. They should look the same as on trunk.

Screenshots or screencast

An inline Autocomplete in a fixed-height grid with rows auto minmax(0, 1fr) (dashed outline), holding Autocomplete.Empty and Autocomplete.List.

Before After
Before: the list is pushed to the right and overflows below the grid After: the list fills the grid and scrolls inside it
Before: the empty message sits at the bottom right of the grid After: the empty message sits at the top of the grid

The Combobox popup is identical before and after:

Combobox popup with a search input, a list of fruits, and a create item footer

The item popup placed List, Empty and Status in its named grid areas
regardless of where they rendered. An inline Autocomplete or Combobox
placed in a consumer's CSS grid then landed in an extra implicit row
and column. Scope the placements to the popup so inline parts follow
the surrounding layout.

Co-Authored-By: Claude <noreply@anthropic.com>
@mirka mirka added [Type] Bug An existing feature does not function as intended [Package] UI /packages/ui labels Nov 11, 2026
@mirka mirka self-assigned this Nov 11, 2026
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 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: mirka <0mirka00@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

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

📦 Bundle size

Size Change: +816 B (+0.01%)

Total Size: 8.64 MB

📦 View Changed
Filename Size Change
build/modules/core-fields/post_type_supports.min.js 80.9 kB +74 B (+0.09%)
build/modules/workflow/index.min.js 42.2 kB +56 B (+0.13%)
build/scripts/block-editor/index.min.js 546 kB +63 B (+0.01%)
build/scripts/block-library/index.min.js 427 kB +168 B (+0.04%)
build/scripts/components/index.min.js 337 kB +57 B (+0.02%)
build/scripts/edit-site/index.min.js 380 kB +70 B (+0.02%)
build/scripts/editor/index.min.js 569 kB +138 B (+0.02%)
build/scripts/format-library/index.min.js 73.1 kB +63 B (+0.09%)
build/scripts/media-utils/index.min.js 235 kB +67 B (+0.03%)
build/scripts/widgets/index.min.js 65 kB +60 B (+0.09%)

16aa133 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 39bff4f trunk % Change
timeToFirstByte 57.9 ms +7.17% -8.2% 55.3 ms +6.96% -2.62% 4.7%
largestContentfulPaint 90 ms +8.89% -4.44% 90 ms +6.67% -6.67% 0%
lcpMinusTtfb 30.65 ms +23.82% -9.62% 29.95 ms +27.55% -6.84% 2.34%
wpBeforeTemplate 30.96 ms +13.86% -7.4% 29.52 ms +9.35% -3.96% 4.88%
wpTemplate 22.23 ms +4.41% -6.52% 22.33 ms +2.64% -3.13% -0.45%
wpTotal 53.99 ms +7.76% -8.58% 51.48 ms +7.61% -2.8% 4.88%
wpMemoryUsage 7.72 MB +0% -0% 7.68 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 39bff4f trunk % Change
timeToFirstByte 46.5 ms +6.88% -2.58% 46.45 ms +8.4% -3.01% 0.11%
largestContentfulPaint 82 ms +2.44% -2.44% 80 ms +7.5% -0% 2.5%
lcpMinusTtfb 35.3 ms +3.54% -3.68% 34.65 ms +2.02% -3.17% 1.88%
wpBeforeTemplate 26.57 ms +7.19% -2.67% 26.29 ms +10.5% -1.26% 1.07%
wpTemplate 16.29 ms +3.19% -1.78% 16.45 ms +8.45% -3.28% -0.97%
wpTotal 43.26 ms +6.61% -2.43% 42.86 ms +9.8% -2.36% 0.93%
wpMemoryUsage 6.41 MB +0% -0% 6.37 MB +0% -0% 0.53%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 39bff4f trunk % Change
mediaProcessingJpeg 402.47 ms +0.48% -0.68% 402.77 ms +0.55% -0.65% -0.07%
mediaProcessingAvif 6185.06 ms +0.1% -0.22% 6180.82 ms +0.12% -0.5% 0.07%
mediaProcessingJpegToAvif 4262.16 ms +0.15% -0.68% 4246.88 ms +0.46% -0.15% 0.36%

media-upload

Metric 39bff4f trunk % Change
jpegUploadProcessing 1989.67 ms +0.6% -0.95% 1978.18 ms +1.47% -18.66% 0.58%
pngUploadProcessing 294.52 ms +5.11% -4.32% 275.23 ms +3.75% -2.69% 7.01%
largeJpegUploadProcessing 1960.84 ms +0.76% -22.57% 1978.79 ms +0.52% -23.03% -0.91%
multipleImageUploadProcessing 2091.71 ms +2.37% -5% 2088.46 ms +0.27% -0.31% 0.16%

post-editor

Metric 39bff4f trunk % Change
serverResponse 330.56 ms +6.19% -9.24% 321.79 ms +4.59% -6.81% 2.73%
firstPaint 343.87 ms +17.37% -7.49% 336.96 ms +6.24% -3.69% 2.05%
domContentLoaded 681.6 ms +6.49% -1.82% 668.84 ms +0.6% -0.63% 1.91%
loaded 682.63 ms +6.49% -1.84% 669.82 ms +0.61% -0.65% 1.91%
firstContentfulPaint 386.48 ms +5.93% -2.54% 379.7 ms +2.52% -1.68% 1.79%
firstBlock 1836.28 ms +8.04% -3.5% 1760.51 ms +0.66% -0.99% 4.3%
type 16.8 ms +10.48% -14.35% 16.13 ms +1.36% -9.18% 4.15%
typeWithoutInspector 16.44 ms +7.18% -4.5% 16.99 ms +3.71% -8.83% -3.24%
typeWithTopToolbar 21.83 ms +4.67% -9.12% 22.06 ms +5.26% -7.12% -1.04%
typeContainer 7.78 ms +7.71% -9.64% 8.07 ms +12.39% -10.29% -3.59%
focus 105.91 ms +1.61% -11.72% 102.69 ms +5.52% -4.15% 3.14%
firstFocus 214.04 ms +0% -0% 215.83 ms +0% -0% -0.83%
selectAll 312.28 ms +2.08% -0.73% 316.28 ms +0.14% -2.31% -1.26%
undo 26.09 ms +5.02% -7.13% 26.12 ms +5.59% -5.02% -0.11%
listViewOpen 63.65 ms +4.62% -7.92% 69.69 ms +8.7% -12.48% -8.67%
inserterOpen 37.13 ms +6.68% -3.58% 36.07 ms +10.81% -4.19% 2.94%
inserterHover 10.51 ms +5.23% -6.57% 10.52 ms +8.08% -8.56% -0.1%
inserterSearch 7.11 ms +3.94% -3.38% 7.35 ms +14.29% -5.03% -3.27%
loadPatterns 526.61 ms +10.2% -3.06% 509.96 ms +9.75% -1.16% 3.26%
wpTotal 321.92 ms +6.34% -9.47% 312.91 ms +4.82% -6.91% 2.88%
wpMemoryUsage 14.77 MB +0% -0% 14.74 MB +0% -0% 0.24%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 39bff4f trunk % Change
serverResponse 479.76 ms +0.85% -8.71% 478.61 ms +0.28% -4.87% 0.24%
firstPaint 417.23 ms +11.96% -6.9% 403.74 ms +4.11% -4.22% 3.34%
domContentLoaded 838.95 ms +4.68% -2.1% 836.54 ms +0.92% -1.12% 0.29%
loaded 839.99 ms +4.67% -2.07% 837.8 ms +0.88% -1.14% 0.26%
firstContentfulPaint 469.38 ms +5.18% -2.52% 459.44 ms +1.97% -1.72% 2.16%
firstBlock 2590.2 ms +0.84% -1.17% 2536.79 ms +2.39% -0.36% 2.11%
type 16.78 ms +9.12% -5.54% 17.63 ms +5.73% -10.32% -4.82%
navigate 119.13 ms +1.49% -4.69% 112.61 ms +14% -3.03% 5.79%
loadPatterns 1393.54 ms +5.71% -6.63% 1381.96 ms +6.65% -14.01% 0.84%
loadPages 981.18 ms +1.63% -1.18% 967.13 ms +2.09% -0.87% 1.45%
wpTotal 470.26 ms +0.9% -8.88% 469.03 ms +0.28% -4.97% 0.26%
wpMemoryUsage 12.79 MB +0% -0% 12.75 MB +0% -0% 0.27%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

16aa133 Run

🏁 Flaky tests

Some 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.

Undo restores the post selection when another synced entity is loaded (RTC WebSocket) in /test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

  Object {
    "attributeKey": "content",
    "blockIndex": 0,
    "content": "abcdef",
-   "endOffset": 3,
-   "offset": 3,
+   "endOffset": 6,
+   "offset": 6,
  }

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts:363:5

16aa133 Run

mirka and others added 2 commits November 11, 2026 18:43
Co-Authored-By: Claude <noreply@anthropic.com>
Any break in the popup placement shows in every Select, Combobox and
Autocomplete popup story. Keep the inline layout test, since no story
renders inline parts in a consumer grid.

Co-Authored-By: Claude <noreply@anthropic.com>
} );
} );

it( 'places inline list parts in the grid of the consumer', async () => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think this is worth testing because it has the potential to regress in future iterations, and partial regressions (like with Empty) may not be immediately obvious in Storybook.

@mirka
mirka marked this pull request as ready for review November 11, 2026 12:05
@mirka
mirka requested a review from a team as a code owner November 11, 2026 12:05

@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.

LGTM 🚀

@mirka
mirka merged commit a7d3ead into trunk Nov 12, 2026
82 checks passed
@mirka
mirka deleted the fix/ui-inline-list-grid-areas branch November 12, 2026 02:51
@github-actions github-actions Bot added this to the Gutenberg 24.5 milestone Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] UI /packages/ui [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants