Skip to content

Admin UI: Update Page breadcrumbs to receive configuration array - #86982

Open
aduth wants to merge 4 commits into
trunkfrom
update/admin-ui-page-breadcrumbs-items
Open

aduth wants to merge 4 commits into
trunkfrom
update/admin-ui-page-breadcrumbs-items

Conversation

@aduth

@aduth aduth commented Nov 17, 2026

Copy link
Copy Markdown
Member

What?

Closes #77040

Updates @wordpress/admin-ui to remove Breadcrumbs from its public API, instead receiving breadcrumbs on the Page component as an array configuration.

In doing so, it also addresses several bug fixes and improvements:

Why?

This was always the intention, and ties together several pieces around API design of configuration props in #76709 (comment), and decoupling Page from routing in #77040.

For parity, it follows the pattern established in #79746, which did the same thing effectively for navigation, accepting it as a configuration object rather than an element.

How?

The breadcrumbs prop now takes an array of { label, href } items in place of a Breadcrumbs element. This is a breaking change. The package is a bundled package so this is expected to be published as a new major version.

Testing Instructions

Test affected routes (e.g. Site Health, Extensible Site Editor Navigation editing, Media editor, etc.) and ensure there are no regressions with the appearance and functionality of the breadcrumbs.

Use of AI Tools

Researched and implemented in coordination with Claude Code + Opus 5.5.

@aduth
aduth requested review from a team and jameskoster November 17, 2026 21:25
@aduth
aduth requested a review from retrofox as a code owner November 17, 2026 21:25
@aduth aduth added the [Type] Breaking Change For PRs that introduce a change that will break existing functionality label Nov 17, 2026
Copilot AI balanced review requested due to automatic review settings November 17, 2026 21:25
@github-actions github-actions Bot added the [Package] Admin UI /packages/admin-ui label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @MrSuddenJoy.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: MrSuddenJoy.

Co-authored-by: aduth <aduth@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: simison <simison@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: +1.09 kB (+0.01%)

Total Size: 8.7 MB

📦 View Changed
Filename Size Change
build/modules/boot/index.min.js 52.2 kB +435 B (+0.84%)
build/scripts/customize-widgets/index.min.js 22.9 kB +3 B (+0.01%)
build/scripts/edit-post/index.min.js 45.3 kB +41 B (+0.09%)
build/scripts/edit-site/index.min.js 384 kB +569 B (+0.15%)
build/scripts/edit-widgets/index.min.js 29.2 kB +5 B (+0.02%)
build/scripts/editor/index.min.js 573 kB +34 B (+0.01%)

90d9cb6 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric f19c994 trunk % Change
timeToFirstByte 44.05 ms +10.78% -4.43% 44.7 ms +9.73% -4.03% -1.45%
largestContentfulPaint 68 ms +11.76% -5.88% 72 ms +5.56% -8.33% -5.56%
lcpMinusTtfb 23.35 ms +16.49% -5.35% 23.95 ms +30.69% -6.68% -2.51%
wpBeforeTemplate 22.82 ms +14.33% -3.2% 22.82 ms +13.54% -2.72% 0%
wpTemplate 17.42 ms +6.95% -2.87% 17.9 ms +4.36% -4.47% -2.68%
wpTotal 40.56 ms +11.61% -4.09% 41.03 ms +10.7% -3.92% -1.15%
wpMemoryUsage 7.75 MB +0% -0% 7.72 MB +0% -0% 0.45%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric f19c994 trunk % Change
timeToFirstByte 36.25 ms +10.34% -2.21% 38.3 ms +2.87% -1.83% -5.35%
largestContentfulPaint 68 ms +2.94% -5.88% 68 ms +0% -0% 0%
lcpMinusTtfb 29.7 ms +5.39% -3.87% 29.7 ms +2.86% -4.55% 0%
wpBeforeTemplate 19.47 ms +8.73% -1.03% 20.77 ms +7.51% -4.86% -6.26%
wpTemplate 13.83 ms +3.54% -3.04% 13.97 ms +4.01% -3.94% -1%
wpTotal 33.37 ms +9.56% -2.22% 35.25 ms +3.09% -3.32% -5.33%
wpMemoryUsage 6.44 MB +0% -0% 6.41 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric f19c994 trunk % Change
mediaProcessingJpeg 327.27 ms +2.12% -0.68% 332.04 ms +0.54% -0.7% -1.44%
mediaProcessingAvif 4901.16 ms +0.2% -0.25% 4872.37 ms +0.57% -0.21% 0.59%
mediaProcessingJpegToAvif 3412.43 ms +0.33% -0.39% 3395.71 ms +0.16% -0.35% 0.49%

media-upload

