lxbme opened a new pull request, #3441: URL: https://github.com/apache/apisix-dashboard/pull/3441
**Why submit this pull request?** - [x] Bugfix **What changes will this PR take into?** Part of #3417 (UX/IA section): "one static `document.title` for every page (router `HeadContent` is already mounted — one `head` option per route away)." Every page shipped the same static `<title>` (Apache APISIX Dashboard), so tabs, history and bookmarks were indistinguishable. Titles are now derived centrally by a `useDocumentTitle` hook from the current path and the nav route table (the single source of truth already used by the sidebar): section name, plus an Add/Detail qualifier, plus the app name — e.g. `Routes - Apache APISIX Dashboard`, `Add Route - …`, `Route Detail - …`. **Why central derivation rather than a `head` option on each of the 35 route files:** no per-route boilerplate, and it stays reactive to both navigation and language change — the title re-localizes on a language switch, which per-route `head` evaluation would not. Longest-prefix matching so `/consumer_groups` is not mis-resolved as `/consumers`. `Root` is split into `Root` (provides the i18n context) and `RootShell` (runs the hook inside it). **Tests.** e2e `router.document-title.spec.ts` asserts distinct section titles, the longest-prefix disambiguation, and the Add qualifier. Blast radius: full local e2e suite — 178 passed; the only failure is `stream_routes.show-disabled-error`, a documented environment item that cannot run outside the repo's own compose project. Unit tests, lint and build clean. **Related issues** Part of #3417 (please do not auto-close the tracking issue) **Checklist:** - [x] Did you explain what problem does this PR solve? - [x] Have you added corresponding test cases? - [ ] Have you modified the corresponding document? (no user-facing document covers page titles) - [x] Is this PR backward compatible? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
