Skip to content

Set the browser tab title from the page being viewed - #33

Merged
mihir-seg merged 1 commit into
mainfrom
tab-titles
Aug 11, 2026
Merged

mihir-seg merged 1 commit into
mainfrom
tab-titles

Conversation

@mihir-seg

Copy link
Copy Markdown
Contributor

Every route rendered the static "NotDrive" title from index.html, so a window full of tabs was indistinguishable. This adds a useDocumentTitle hook and calls it from each route with the same string the page shows as its h1, producing titles like Sprint 71 · NotDrive.

  • Page name leads so it survives tab truncation; blank or still-loading names fall back to the bare app name.
  • Unmounting resets the title, so a route that doesn't set one can't inherit the previous page's name.
  • On the item page the hook tracks the live title input, so renaming a page updates the tab as you type.
  • ViewContainer covers workspace home, favorites, saved views and tag pages in one place. WorkspacePicker is skipped deliberately — it's a pure redirect with no heading.

Testing

pnpm lint, pnpm typecheck, and the web vitest suite all pass (16 tests, including 4 new ones for formatDocumentTitle).

🤖 Generated with Claude Code

Every route rendered the static "NotDrive" title from index.html, so a
window full of tabs was indistinguishable. Add a useDocumentTitle hook
and call it from each route with the same string the page shows as its
h1, producing titles like "Sprint 71 · NotDrive".

Page name leads so it survives tab truncation; blank or still-loading
names fall back to the bare app name, and unmounting resets the title so
a route that doesn't set one can't inherit the previous page's name. On
the item page the hook tracks the live title input, so renaming a page
updates the tab as you type.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gu5xuW77zX5amWS2xJrqUu
@mihir-seg
mihir-seg added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 1710769 Aug 11, 2026
1 check passed
@mihir-seg
mihir-seg deleted the tab-titles branch August 11, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants