Repository navigation
feat(clients): show project and thread in the window title #7826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -453,7 +453,17 @@ | |
| object-fit: contain; | ||
| } | ||
| </style> | ||
| <title>T3 Code (Alpha)</title> | ||
| <title>T3 Code</title> | ||
|
cursor[bot] marked this conversation as resolved.
Resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the production web client is built without AGENTS.md reference: AGENTS.md:L149-L149 Useful? React with 👍 / 👎. |
||
| <script> | ||
| (() => { | ||
| // The desktop preload injects branding before page scripts run, so the | ||
| // native window title carries the stage label from first paint. | ||
| const branding = window.desktopBridge?.getAppBranding?.(); | ||
| if (branding?.displayName) { | ||
| document.title = branding.displayName; | ||
| } | ||
| })(); | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <div id="root"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,3 +36,19 @@ export function resolveServerBackedAppDisplayName(input: { | |
| ? input.fallbackDisplayName | ||
| : formatAppDisplayName({ baseName: input.baseName, stageLabel }); | ||
| } | ||
|
|
||
| export function resolveWindowTitle(input: { | ||
| readonly appDisplayName: string; | ||
| readonly projectTitle: string | null; | ||
| readonly threadTitle: string | null; | ||
| readonly desktop: boolean; | ||
|
Comment on lines
+39
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This introduces user-visible behavior across browser tabs and desktop windows—including different title formats per client and live updates when project or thread titles change—but the commit does not update any page under AGENTS.md reference: AGENTS.md:L75-L75 Useful? React with 👍 / 👎. |
||
| }): string { | ||
| const threadTitle = input.threadTitle?.trim() ?? ""; | ||
| if (threadTitle === "") { | ||
| return input.appDisplayName; | ||
| } | ||
|
|
||
| const projectTitle = input.projectTitle?.trim() ?? ""; | ||
| const context = projectTitle === "" ? threadTitle : `${projectTitle} / ${threadTitle}`; | ||
| return input.desktop ? context : `${context} — ${input.appDisplayName}`; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { create } from "zustand"; | ||
|
|
||
| export interface WindowTitleContext { | ||
| projectTitle: string | null; | ||
| threadTitle: string | null; | ||
| } | ||
|
|
||
| /** Active project/thread context mirrored into document.title by the root layout. */ | ||
| export const useWindowTitleContextStore = create<WindowTitleContext>()(() => ({ | ||
| projectTitle: null, | ||
| threadTitle: null, | ||
| })); | ||
|
|
||
| export function setWindowTitleContext(context: WindowTitleContext): void { | ||
| const current = useWindowTitleContextStore.getState(); | ||
| if ( | ||
| current.projectTitle === context.projectTitle && | ||
| current.threadTitle === context.threadTitle | ||
| ) { | ||
| return; | ||
| } | ||
| useWindowTitleContextStore.setState(context); | ||
| } | ||
|
|
||
| export function clearWindowTitleContext(): void { | ||
| setWindowTitleContext({ projectTitle: null, threadTitle: null }); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.