Skip to content

Commit 21a69b8

Browse files
shivamhwpclaude
andcommitted
feat(web): optional thread status in the window title
Screen readers read the window title when you switch to T3 Code. It names the open thread but not whether the agent is working or waiting on you. A new Chat setting, off by default, adds Working, Needs approval or Needs your input after the thread's name, in the words the in-app announcer already uses. Refs #33339 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 3288254 commit 21a69b8

9 files changed

Lines changed: 101 additions & 3 deletions

File tree

‎apps/web/src/appInit.tsx‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { startElectronBrowserHost } from "./browser/ElectronBrowserHost";
1414
import { startBrowserProfileReporting } from "./browser/BrowserProfileReporter";
1515
import { startPreviewTitleRecording } from "./browserHistoryStore";
1616
import { retainThreadOverlaysForThread } from "./components/chat/threadOverlayRetention";
17+
import { resolveWindowTitleThreadStatus } from "./components/Sidebar.logic";
1718
import { startBackgroundThreadAnnouncements } from "./components/BackgroundThreadAnnouncer";
1819
import { startSshPasswordPromptQueue } from "./components/desktop/SshPasswordPromptDialog";
1920
import { startHostFreezeToasts } from "./components/HostFreezeToastCoordinator";
@@ -133,7 +134,10 @@ function readOpenThreadRef(router: AppRouter): ScopedThreadRef | null {
133134
return resolveActiveThreadRouteRef(target, draft);
134135
}
135136

136-
/** Names the open thread and its project in the window title, or the app when none is open. */
137+
/**
138+
* Names the open thread and its project in the window title, or the app when none is open.
139+
* Screen readers read it on Alt+Tab, so it can also say what the thread is doing.
140+
*/
137141
function startDocumentTitle(router: AppRouter): void {
138142
const readOnGuestPage = () => router.state.matches.some((match) => match.routeId === "/guest");
139143
let openThreadRef = readOpenThreadRef(router);
@@ -163,6 +167,10 @@ function startDocumentTitle(router: AppRouter): void {
163167
}),
164168
projectTitle: project?.title ?? null,
165169
threadTitle: thread?.title ?? null,
170+
threadStatus:
171+
thread !== null && getClientSettings().windowTitleThreadStatus
172+
? resolveWindowTitleThreadStatus(thread)
173+
: null,
166174
desktop: isElectron,
167175
});
168176
// Projects change whenever any project does; most changes leave the title alone.
@@ -198,6 +206,7 @@ function startDocumentTitle(router: AppRouter): void {
198206
watchOpenThread();
199207
appAtomRegistry.subscribe(primaryServerConfigAtom, write, { immediate: true });
200208
appAtomRegistry.subscribe(environmentProjects.projectsAtom, write);
209+
subscribeClientSettings(write);
201210
router.subscribe("onResolved", updateOpenThread);
202211
useComposerDraftStore.subscribe(updateOpenThread);
203212
}

‎apps/web/src/branding.logic.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export function resolveWindowTitle(input: {
6060
readonly appDisplayName: string;
6161
readonly projectTitle: string | null;
6262
readonly threadTitle: string | null;
63+
readonly threadStatus?: string | null;
6364
readonly desktop: boolean;
6465
}): string {
6566
const threadTitle = input.threadTitle?.trim() ?? "";
@@ -68,6 +69,7 @@ export function resolveWindowTitle(input: {
6869
}
6970

7071
const projectTitle = input.projectTitle?.trim() ?? "";
71-
const context = projectTitle === "" ? threadTitle : `${projectTitle} / ${threadTitle}`;
72+
const thread = input.threadStatus ? `${threadTitle}, ${input.threadStatus}` : threadTitle;
73+
const context = projectTitle === "" ? thread : `${projectTitle} / ${thread}`;
7274
return input.desktop ? context : `${context} - ${input.appDisplayName}`;
7375
}

‎apps/web/src/components/Sidebar.logic.test.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
resolveSidebarSweepKeys,
1717
resolveSidebarThreadStatus,
1818
resolveThreadStatusPill,
19+
resolveWindowTitleThreadStatus,
1920
resolveWorkingStartedAt,
2021
searchSidebarThreads,
2122
shouldRecedeSidebarThread,
@@ -310,6 +311,23 @@ describe("resolveSidebarThreadStatus", () => {
310311
}),
311312
).toBe("waiting");
312313
});
314+
315+
it("titles the window with live work and requests only", () => {
316+
const cases = [
317+
[{ ...idle, hasPendingApprovals: true, runtime }, "Needs approval"],
318+
[{ ...idle, hasPendingUserInput: true }, "Needs your input"],
319+
[{ ...idle, runtime: { ...runtime, status: "preparing" as const } }, "Working"],
320+
[{ ...idle, runtime }, "Working"],
321+
[{ ...idle, runtime, pendingGuestMessageCount: 1 }, "Working"],
322+
[{ ...idle, runtime, blockedOnThreadWait: true }, null],
323+
[{ ...idle, runtime: { ...runtime, status: "failed" as const } }, null],
324+
[{ ...idle, runtime: { ...runtime, status: "completed" as const } }, null],
325+
[idle, null],
326+
] as const;
327+
for (const [thread, title] of cases) {
328+
expect(resolveWindowTitleThreadStatus(thread)).toBe(title);
329+
}
330+
});
313331
});
314332

