Skip to content

fix(ui): per-route browser-tab titles — Trinity — <Page> (abilityai/trinity#1418) - #1419

Merged
dolho merged 1 commit into
devfrom
feature/1418-per-route-titles
Jul 3, 2026
Merged

dolho merged 1 commit into
devfrom
feature/1418-per-route-titles

Conversation

@vybe

@vybe vybe commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes

  • src/frontend/src/router/index.js — meta.title per named route (string or fn of the resolved route) + afterEach title guard. All existing meta keys preserved.
  • src/frontend/e2e/browser-tab-titles.spec.js — new @smoke Playwright spec: SPA nav updates the title per route, and a legacy redirect resolves to its destination's title.

Scope notes

  • Frontend-only — no backend / auth / CSP surface. document.title is a plain-text sink (no XSS); agent names are validated regardless.
  • dev's router has no Brain Orb route yet (that's unmerged feature/61 work) — its title lands with that branch.

Test Plan

  • vite build compiles the router + full app.
  • Title-resolution logic asserted across 8 cases (static / dynamic agent / sub-pages / public / fallback) — all pass.
  • Playwright spec discovered + parses (--list).
  • CI frontend-e2e (ui label) runs the @smoke titles spec against the live stack.
  • Manual: open several tabs (Dashboard, an agent, Settings) → each shows a distinct Trinity — … title.

Fixes #1418

🤖 Generated with Claude Code

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]>
@vybe vybe added the ui PR touches the frontend UI — triggers Playwright e2e tests label Jul 2, 2026
@dolho

dolho commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review — per-route tab titles (automated review, Claude)

Clean, well-scoped. afterEach firing once on the final destination (so redirects resolve to the destination title) is the right hook, dynamic meta.title as a fn of to.params.name is neat, and the branded fallback covers unlabeled routes. document.title is a plain-text sink so the agent-name interpolation carries no XSS. The @smoke spec asserts the thing that matters (client-side nav repaints the title with no reload) plus the redirect case.

One cross-PR note: this edits src/frontend/src/router/index.js, as does #1133 (vue-router 4→5). Your AgentWorkspace beforeEnter still uses the next() callback signature, which is removed in Vue Router 5 — so if #1133 merges first, this file will conflict and the next() guard will need converting to return-style. Suggest sequencing after #1133 and rebasing onto the v5 guard form (or coordinating the merge order).

Otherwise LGTM pending green frontend-e2e.

@dolho
dolho merged commit 62a8a7e into dev Jul 3, 2026
18 of 19 checks passed
vybe pushed a commit that referenced this pull request Jul 3, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants