Skip to content

Navigation: Migrate overlay selection to UI SelectControl - #86619

Merged
ciampo merged 4 commits into
trunkfrom
codex/selectcontrol-navigation-overlay
Nov 11, 2026
Merged

ciampo merged 4 commits into
trunkfrom
codex/selectcontrol-navigation-overlay

Conversation

@ciampo

@ciampo ciampo commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

See #80412.

What?

Migrate Navigation's Overlay template selector to SelectControl from @wordpress/ui.

Why?

Continue the select-control migration in the Navigation block's Overlay settings.

How?

Use item objects and a non-empty serialized value for the Default choice. Keep the stored overlay slug, async options, missing-overlay warning, disabled state, label, and help text.

Testing Instructions

  1. Activate a block theme and create two template parts in the Navigation overlay area.
  2. Insert a Navigation block in a post or template. Open its Settings tab and expand Overlay with visibility set to Mobile or Always.
  3. Confirm that Overlay template initially shows Default. Select an overlay, then choose Default and confirm the block's overlay attribute is cleared.
  4. Check the trigger idle and hovered. Open the popup and hover its items. Confirm the popup appears above the editor UI and remains within the viewport.
  5. Set the block's overlay attribute to a deleted overlay slug. Confirm the missing choice and warning appear, then use Reset to default overlay.

Testing Instructions for Keyboard

  1. Tab to Overlay template and confirm the focus ring is visible.
  2. Press Space to open the popup. Use the arrow keys to move between items and Enter to select one.
  3. Reopen the popup and press Escape. Confirm it closes and focus returns to the trigger.

Screenshots or screencast

Recorded in Chrome with Twenty Twenty-Three, the same two overlay choices, a 1280 × 800 viewport, and a 1282 × 926 browser-window recording area. No audio or added visual overlays.

Before. Shows the native trigger idle, hovered, and keyboard focused, then the popup opened from the keyboard. Native item hover and arrow-key movement could not be automated in the macOS popup.

navigation-before.mp4

After. Shows the closed trigger idle, hovered, and keyboard focused, then the open popup with hovered and keyboard-focused items, followed by Escape dismissal and focus return.

navigation-after.mp4

Screen reader smoke testing remains manual.

Use of AI Tools

Codex implemented the migration, adapted and extended the tests, checked the editor interactions, and prepared this PR and its recordings.

@github-actions

github-actions Bot commented Nov 10, 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: ciampo <mciampini@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@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.

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric e3ada9f trunk % Change
timeToFirstByte 44.35 ms +11.84% -2.71% 43.9 ms +11.28% -2.28% 1.03%
largestContentfulPaint 72 ms +5.56% -5.56% 72 ms +8.33% -5.56% 0%
lcpMinusTtfb 25.05 ms +25.15% -3.79% 24.6 ms +29.27% -4.88% 1.83%
wpBeforeTemplate 23.1 ms +18.1% -2.9% 22.91 ms +14.05% -2.79% 0.83%
wpTemplate 17.78 ms +7.93% -3.32% 17.71 ms +4.23% -3.56% 0.4%
wpTotal 40.99 ms +12.42% -2.61% 40.45 ms +12.14% -2.52% 1.33%
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 e3ada9f trunk % Change
timeToFirstByte 36.85 ms +9.09% -1.36% 36.55 ms +6.43% -3.42% 0.82%
largestContentfulPaint 68 ms +5.88% -5.88% 66 ms +3.03% -3.03% 3.03%
lcpMinusTtfb 28.5 ms +11.93% -3.51% 29.15 ms +6.35% -3.6% -2.23%
wpBeforeTemplate 19.69 ms +17.93% -1.47% 19.6 ms +6.99% -1.48% 0.46%
wpTemplate 14.11 ms +1.56% -1.35% 13.63 ms +7.19% -6.53% 3.52%
wpTotal 33.74 ms +11.03% -1.24% 33.7 ms +6.59% -3.77% 0.12%
wpMemoryUsage 6.41 MB +0% -0% 6.37 MB +0% -0% 0.53%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric e3ada9f trunk % Change
mediaProcessingJpeg 327.78 ms +0.63% -0.43% 326 ms +0.65% -0.47% 0.55%
mediaProcessingAvif 4883.68 ms +0.42% -0.49% 4896.15 ms +0.23% -0.42% -0.25%
mediaProcessingJpegToAvif 3392.87 ms +0.11% -0.12% 3407.96 ms +0.13% -0.05% -0.44%

media-upload

Metric e3ada9f trunk % Change
jpegUploadProcessing 1464.11 ms +2.42% -0.7% 1447.24 ms +0.69% -0.25% 1.17%
pngUploadProcessing 242.62 ms +7.03% -3.71% 242.59 ms +5.16% -1.17% 0.01%
largeJpegUploadProcessing 1441.87 ms +0.75% -0.36% 1438.27 ms +0.67% -0.2% 0.25%
multipleImageUploadProcessing 1516.85 ms +0.48% -1.24% 1512.87 ms +0.69% -1.03% 0.26%

post-editor

Metric e3ada9f trunk % Change
serverResponse 493.53 ms +3.01% -8.59% 474.26 ms +1.98% -6.91% 4.06%
firstPaint 460.56 ms +4.71% -5.61% 393.18 ms +2.87% -5.19% 17.14%
domContentLoaded 835.97 ms +4% -1.02% 809.5 ms +2.11% -0.4% 3.27%
loaded 837.09 ms +4.01% -0.99% 810.63 ms +2.08% -0.39% 3.26%
firstContentfulPaint 480.46 ms +5.22% -2.44% 457.68 ms +0.5% -1.98% 4.98%
firstBlock 2252.56 ms +1.81% -0.62% 2176.37 ms +0.67% -0.44% 3.5%
type 16.98 ms +3.71% -3.42% 18.73 ms +7.31% -4.43% -9.34%
typeWithoutInspector 17.18 ms +6.98% -5.88% 18.85 ms +5.94% -6.79% -8.86%
typeWithTopToolbar 23.93 ms +2.63% -11.78% 26.63 ms +4.54% -8.86% -10.14%
typeContainer 8.68 ms +7.14% -11.06% 8.31 ms +8.66% -5.66% 4.45%
focus 126.44 ms +5.09% -7.92% 117.44 ms +2.32% -5.01% 7.66%
firstFocus 291.34 ms +0% -0% 255.5 ms +0% -0% 14.03%
selectAll 428.16 ms +2.72% -4.53% 409.77 ms +0.37% -0.47% 4.49%
undo 29.34 ms +5.35% -6.61% 28.01 ms +8.78% -4.18% 4.75%
listViewOpen 81.62 ms +3.75% -5.29% 80.19 ms +9.03% -5.81% 1.78%
inserterOpen 44.88 ms +2.32% -11.14% 42.12 ms +9.21% -4.63% 6.55%
inserterHover 12.01 ms +10.57% -9.24% 11.57 ms +12.71% -9.59% 3.8%
inserterSearch 8.34 ms +10.91% -11.51% 7.82 ms +14.19% -9.85% 6.65%
loadPatterns 656.82 ms +6.27% -3.11% 643.16 ms +2.99% -2.43% 2.12%
wpTotal 483.83 ms +2.77% -8.74% 464.74 ms +2.01% -7.08% 4.11%
wpMemoryUsage 14.77 MB +0% -0% 14.73 MB +0% -0% 0.24%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric e3ada9f trunk % Change
serverResponse 240.13 ms +1.67% -9.05% 240.96 ms +2.24% -8.11% -0.34%
firstPaint 285.92 ms +5.19% -13.92% 259.26 ms +12.28% -8.1% 10.28%
domContentLoaded 511.31 ms +3.71% -0.97% 495.82 ms +2.88% -0.71% 3.12%
loaded 512.14 ms +3.7% -0.99% 496.42 ms +2.89% -0.7% 3.17%
firstContentfulPaint 295.82 ms +5.48% -2.43% 291.65 ms +2.51% -1.56% 1.43%
firstBlock 1558.97 ms +1.9% -0.82% 1531.46 ms +1.93% -0.84% 1.8%
type 11.41 ms +15.86% -3.59% 11.44 ms +3.85% -6.38% -0.26%
navigate 71.6 ms +1.28% -3.44% 71.25 ms +5.91% -3.49% 0.49%
loadPatterns 968.16 ms +8.63% -3.6% 919.78 ms +3.09% -6.13% 5.26%
loadPages 891.84 ms +1.77% -1.51% 895.41 ms +1.69% -0.91% -0.4%
wpTotal 233.98 ms +1.72% -9.28% 234.83 ms +2.31% -8.33% -0.36%
wpMemoryUsage 12.78 MB +0% -0% 12.75 MB +0% -0% 0.27%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

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

Actions are reachable via RIGHT/LEFT arrow keys in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByRole('row', { name: 'Page One Edit Actions' }).getByRole('button', { name: 'Edit' })
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByRole('row', { name: 'Page One Edit Actions' }).getByRole('button', { name: 'Edit' }) with timeout 5000ms
  - waiting for getByRole('row', { name: 'Page One Edit Actions' }).getByRole('button', { name: 'Edit' })
    14 × locator resolved to <button type="button" tabindex="-1" class="components-button is-small" id="view-list-0-191-primary-action-edit-post">Edit</button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:172:5
