Repository navigation
fix(ui): per-route browser-tab titles — Trinity — <Page> (abilityai/trinity#1418) - #1419
Conversation
Every tab previously showed the identical static <title> from index.html (#1416), so with several tabs open you couldn't tell Dashboard from Settings from a specific agent. Add `meta.title` to each named route and a single `router.afterEach` guard that sets `document.title` to `Trinity — <label>`. - Static routes: Dashboard / Agents / Templates / Operations / Settings / Enterprise / Audit Log / Mobile / Login / Setup / Chat. - Agent-scoped routes carry the agent name (the :name param is the canonical identifier in Trinity): `Trinity — <name>`, `· Workspace`, `· Execution`. - meta.title may be a string or a fn of the resolved route; unlabeled routes (redirects, catch-all) fall back to the branded `Trinity — Agent Orchestration` default. afterEach fires per completed navigation — incl. a redirect's final destination — so SPA nav updates the title with no reload. Frontend-only; no backend/auth/CSP surface. document.title is a plain-text sink (no XSS). Verified: `vite build` compiles; label logic asserted across static/dynamic/sub-page/fallback cases; Playwright @smoke spec added (browser-tab-titles.spec.js) for the frontend-e2e CI workflow. Fixes #1418 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Review — per-route tab titles (automated review, Claude)Clean, well-scoped. One cross-PR note: this edits Otherwise LGTM pending green |
Resolves router/index.js: keep dev's #1418/#1419 per-route title meta, keep this branch's Vue Router 5 return-style guards, and convert the dev-added Brain Orb beforeEnter (#58/#60) from next()-callback to return-style — next() is removed in vue-router 5. Co-Authored-By: Claude Fable 5 <[email protected]>
Summary
<title>, so every tab read identically. This gives each route its own tab title so you can tell pages apart with multiple tabs open.meta.titleto each named route + a singlerouter.afterEachguard that setsdocument.titletoTrinity — <label>.Trinity — <name>,· Workspace,· Execution(the:nameparam is Trinity's canonical agent identifier). Unlabeled routes (redirects, catch-all) fall back to the brandedTrinity — Agent Orchestrationdefault.Changes
src/frontend/src/router/index.js—meta.titleper named route (string or fn of the resolved route) +afterEachtitle guard. All existing meta keys preserved.src/frontend/e2e/browser-tab-titles.spec.js— new@smokePlaywright spec: SPA nav updates the title per route, and a legacy redirect resolves to its destination's title.Scope notes
document.titleis a plain-text sink (no XSS); agent names are validated regardless.dev's router has no Brain Orb route yet (that's unmergedfeature/61work) — its title lands with that branch.Test Plan
vite buildcompiles the router + full app.--list).frontend-e2e(uilabel) runs the@smoketitles spec against the live stack.Trinity — …title.Fixes #1418
🤖 Generated with Claude Code