Skip to content

Menu: Add extensible menu migration guidance - #81821

Draft
ciampo wants to merge 1 commit into
trunkfrom
codex/menu-slotfill-compatibility
Draft

ciampo wants to merge 1 commit into
trunkfrom
codex/menu-slotfill-compatibility

Conversation

@ciampo

@ciampo ciampo commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Follow up to #79560.
See #61094, #81507, and #81564.

What?

Adds a Storybook migration guide for menus that receive items through SlotFill or another extension API, and links it from Menu's component status.

Why?

Gutenberg can bundle separate copies of @wordpress/ui into the menu owner and extension packages. Their Menu parts do not share React context, so the owner needs a compatibility layer that preserves the extension API's existing behavior.

The Options menu migration in #81564 exposed compatibility details that a simplified adapter would miss, including checked states, accessible names, links, shortcuts, icons, and custom renderers.

How?

Documents a host-owned adapter passed through ActionItem.Slot, with the slot's children callback composing the rendered items into the new menu. The guide requires an audit and public-path tests for the legacy item contract. It treats arbitrary custom renderers as a separate deprecation or release-policy decision.

It also adds the documentation changelog entry under the current unreleased section.

Testing Instructions

  1. Run npm run storybook:dev.
  2. Open Design System / Components / Menu / Migration Guide.
  3. Confirm the guide covers package-copy context, ActionItem.Slot composition, legacy item compatibility, custom renderers, testing, and migration order.
  4. Open Design System / Components / Menu and confirm the status note links to the migration guide.

Testing Instructions for Keyboard

Documentation-only change. Verify that links in the Menu status note and migration guide can be reached and activated with the keyboard.

Use of AI Tools

This PR was implemented with AI assistance in Codex and reviewed locally.

@github-actions github-actions Bot added the [Package] UI /packages/ui label Aug 19, 2026
@github-actions

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 7.73 MB

compressed-size-action

@ciampo
ciampo force-pushed the codex/menu-slotfill-compatibility branch from b97c341 to c56ea30 Compare September 1, 2026 16:56
@ciampo ciampo changed the title Menu: Document extensible menu migrations Menu: Add extensible menu migration guidance Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

📦 Bundle size

Size Change: 0 B

Total Size: 7.91 MB

c56ea30 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric deed3ec trunk % Change
timeToFirstByte 50.1 ms +7.88% -9.08% 48.75 ms +12.31% -5.74% 2.77%
largestContentfulPaint 80 ms +2.5% -5% 80 ms +10% -5% 0%
lcpMinusTtfb 28.2 ms +8.87% -6.38% 27.7 ms +18.77% -6.14% 1.81%
wpBeforeTemplate 23.39 ms +14.96% -8.25% 22.3 ms +22.47% -2.74% 4.89%
wpTemplate 21.73 ms +3.5% -3.91% 22.41 ms +4.73% -7.27% -3.03%
wpTotal 46.75 ms +5.5% -9.63% 45.41 ms +10.72% -6.19% 2.95%
wpMemoryUsage 7.54 MB +0% -0% 7.50 MB +0% -0% 0.45%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric deed3ec trunk % Change
timeToFirstByte 32.75 ms +12.52% -4.12% 32.95 ms +5.61% -6.98% -0.61%
largestContentfulPaint 70 ms +2.86% -8.57% 70 ms +2.86% -8.57% 0%
lcpMinusTtfb 34.85 ms +8.61% -4.16% 34.6 ms +9.83% -5.2% 0.72%
wpBeforeTemplate 20.14 ms +7.55% -5.01% 19.67 ms +7.52% -8.03% 2.39%
wpTemplate 9.68 ms +7.02% -2.58% 9.61 ms +17.9% -3.75% 0.73%
wpTotal 29.94 ms +13.19% -3.77% 30.25 ms +6.28% -8.53% -1.02%
wpMemoryUsage 5.42 MB +0% -0% 5.38 MB +0% -0% 0.65%
wpDbQueries 10 +0% -0% 10 +0% -0% 0%

media-processing

Metric deed3ec trunk % Change
mediaProcessingJpeg 338.1 ms +2.73% -2.19% 335.75 ms +2.14% -2.43% 0.7%
mediaProcessingAvif 5075.63 ms +0.75% -0.42% 5078.73 ms +0.17% -0.72% -0.06%
mediaProcessingJpegToAvif 3558.52 ms +0.5% -0.48% 3552.81 ms +0.39% -1.33% 0.16%

media-upload

Metric deed3ec trunk % Change
jpegUploadProcessing 1404.67 ms +3.18% -0.74% 1406.17 ms +0.24% -0.96% -0.11%
pngUploadProcessing 175.84 ms +25.86% -1.11% 193.29 ms +24.01% -9.11% -9.03%
largeJpegUploadProcessing 1392.02 ms +0.76% -0.61% 1394.29 ms +0.38% -1.21% -0.16%
multipleImageUploadProcessing 1510.28 ms +0.85% -3.17% 1485.01 ms +0.53% -1.44% 1.7%