Navigates the items list via UP/DOWN arrow keys in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByLabel('Page Two')
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByLabel('Page Two') with timeout 5000ms
  - waiting for getByLabel('Page Two')
    14 × locator resolved to <button type="button" tabindex="-1" aria-pressed="false" id="view-list-0-174-item-wrapper" class="dataviews-view-list__item" aria-labelledby="view-list-0-174-label" aria-describedby="view-list-0-174-description"></button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:146:49
Page List converts to Navigation Links with entity bindings in /test/e2e/specs/editor/blocks/navigation.spec.js, passed after 1 failed attempt.
Error: expect(locator).toContainText(expected) failed

Locator: getByRole('region', { name: 'Editor settings' }).getByRole('tabpanel', { name: 'Content' }).getByRole('button', { name: /Link to:/ })
Expected substring: "test-page-1"
Received string:    "Link to:Cat/catPagePublished"
Timeout: 5000ms

Call log:
  - Expect "toContainText" getByRole('region', { name: 'Editor settings' }).getByRole('tabpanel', { name: 'Content' }).getByRole('button', { name: /Link to:/ }) with timeout 5000ms
  - waiting for getByRole('region', { name: 'Editor settings' }).getByRole('tabpanel', { name: 'Content' }).getByRole('button', { name: /Link to:/ })
    14 × locator resolved to <button type="button" aria-expanded="false" aria-haspopup="dialog" class="components-button link-preview-button is-next-40px-default-size is-secondary">…</button>
       - unexpected value "Link to:Cat/catPagePublished"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/navigation.spec.js:1949:31
Undo restores the post selection when another synced entity is loaded 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": 1,
+   "offset": 1,
  }

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
does not select blocks in the canvas preview when editing from the sidebar (Site Editor v2) in /test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator: getByRole('combobox', { name: 'Search or type URL' })
Expected: focused
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeFocused" getByRole('combobox', { name: 'Search or type URL' }) with timeout 5000ms
  - waiting for getByRole('combobox', { name: 'Search or type URL' })

    at LinkControl.useLinkControlSearch (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:416:47)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:179:21
templates can be registered and edited (Site Editor v2) in /test/e2e/specs/site-editor/template-registration.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeVisible() failed

Locator: getByText('AuthorGutenberg')
Expected: visible
Error: strict mode violation: getByText('AuthorGutenberg') resolved to 3 elements:
    1) <div data-wp-c16t="true" data-wp-component="Flex" class="_463056a1846babdd__flex eefcc0383f58d3a1__items-row _8a741740b23dfb57__expanded-row components-flex dataviews-view-grid__field">…</div> aka getByRole('row', { name: 'Row 1' }).getByText('AuthorGutenberg')
    2) <div data-wp-c16t="true" data-wp-component="Flex" class="_463056a1846babdd__flex eefcc0383f58d3a1__items-row _8a741740b23dfb57__expanded-row components-flex dataviews-view-grid__field">…</div> aka locator('[id="emptytheme//page"]').getByText('AuthorGutenberg')
    3) <div data-wp-c16t="true" data-wp-component="Flex" class="_463056a1846babdd__flex eefcc0383f58d3a1__items-row _8a741740b23dfb57__expanded-row components-flex dataviews-view-grid__field">…</div> aka locator('[id="emptytheme//plugin-template"]').getByText('AuthorGutenberg')

Call log:
  - Expect "toBeVisible" getByText('AuthorGutenberg') with timeout 5000ms
  - waiting for getByText('AuthorGutenberg')

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/template-registration.spec.js:60:55

f07729a Run

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Nov 10, 2026
@ciampo ciampo added the [Type] Enhancement A suggestion for improvement. label Nov 10, 2026 — with ChatGPT Codex Connector
@ciampo ciampo self-assigned this Nov 10, 2026
@ciampo
ciampo marked this pull request as ready for review November 10, 2026 17:56
@ciampo
ciampo requested a review from fabiankaegy as a code owner November 10, 2026 17:56
@ciampo
ciampo requested review from a team, Mamaduka, ramonjd and t-hamano November 10, 2026 17:56

@ramonjd ramonjd left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

✅ Picking an overlay saves its slug, and Default clears the attribute
✅ Control labels appear as expected, i.e, "Overlay template"

image

Works as expected on the frontend (overlay and default)

2026-11-11.10.24.27.mp4

@ciampo
ciampo merged commit 5763f8b into trunk Nov 11, 2026
83 of 84 checks passed
@ciampo
ciampo deleted the codex/selectcontrol-navigation-overlay branch November 11, 2026 06:47
@github-actions github-actions Bot added this to the Gutenberg 24.5 milestone Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants