Skip to content

Fixes #34092: resolve the browser tab title by precedence, not mount order - #34093

Merged
anuj-kumary merged 4 commits into
mainfrom
fix/document-title-precedence
Sep 28, 2026
Merged

anuj-kumary merged 4 commits into
mainfrom
fix/document-title-precedence

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Fixes #34092

What was wrong

react-helmet-async registers 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/:tab are 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:

glossary (full load)         ->  <name> | <brand>
click Relations Graph tab    ->  Glossary | <brand>     <-- generic
click Terms tab              ->  Glossary | <brand>     <-- stays wrong
/explore                     ->  | <brand>              <-- blank

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

DocumentTitle no longer renders a <Helmet>. It claims into a store, and one <Helmet> in DocumentTitleOutlet renders the winner:

rule effect
priority SHELL < PAGE a page always beats a shell's URL-derived fallback, whatever the order
then registration order ties go to the deepest claim — effects run child-before-parent, so a detail panel's entity name beats its page layout's generic one. Fixed across updates, so a re-rendering layout can't jump ahead
visibility KeepAliveRoutes wraps each cached route in RouteVisibilityProvider; a hidden page's claim is excluded outright rather than raced against

The winning claim appends the active tab, read from the route's :tab param via the existing TAB_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 pageTitle now claims nothing instead of writing a bare " | <brand>".

No call sites changed — all 181 pageTitle props 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

glossary (full load)         ->  <name> | <brand>
click Relations Graph tab    ->  <name> | Relations Graph | <brand>
click Terms tab              ->  <name> | Terms | <brand>
table details                ->  <table name> | <brand>
click Activity Feed tab      ->  <table name> | Activity Feeds & Tasks | <brand>
/explore                     ->  Explore | <brand>

Testing

  • DocumentTitle.store.test.ts (9) — precedence, tie-breaking, hidden claims, snapshot stability
  • DocumentTitle.test.tsx (7) — page-beats-shell, nested-beats-layout, tab suffix, hidden kept-alive route, unmount release
  • Verified in a running app by click-navigation, before and after
  • Full OSS jest suite green

`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]>
@anuj-kumary anuj-kumary added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 805 → 805
- 0 added, 0 removed, 1 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/src/generated/entity/data/topic.ts

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 getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

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

@anuj-kumary anuj-kumary self-assigned this Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

✅ SSO Login Nightly — PASSED

View workflow run · Commit e1f7c76

Provider Status Pass Fail Flaky Skip Duration
basic ✅ pass 6 0 0 0 0m 39s
ldap ✅ pass 6 0 0 0 0m 38s
keycloak-oidc-confidential ✅ pass 9 0 0 0 1m 04s
keycloak-oidc-public ✅ pass 8 0 0 0 0m 50s
msal-mock ✅ pass 5 0 0 0 0m 22s
auth0-mock ✅ pass 5 0 0 0 0m 30s
okta ⏩ skipped - - - - -
keycloak-azure-saml ✅ pass 1 0 0 0 0m 19s
keycloak-azure-saml-crosssite ⏩ skipped - - - - -

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

gitar-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown
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. DocumentTitle now claims into a store with priority rules (page beats shell, ties go to deepest claim, hidden routes excluded), and a single <Helmet> in DocumentTitleOutlet renders the winner. Tab names are automatically appended via route params, so tabbed detail routes display <entity> | <tab> | <brand> with no per-page wiring. All 181 existing call sites continue working unchanged. No issues found.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit dcf234464857924d34c0f4b37a5b40e00b79a999 in Playwright run 36382560337, attempt 1.

✅ 4619 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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:

  • Common shard skew was 40.24% (convergence target: at most 15%).
  • Browser traffic was 219.02 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.2 per UI scenario (10767 boots / 4902 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard advanced-search-01 130 0 0 0 0 0
✅ Shard chromium-01 140 0 0 0 0 0
✅ Shard chromium-02 157 0 0 0 0 0
✅ Shard chromium-03 203 0 0 0 0 0
✅ Shard chromium-04 205 0 0 0 0 0
✅ Shard chromium-05 180 0 0 1 0 0
✅ Shard chromium-06 150 0 0 0 0 0
✅ Shard chromium-07 181 0 0 0 0 0
✅ Shard chromium-08 165 0 0 0 0 0
✅ Shard chromium-09 162 0 0 0 0 0
✅ Shard chromium-10 181 0 0 0 0 0
✅ Shard chromium-11 183 0 0 0 0 0
✅ Shard chromium-12 173 0 0 0 0 0
✅ Shard chromium-13 196 0 0 0 0 0
✅ Shard chromium-14 172 0 0 0 0 0
✅ Shard chromium-15 181 0 0 0 0 0
🟡 Shard chromium-16 189 0 1 0 0 0
✅ Shard chromium-17 160 0 0 0 0 0
✅ Shard chromium-18 169 0 0 0 0 0
✅ Shard chromium-19 173 0 0 0 0 0
🟡 Shard chromium-20 186 0 1 0 0 0
✅ Shard chromium-21 182 0 0 0 0 0
✅ Shard chromium-22 156 0 0 0 0 0
✅ Shard chromium-23 205 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 51 0 0 0 0 0
✅ Shard import-export-02 99 0 0 0 0 0
✅ Shard ingestion-01 39 0 0 0 0 0
✅ Shard ingestion-02 54 0 0 0 0 0
✅ Shard reindex-01 41 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 2 flaky test(s) (passed on retry)
  • Features/AccessControlSettings.spec.ts › should remove a policy from a role (shard chromium-16, 1 retry)
  • Features/ContextCenterArticlesFilters.spec.ts › sort options route to the correct data path (shard chromium-20, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport to 2.0 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport to 1.13 is under way. It is built from openmetadata-collate, which holds the credentials needed to open a PR here, and it will comment again with the result — nothing is needed from you unless it reports otherwise.

@gh-bot-collate

Copy link
Copy Markdown

🤖 Backport to 2.0 failed. The conflict could not be resolved, so this change is not on that branch. Resolver run.

@gh-bot-collate

Copy link
Copy Markdown

🤖 Backport to 1.13 failed. The conflict could not be resolved, so this change is not on that branch. Resolver run.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Browser tab title is decided by Helmet mount order, so it is wrong whenever a page does not remount

3 participants