315333
describe("searchSidebarThreads", () => {

‎apps/web/src/components/Sidebar.logic.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
import type { SidebarThreadSummary, Thread } from "../types";
4141
import { normalizeSearchText } from "../lib/utils";
4242
import { isLatestRunSettled } from "../session-logic";
43+
import { THREAD_STATUS_TEXT } from "@t3tools/client-runtime/state/thread-activity-announcement";
4344
import { observeIntersection } from "../lib/observeIntersection";
4445
import { deadlineAfter, deadlineStore, type ClockStore } from "@t3tools/client-runtime/clock";
4546
import { useDeadlinePassed } from "../hooks/useDeadline";
@@ -983,6 +984,22 @@ export function resolveSidebarThreadStatus(thread: SidebarThreadStatusInput): Si
983984
return "ready";
984985
}
985986

987+
/** What the window title says the open thread is doing, in the words its announcer uses. */
988+
export function resolveWindowTitleThreadStatus(thread: SidebarThreadStatusInput): string | null {
989+
// A guest waiting doesn't hide that the agent is still working.
990+
switch (resolveSidebarThreadStatus({ ...thread, pendingGuestMessageCount: 0 })) {
991+
case "approval":
992+
return THREAD_STATUS_TEXT.approval;
993+
case "input":
994+
return THREAD_STATUS_TEXT.input;
995+
case "preparing":
996+
case "working":
997+
return THREAD_STATUS_TEXT.working;
998+
default:
999+
return null;
1000+
}
1001+
}
1002+
9861003
/**
9871004
* The dot on a closed boring-sidebar folder: the most urgent state among its
9881005
* hidden threads. Waiting threads stay quiet, like their rows.

‎apps/web/src/components/settings/SettingsPanels.tsx‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,9 @@ export function useSettingsRestore(onRestored?: () => void) {
548548
...(settings.screenReaderAnnouncements !== DEFAULT_UNIFIED_SETTINGS.screenReaderAnnouncements
549549
? ["Screen reader announcements"]
550550
: []),
551+
...(settings.windowTitleThreadStatus !== DEFAULT_UNIFIED_SETTINGS.windowTitleThreadStatus
552+
? ["Thread status in window title"]
553+
: []),
551554
...(settings.responseStreamingMode !== DEFAULT_UNIFIED_SETTINGS.responseStreamingMode
552555
? ["Response streaming"]
553556
: []),
@@ -665,6 +668,7 @@ export function useSettingsRestore(onRestored?: () => void) {
665668
followUpBehavior: DEFAULT_UNIFIED_SETTINGS.followUpBehavior,
666669
toolCallVisibility: DEFAULT_UNIFIED_SETTINGS.toolCallVisibility,
667670
screenReaderAnnouncements: DEFAULT_UNIFIED_SETTINGS.screenReaderAnnouncements,
671+
windowTitleThreadStatus: DEFAULT_UNIFIED_SETTINGS.windowTitleThreadStatus,
668672
environmentIdentificationMode: DEFAULT_UNIFIED_SETTINGS.environmentIdentificationMode,
669673
glassOpacity: DEFAULT_UNIFIED_SETTINGS.glassOpacity,
670674
panelAnimationDurationMs: DEFAULT_UNIFIED_SETTINGS.panelAnimationDurationMs,
@@ -1297,6 +1301,7 @@ export function ChatSettingsPanel() {
12971301
<SettingsSection id="activity" title="Activity">
12981302
<ToolCallVisibilityRow />
12991303
<ScreenReaderAnnouncementsRow />
1304+
<WindowTitleThreadStatusRow />
13001305
</SettingsSection>
13011306
</SettingsPageContainer>
13021307
);
@@ -1410,6 +1415,36 @@ function ScreenReaderAnnouncementsRow() {
14101415
);
14111416
}
14121417

1418+
function WindowTitleThreadStatusRow() {
1419+
const settings = useScopedSettings();
1420+
const updateSettings = useUpdateScopedSettings();
1421+
return (
1422+
<SettingsRow
1423+
{...searchableSetting("window-title-thread-status")}
1424+
description="Add Working, Needs approval, or Needs your input after the thread's name in the window title, which screen readers read when you switch apps. Taskbars, shared screens, and time trackers see it too."
1425+
resetAction={
1426+
settings.windowTitleThreadStatus !== DEFAULT_UNIFIED_SETTINGS.windowTitleThreadStatus ? (
1427+
<SettingResetButton
1428+
label="thread status in window title"
1429+
onClick={() =>
1430+
updateSettings({
1431+
windowTitleThreadStatus: DEFAULT_UNIFIED_SETTINGS.windowTitleThreadStatus,
1432+
})
1433+
}
1434+
/>
1435+
) : null
1436+
}
1437+
control={
1438+
<Switch
1439+
checked={settings.windowTitleThreadStatus}
1440+
onCheckedChange={(checked) => updateSettings({ windowTitleThreadStatus: checked })}
1441+
aria-label="Thread status in window title"
1442+
/>
1443+
}
1444+
/>
1445+
);
1446+
}
1447+
14131448
function DiffColorsSettingsRow() {
14141449
const settings = useScopedSettings();
14151450
const updateSettings = useUpdateScopedSettings();

‎apps/web/src/components/settings/settingsSearch.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,14 @@ export const SETTINGS_SEARCH_ITEMS = [
492492
"accessibility a11y screen reader nvda jaws voiceover orca narrator speech announce read aloud messages activity steps",
493493
],
494494
},
495+
{
496+
id: "window-title-thread-status",
497+
title: "Thread status in window title",
498+
to: "/settings/chat",
499+
searchTerms: [
500+
"accessibility a11y screen reader nvda jaws voiceover orca narrator window title tab title alt tab taskbar working approval",
501+
],
502+
},
495503
{
496504
id: "guest-links",
497505
title: "Guest links",

‎docs/user/activity-log.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@ short. The reply that closes the turn is not read, so you can read it yourself w
4141
are spaced out, so a quick step can be skipped for a newer one.
4242
The agent's reasoning text is never read. The setting follows the agent's real activity, whatever
4343
**Tool calls in chat** hides, and applies to this browser or device only.
44+
45+
To hear what the open thread is doing when you switch to T3 Code, turn on **Thread status in
46+
window title** in the same section. The window title then adds **Working**, **Needs approval**, or
47+
**Needs your input** after the thread's name, and goes back to just the name when the turn ends.
48+
Anyone who can see your taskbar, window switcher, or shared screen sees it too, and time trackers
49+
that group by window title count each status separately.

‎packages/client-runtime/src/state/threadActivityAnnouncement.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export type ThreadActivityStatus = "working" | "approval" | "input" | "idle";
55

66
/** Background threads say these too, so a status sounds the same wherever it's heard. */
77
export const THREAD_STATUS_TEXT = {
8+
working: "Working",
89
approval: "Needs approval",
910
input: "Needs your input",
1011
done: "Done",
@@ -144,7 +145,7 @@ export function nextThreadAnnouncement(
144145
? null
145146
: THREAD_STATUS_TEXT.input
146147
: turnStarted
147-
? "Working"
148+
? THREAD_STATUS_TEXT.working
148149
: null;
149150
return { memory: { ...memory, turnRunId: nextTurnRunId }, announcement };
150151
}

‎packages/contracts/src/settings.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ export const ClientSettingsSchema = Schema.Struct({
524524
screenReaderAnnouncements: ScreenReaderAnnouncements.pipe(
525525
Schema.withDecodingDefault(Effect.succeed("status" as const)),
526526
),
527+
windowTitleThreadStatus: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
527528
// Retired Labs toggle. Still read as the default for the Usage item in threadDetailsItems.
528529
threadDetailsUsageEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
529530
// Sparse show/hide overrides for thread details card items. Missing ids use the client's
@@ -2039,6 +2040,7 @@ export const ClientSettingsPatch = Schema.Struct({
20392040
boringSidebarMultilineRows: Schema.optionalKey(Schema.Boolean),
20402041
toolCallVisibility: Schema.optionalKey(ToolCallVisibility),
20412042
screenReaderAnnouncements: Schema.optionalKey(ScreenReaderAnnouncements),
2043+
windowTitleThreadStatus: Schema.optionalKey(Schema.Boolean),
20422044
threadDetailsUsageEnabled: Schema.optionalKey(Schema.Boolean),
20432045
threadDetailsItems: Schema.optionalKey(Schema.Record(Schema.String, Schema.Boolean)),
20442046
sidebarWorkingShelfEnabled: Schema.optionalKey(Schema.Boolean),

0 commit comments

Comments
 (0)