Metric f19c994 trunk % Change
jpegUploadProcessing 1480.18 ms +1.32% -0.92% 1482.8 ms +0.82% -1.63% -0.18%
pngUploadProcessing 247.95 ms +2.73% -2.04% 254.04 ms +4.2% -6.96% -2.4%
largeJpegUploadProcessing 1457.33 ms +0.44% -0.86% 1437.18 ms +2.93% -0.38% 1.4%
multipleImageUploadProcessing 1517.26 ms +1.91% -0.62% 1555.92 ms +4.36% -1.06% -2.48%

post-editor

Metric f19c994 trunk % Change
serverResponse 318.99 ms +5.24% -8.47% 321.21 ms +1.54% -11.46% -0.69%
firstPaint 338.09 ms +6.34% -3.84% 339.72 ms +2.72% -6.25% -0.48%
domContentLoaded 649.65 ms +13.61% -2.34% 630.78 ms +1.12% -1.09% 2.99%
loaded 650.44 ms +13.85% -2.33% 631.53 ms +1.13% -1.1% 2.99%
firstContentfulPaint 371.99 ms +15.13% -4.42% 359.58 ms +1.77% -1.52% 3.45%
firstBlock 1772.5 ms +3.12% -2.01% 1712.6 ms +1.08% -1.41% 3.5%
type 15.94 ms +9.66% -10.85% 15.64 ms +3.01% -10.49% 1.92%
typeWithoutInspector 15.62 ms +9.54% -5.89% 15.4 ms +1.95% -11.95% 1.43%
typeWithTopToolbar 20.29 ms +8.18% -1.03% 18.05 ms +3.71% -8.75% 12.41%
typeContainer 7 ms +17.29% -9.29% 7.23 ms +4.7% -10.24% -3.18%
focus 95.16 ms +10.53% -2.4% 85.33 ms +4.16% -4.59% 11.52%
firstFocus 219.84 ms +0% -0% 211.88 ms +0% -0% 3.76%
selectAll 309.08 ms +2.52% -0.27% 299.46 ms +1.87% -4.33% 3.21%
undo 25.63 ms +7.57% -3.55% 25.32 ms +3.2% -6.79% 1.22%
listViewOpen 52.82 ms +3.79% -9.6% 47.59 ms +7.1% -0.34% 10.99%
inserterOpen 34.6 ms +15.29% -5.12% 33.32 ms +5.79% -7.56% 3.84%
inserterHover 10.4 ms +6.15% -8.75% 9.74 ms +9.55% -4.93% 6.78%
inserterSearch 7.04 ms +5.82% -3.55% 7.05 ms +10.92% -6.38% -0.14%
loadPatterns 518.97 ms +2.3% -4.02% 541.03 ms +6.5% -6.29% -4.08%
wpTotal 310.42 ms +5.29% -8.7% 312.65 ms +1.57% -11.77% -0.71%
wpMemoryUsage 14.81 MB +0% -0% 14.78 MB +0% -0% 0.25%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric f19c994 trunk % Change
serverResponse 489.3 ms +0.91% -6.63% 459.92 ms +2.71% -6.21% 6.39%
firstPaint 480.51 ms +6.64% -4.55% 453.58 ms +2.47% -13.55% 5.94%
domContentLoaded 881.31 ms +3.62% -0.65% 828.47 ms +0.49% -0.74% 6.38%
loaded 882.28 ms +3.71% -0.65% 829.33 ms +0.51% -0.72% 6.38%
firstContentfulPaint 503.46 ms +3.01% -3.66% 465.57 ms +1.63% -1.03% 8.14%
firstBlock 2778.24 ms +5.44% -1.3% 2582.14 ms +0.94% -0.8% 7.59%
type 20.39 ms +1.96% -7.21% 16.63 ms +9.44% -9.02% 22.61%
navigate 128.11 ms +2.55% -8.91% 110.21 ms +0.86% -7.1% 16.24%
loadPatterns 1414.42 ms +12.98% -19.15% 1304.12 ms +8.34% -3.9% 8.46%
loadPages 957.75 ms +1.69% -1.74% 965.89 ms +2.72% -0.65% -0.84%
wpTotal 479.67 ms +0.94% -6.85% 449.55 ms +3.01% -6.14% 6.7%
wpMemoryUsage 12.84 MB +0% -0% 12.80 MB +0% -0% 0.28%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

90d9cb6 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.

Navigates the list via UP/DOWN arrow keys from action buttons 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 Two Edit Actions' }).getByRole('button', { name: 'Edit' })
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' }) with timeout 5000ms
  - waiting for getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' })
    14 × locator resolved to <button type="button" tabindex="-1" class="components-button is-small" id="view-list-0-176-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:243:5
does not double up an event React already delivers in /test/e2e/specs/editor/various/editable-root-compat.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

