feat: reflect active project/thread in the window title#3800
Conversation
Mirror the renderer's document.title onto the native window title so external window-title scanners and time trackers can see the active workspace. The title is formatted as "project – thread — app name", falling back to the plain app name when no project/thread context is active. - add formatWorkspaceDocumentTitle() branding helper + unit tests - derive document.title from the active thread/project route in DocumentTitleSync - mirror the page title onto the Electron window via page-title-updated Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5b078c1. Configure here.
ApprovabilityVerdict: Approved This PR adds a UI-only feature to display the active project/thread in the window title. The changes are self-contained, include comprehensive unit tests, and don't affect runtime behavior beyond title formatting. You can customize Macroscope's approvability policy. Learn more. |
Addresses two review findings: - DocumentTitleSync only resolved server threads (environmentId + threadId), so on a draft route the title fell back to the plain app name. Use resolveThreadRouteTarget to also resolve the draft's project, so a new, unsaved chat still surfaces its active project in the window title. - The desktop did-finish-load handler unconditionally reset the native window title to the app name, reverting the workspace title on every (re)load. Re-apply the renderer's current document.title instead, via the shared applyWorkspaceTitle helper. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Mirror the renderer's document.title onto the native window title so external window-title scanners and time trackers can see the active workspace. The title is formatted as "project – thread — app name", falling back to the plain app name when no project/thread context is active.
What Changed
Adds workspace context (active project + thread) to the window/document title:
formatWorkspaceDocumentTitle()helper inbranding.logic.tsthat builds"project – thread — app name", includes whichever of project/thread is present, ignores blank values, and falls back to the plain app name when neither is set. Covered by unit tests.DocumentTitleSync(__root.tsx) now reads the active thread/project from the route (non-strictuseParams, since it renders above the matched route) and feeds them into the helper to setdocument.title.page-title-updatednow mirrors the renderer'sdocument.titleonto the native window title instead of hard-coding the app name, so the OS window title reflects the active workspace.Why
External tooling that reads the OS window title — time trackers, window-title scanners — currently only ever sees the static app name, so it can't tell which project or thread is active. Surfacing the active workspace in the title lets that tooling attribute time/activity to the right project and thread without any new API. The renderer already knows the project/thread from the route, so the title is derived there and simply mirrored onto the native window; the pure formatting logic is isolated in
branding.logic.tsso it's unit-testable and the fallback behavior is explicit.UI Changes
No in-app UI changes. The only visible effect is the window/tab title text, e.g.:
T3 Codeacme-web – Fix login redirect — T3 CodeT3 Code(unchanged fallback)Checklist
Note
Low Risk
Title-only UX changes with no auth, data, or API surface impact; desktop title sync is a small behavioral change in window chrome.
Overview
Window and tab titles now include the active workspace so external tools (time trackers, window scanners) can see project/thread context instead of only the static app name.
Adds
formatWorkspaceDocumentTitle()to build titles likeproject – thread — app name, with partial context and blank-value handling; unit tests cover the formatting rules.DocumentTitleSyncresolves the current thread or composer draft from route params and entity state, then setsdocument.titlevia that helper (draft routes still show the project name).On desktop, Electron no longer forces
environment.displayNameonpage-title-updatedanddid-finish-load; it mirrors the renderer title with the same app-name fallback when empty.Reviewed by Cursor Bugbot for commit 156b6e7. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Reflect active project and thread in the desktop window title
formatWorkspaceDocumentTitleinbranding.logic.tsto build a title likeproject – thread — appfrom available context, falling back to the app name alone.DocumentTitleSyncin__root.tsxto resolve the active project and thread and setdocument.titleaccordingly.DesktopWindow.tsto mirrordocument.titleonto the native window title via thepage-title-updatedevent, falling back to the app display name when no title is set.Macroscope summarized 156b6e7.