Repository navigation
Fixes #34092: resolve the browser tab title by precedence, not mount order - #34093
Conversation
`react-helmet-async` registers each `<Helmet>` during render and scans its
instance list backwards, so the last-registered instance wins. Nothing in
the app controls that order, and two things break it:
- A kept-alive route never unmounts, so its Helmet stays registered — and
ahead of everything registered before it — long after the user has left
the page.
- Working around that by remounting a shell title on every navigation
inverts the rule whenever a page does NOT remount. `/glossary/:fqn` ->
`/glossary/:fqn/:tab` are sibling routes rendering the same component at
the same position, so React updates the page in place and its Helmet
keeps its old index. The shell title then outranks the entity name: a
glossary read "Glossary" on its Relations Graph tab and stayed wrong on
the way back to Terms.
`DocumentTitle` no longer renders a Helmet. It claims into a store, and
one `<Helmet>` in `DocumentTitleOutlet` renders the winner, chosen by:
priority SHELL < PAGE — a page always beats a URL-derived fallback
then registration seq — ties go to the deepest claim, since effects
run child-before-parent, so a detail panel's
entity name beats its page layout's generic
one; a claim keeps its seq across updates
A claim also carries whether its route is visible. `KeepAliveRoutes` now
wraps each cached route in `RouteVisibilityProvider`, so a hidden page's
claim is ignored outright rather than raced against.
The winning claim appends the active tab, read from the route's `:tab`
param, giving "<entity> | <tab> | <brand>" on every tabbed detail route
with no per-page wiring. A path segment that is not in `TAB_LABEL_MAP` is
ignored, so untabbed routes are unaffected.
An empty `pageTitle` now claims nothing instead of writing a bare
" | <brand>".
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
|
✅ SSO Login Nightly — PASSED View workflow run · Commit
Totals: 40 passed · 0 failed · 0 flaky · 0 skipped · duration 4m 25s |
…URL tab lookup - An empty title no longer drops its claim, so a title that loads later keeps its registration slot instead of outranking nested claims. - Resolve the tab label only for TAB_LABEL_MAP's own keys, so a URL segment like `constructor` can't resolve to an inherited Object property. - Add a regression test for sibling tab-route navigation that updates the page in place while the shell title remounts.
Code Review ✅ Approved🟡 Medium risk · Centralized title precedence and route-tab labeling change browser-visible UI behavior. Fixes browser tab title resolution to use precedence and registration order instead of mount order. OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
✅ Playwright Results — workflow succeededValidated commit ✅ 4619 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 56m 48s ⏱️ Max setup 4m 23s · max shard execution 23m 35s · max shard-job elapsed before upload 27m 10s · reporting 12s 🌐 219.02 requests/attempt · 2.20 app boots/UI scenario · 40.24% common-shard skew Optimization targets still in progress:
🟡 2 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |



Fixes #34092
What was wrong
react-helmet-asyncregisters each<Helmet>during render and resolves the title by scanning its instance list backwards — last registered wins. Nothing controls that order, so the tab title went to whichever Helmet mounted last rather than the most specific one.That works while every navigation unmounts one page and mounts the next. It breaks once a shell keeps routes mounted: a kept-alive route's Helmet stays registered forever, and remounting a shell title to get ahead of it inverts the rule whenever a page does not remount.
/glossary/:fqn→/glossary/:fqn/:tabare sibling routes rendering the same component at the same position, so React updates the page in place, its Helmet keeps its old index, and the shell's generic title wins.Reproduced on a build without this change, in an app-mode shell, clicking rather than reloading:
A full page reload masks all of this — everything remounts and the ordering comes out right by luck — which is why it survived so long.
What this changes
DocumentTitleno longer renders a<Helmet>. It claims into a store, and one<Helmet>inDocumentTitleOutletrenders the winner:SHELL<PAGEKeepAliveRouteswraps each cached route inRouteVisibilityProvider; a hidden page's claim is excluded outright rather than raced againstThe winning claim appends the active tab, read from the route's
:tabparam via the existingTAB_LABEL_MAP, so every tabbed detail route gets<entity> | <tab> | <brand>with no per-page wiring. A segment that isn't a known tab is ignored, so untabbed routes are unaffected.An empty
pageTitlenow claims nothing instead of writing a bare" | <brand>".No call sites changed — all 181
pageTitleprops keep working.Screen.Recording.2026-09-28.at.10.30.31.AM.mov
Screen.Recording.2026-09-28.at.10.48.33.AM.mov
Result
Testing
DocumentTitle.store.test.ts(9) — precedence, tie-breaking, hidden claims, snapshot stabilityDocumentTitle.test.tsx(7) — page-beats-shell, nested-beats-layout, tab suffix, hidden kept-alive route, unmount release