Expected: 1
Received: 0

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/editable-root-compat.spec.js:291:5
should select synced pattern in /test/e2e/specs/editor/various/writing-flow.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/block"]')
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/block"]') with timeout 5000ms
  - waiting for locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/block"]')
    14 × locator resolved to <div tabindex="0" role="document" draggable="true" data-title="Pattern" data-type="core/block" data-is-drop-zone="true" aria-label="Block: Pattern" id="block-8f040da4-134f-41b4-966e-c5ba88d981d1" data-block="8f040da4-134f-41b4-966e-c5ba88d981d1" class="block-editor-block-list__block wp-block is-selected is-reusable block-library-block__reusable-block-container wp-block-block block-editor-block-list__layout">…</div>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/writing-flow.spec.js:1464:5

From 4ff3714, not the current head. Run

Copilot AI 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.

🟡 Changes recommended

Removing the Breadcrumbs export breaks a Storybook module that still imports it and passes the component to Page; its import and breadcrumbs prop must be migrated to the array configuration.

1 open issue
What changed in this PR

This PR makes Page breadcrumbs configuration-based and removes @wordpress/admin-ui’s routing dependency, addressing #77040 and following the existing navigation API pattern.

Changes:

  • Replace the public Breadcrumbs component with a Page.breadcrumbs array and configurable link rendering.
  • Apply headingLevel to breadcrumb headings and derive the page region’s accessible name from the last breadcrumb when appropriate.
  • Migrate route consumers, update tests and stories, and document the breaking API change.
File Description
routes/​site-health/​stage.tsx Migrate breadcrumbs and supply router links.
routes/​navigation-edit/​stage.tsx Adopt breadcrumb configuration and router links.
routes/​media-editor/​stage.tsx Migrate standalone and routed breadcrumb configurations.
routes/​dashboard/​stage.tsx Use a single-item breadcrumb array.
packages/​admin-ui/​tsconfig.json Remove the route project reference.
packages/​admin-ui/​tsconfig.build.json Remove the build-time route reference.
packages/​admin-ui/​src/​stories/​with-router.tsx Delete the router decorator.
packages/​admin-ui/​src/​page/​types.ts Document custom links for breadcrumbs.
packages/​admin-ui/​src/​page/​test/​index.jsdom.test.tsx Cover breadcrumb naming, headings, and custom links.
packages/​admin-ui/​src/​page/​stories/​index.story.tsx Convert stories to breadcrumb arrays.
packages/​admin-ui/​src/​page/​index.tsx Accept breadcrumb configuration and derive region names.
packages/​admin-ui/​src/​page/​header.tsx Render internal breadcrumbs with page settings.
packages/​admin-ui/​src/​index.ts Remove the public Breadcrumbs export.
packages/​admin-ui/​src/​breadcrumbs/​types.ts Define URL-based items and rendering options.
packages/​admin-ui/​src/​breadcrumbs/​test/​index.jsdom.test.tsx Update tests for the internal breadcrumb contract.
packages/​admin-ui/​src/​breadcrumbs/​stories/​index.story.tsx Remove standalone Breadcrumbs stories.
packages/​admin-ui/​src/​breadcrumbs/​index.tsx Support custom links and configurable heading levels.
packages/​admin-ui/​README.md Remove documentation for the retired export.
packages/​admin-ui/​package.json Remove the routing dependency.
packages/​admin-ui/​CHANGELOG.md Document the breaking change and migration.
package-lock.json Synchronize the dependency removal.

Review effort: Balanced

Comment thread packages/admin-ui/src/index.ts Resolved
@jameskoster

Copy link
Copy Markdown
Contributor

Seems unrelated but in my testing the admin bar disappears in the Extensible Site Editor 🤔

@simison

simison commented Nov 18, 2026

Copy link
Copy Markdown
Member

Seems unrelated but in my testing the admin bar disappears in the Extensible Site Editor 🤔

Likely this one? #86992

@simison

simison commented Nov 18, 2026

Copy link
Copy Markdown
Member

FYI I've been testing this with Jetpack which uses breadcrumbs quite heavily so good test bench: Automattic/jetpack@trunk...simison/admin-ui-breadcrumbs-api-d186f2