post-editor

Metric deed3ec trunk % Change
serverResponse 442.78 ms +3.13% -7.47% 413.55 ms +9.73% -1.19% 7.07%
firstPaint 269.34 ms +31.66% -26.59% 228.02 ms +8.13% -22.02% 18.12%
domContentLoaded 1271.91 ms +2.16% -0.28% 1274.47 ms +0.89% -1.47% -0.2%
loaded 1273.22 ms +2.15% -0.29% 1275.7 ms +0.89% -1.45% -0.19%
firstContentfulPaint 429.12 ms +2.59% -6.49% 431.05 ms +3.49% -3.75% -0.45%
firstBlock 3401.19 ms +0.28% -1.85% 3405.62 ms +1.2% -0.97% -0.13%
type 21.13 ms +11.12% -18.17% 19.68 ms +11.33% -13.26% 7.37%
typeWithoutInspector 20.93 ms +14.19% -16.77% 20.04 ms +4.69% -17.56% 4.44%
typeWithTopToolbar 23.11 ms +8.74% -20.68% 22.67 ms +11.2% -13.98% 1.94%
typeContainer 9.29 ms +5.92% -3.34% 8.52 ms +5.87% -4.58% 9.04%
focus 80.32 ms +11.45% -9.25% 74.96 ms +18.25% -9.89% 7.15%
firstFocus 176.76 ms +0% -0% 154.93 ms +0% -0% 14.09%
selectAll 566.53 ms +3.43% -1.41% 564.82 ms +0.4% -3.57% 0.3%
listViewOpen 63.32 ms +16.3% -2.01% 64.88 ms +8.11% -12.36% -2.4%
inserterOpen 24.22 ms +5.41% -5.08% 23.54 ms +12.62% -7.01% 2.89%
inserterHover 3.8 ms +12.63% -11.58% 3.37 ms +8.61% -13.95% 12.76%
inserterSearch 8.74 ms +6.18% -4.92% 8.44 ms +6.64% -9.95% 3.55%
loadPatterns 640.09 ms +3% -1.64% 623.14 ms +5.04% -1.47% 2.72%
wpTotal 431.37 ms +3.27% -7.5% 402.03 ms +10% -1.15% 7.3%
wpMemoryUsage 13.13 MB +0% -0% 13.10 MB +0% -0% 0.22%
wpDbQueries 54 +0% -1.85% 54 +0% -1.85% 0%

site-editor

Metric deed3ec trunk % Change
serverResponse 450.77 ms +1.96% -1.86% 457.45 ms +3.95% -9.48% -1.46%
firstPaint 242.01 ms +16.02% -12.09% 233.98 ms +15.32% -7.27% 3.43%
domContentLoaded 1336.58 ms +1.67% -0.72% 1326.19 ms +2% -0.97% 0.78%
loaded 1337.74 ms +1.67% -0.72% 1327.38 ms +2% -0.98% 0.78%
firstContentfulPaint 419.36 ms +2.18% -1.05% 419.84 ms +6.56% -3.82% -0.11%
firstBlock 4093.58 ms +0.6% -0.72% 4057.69 ms +1.14% -0.85% 0.88%
type 20.14 ms +11.97% -18.27% 20.33 ms +12.25% -15% -0.93%
navigate 105.54 ms +13.81% -2.25% 110.27 ms +5.55% -7.04% -4.29%
loadPatterns 1336.53 ms +19.96% -9.28% 1292.12 ms +7.31% -2.85% 3.44%
loadPages 1094.38 ms +3.28% -1.77% 1081.96 ms +2.81% -0.93% 1.15%
wpTotal 440.87 ms +1.94% -1.99% 447.61 ms +3.91% -9.78% -1.51%
wpMemoryUsage 12.02 MB +0% -0% 11.99 MB +0% -0% 0.31%
wpDbQueries 43.5 +1.15% -1.15% 43 +2.33% -0% 1.16%

c56ea30 Run

@ciampo

ciampo commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

cc @Mamaduka for an early look

@Mamaduka

Mamaduka commented Sep 2, 2026

Copy link
Copy Markdown
Member

This looks like a good start! A couple of quick notes:

  • It seems that the guide is promoting <ActionItem> usage; we should be clear that it's an example.
  • Also plan to refactor packages/editor/src/components/preview-dropdown/index.jsx; I don't expect new challenges, but it should give us a better idea.

@ciampo

ciampo commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author
  • Also plan to refactor packages/editor/src/components/preview-dropdown/index.jsx; I don't expect new challenges, but it should give us a better idea.

Sounds like a plan! I'm also going to start refactoring a few Menu usages, let's gather more into during those refactors

This branch has not been deployed

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

Labels

[Package] UI /packages/ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants