Skip to content

Commit 99640c8

Browse files
fix(web): screen readers at Everything hear context compaction start
turnDetail cleared the announced step for every context-compaction entry, so a running compaction was never spoken. Name it by its label while it is in progress; a finished compaction still names no step. Fixes #35724 Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 7ea2561 commit 99640c8

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎apps/web/src/components/chat/turnDetailAnnouncement.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,20 @@ describe("turnDetail", () => {
129129
],
130130
activity: "Compacting context",
131131
},
132+
{
133+
name: "nothing once the context is compacted",
134+
entries: [
135+
prompt,
136+
command("git"),
137+
work("compact", {
138+
tone: "info",
139+
sourceActivityKind: "context-compaction",
140+
label: "Context compacted",
141+
toolLifecycleStatus: "completed",
142+
}),
143+
],
144+
activity: null,
145+
},
132146
{
133147
name: "nothing from the turn before",
134148
entries: [message("earlier", "user"), command("git"), prompt],

‎apps/web/src/components/chat/turnDetailAnnouncement.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export function turnDetail(
106106
if (entry.kind === "work") {
107107
const work = entry.entry;
108108
if (work.sourceActivityKind === "context-compaction") {
109-
activity ??= null;
109+
activity ??= work.toolLifecycleStatus === "inProgress" ? work.label : null;
110110
continue;
111111
}
112112
// Notices, todo lists and checkpoints sit beside the turn's steps without being one.

0 commit comments

Comments
 (0)