One finding so far is that they're doing some style overrides in couple places for truncation to work well, which might either indicate bugs in our component or some misuse. Didn't look closer yet. (Related issue #77391)

@aduth

aduth commented Nov 18, 2026

Copy link
Copy Markdown
Member Author

FYI I've been testing this with Jetpack which uses breadcrumbs quite heavily so good test bench: Automattic/jetpack@trunk...simison/admin-ui-breadcrumbs-api-d186f2

Thanks for doing this downstream testing 🙏 Since we don't currently have usage to validate against in Gutenberg itself, a lot of this is speculative in terms of what breadcrumbs behavior we should expect to provide, but the downstream validation is a primary source of understanding whether it's sufficient.

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

Deleting the Storybook router decorator leaves its ESLint suppression behind. Could you run npm run lint:js:prune-suppressions and include the resulting deletion?

Comment thread packages/admin-ui/CHANGELOG.md Resolved
@aduth
aduth force-pushed the update/admin-ui-page-breadcrumbs-items branch from 09296ca to 4ff3714 Compare November 23, 2026 21:17
@aduth

aduth commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

Deleting the Storybook router decorator leaves its ESLint suppression behind. Could you run npm run lint:js:prune-suppressions and include the resulting deletion?

This suppression should be cleaned up in the rebased f3e4ba7.

@github-actions github-actions Bot added the [Package] Boot /packages/boot label Nov 23, 2026

### Breaking Changes

- `Page`: The `breadcrumbs` prop now takes an array of `{ label, href }` items in place of a `Breadcrumbs` element. Links render through `components.link`, like `navigation`, so pass your router's link component there. The page region takes its name from the last item when it has no `ariaLabel` or string `title`. The `Breadcrumbs` component is no longer exported, and the package no longer depends on `@wordpress/route` ([#86982](https://github.com/WordPress/gutenberg/pull/86982)).

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.

Could we show or link to the href-to-to adapter in the migration note? Passing Link from @wordpress/route directly as components.link fails typechecking because it requires to. Example from this PR

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.

Could we show or link to the href-to-to adapter in the migration note? Passing Link from @wordpress/route directly as components.link fails typechecking because it requires to. Example from this PR

Yeah, I share your concern here about the downstream impact potential, and commented similarly in #87050 (comment) and the following comment. I think we should find a way to "soften" the migration impact by having @wordpress/boot continue to handle this wiring as much as possible, for the common use-case. One option we could consider here is to continue depending on @wordpress/route for Breadcrumb while still applying the configuration API update. That's kicking the can down the road a bit, but at least could help make some progress.

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.

to continue depending on @wordpress/route for Breadcrumb while still applying the configuration API update

I would prefer to avoid introducing an "app logic" dependency into a pure UI component. We could at most consider doing it inside admin ui, but I'd prefer to avoid that, too. Routing IMO should not be coupled with UI componentry and, as you also mentioned, it wouldn't really solve the underlying issues

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.

cc @WordPress/gutenberg-components since this seems to be a conversation that warrants some thinking and relates to other wider DS and Gutenberg level considerations

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.

to continue depending on @wordpress/route for Breadcrumb while still applying the configuration API update

I would prefer to avoid introducing an "app logic" dependency into a pure UI component. We could at most consider doing it inside admin ui, but I'd prefer to avoid that, too. Routing IMO should not be coupled with UI componentry and, as you also mentioned, it wouldn't really solve the underlying issues

Just to clarify, I definitely still think we should decouple @wordpress/route from @wordpress/admin-ui. The suggestion in my previous comment was more to split the work: This pull request to just update the prop API, and handle the decoupling separately.

@ciampo ciampo Dec 1, 2026 •

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.

Oh, now I get your point, and I'm fine with splitting it. Until boot can supply a default link, decoupling mostly moves the wiring onto every route. Without components.link, a boot route renders <a href="/navigation/list">, which skips the ?p= URL and lands on the wrong page.

For this PR, could Breadcrumbs use components.link when it's passed and fall back to the router link otherwise? That keeps navigation and breadcrumbs on the same rule, lets us drop the RouterLink copies in routes/, and leaves the follow-up to change only the default. We'd also drop "Closes #77040" and the changelog line about @wordpress/route.

One more thing for the note: the last item is now always the heading and ignores href, so it's worth mentioning too.

return {
breadcrumbs: <Breadcrumbs items={ trail } />,
ariaLabel: trail[ trail.length - 1 ].label,
breadcrumbs: trail,

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.

Could we update the Settings Page guide to match this example? A subpage now takes its region name from the last breadcrumb. The advice to set ariaLabel still applies to adjacent pages that share a title. Guide paragraph

@@ -45,7 +45,6 @@
"@wordpress/element": "file:../element",
"@wordpress/i18n": "file:../i18n",
"@wordpress/private-apis": "file:../private-apis",

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.

The deleted story decorator was the only caller of src/lock-unlock.ts. Could we remove that helper and its ESLint suppression, then drop the direct @wordpress/private-apis dependency from the manifest, lockfile, and TypeScript project references?

@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 replied in the migration note thread about splitting out the decoupling. Two earlier threads still need a look: the Settings Page guide and the unused lock-unlock.ts.

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] Admin UI /packages/admin-ui [Package] Boot /packages/boot [Type] Breaking Change For PRs that introduce a change that will break existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Admin UI: Decouple Page component from @wordpress/route

6 participants