Skip to content

Commit cd7791d

Browse files
MarcoDotIOclaudemaria-rcks
authored
fix(web): expired terminal context toasts say "them" for several contexts (#24251)
Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: maria-rcks <[email protected]>
1 parent ecbb208 commit cd7791d

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
boundAttachmentIds,
3+
buildExpiredTerminalContextToastCopy,
34
mergeDirectPreviewAnnotation,
45
planComposerTurn,
56
snapshotComposerSend,
@@ -127,6 +128,22 @@ describe("deriveComposerSendState", () => {
127128
});
128129
});
129130

131+
describe("buildExpiredTerminalContextToastCopy", () => {
132+
it("refers to several expired contexts as them", () => {
133+
expect(buildExpiredTerminalContextToastCopy(2, "empty")).toEqual({
134+
title: "Expired terminal contexts won't be sent",
135+
description: "Remove them or re-add them to include terminal output.",
136+
});
137+
expect(buildExpiredTerminalContextToastCopy(2, "omitted")).toEqual({
138+
title: "Expired terminal contexts omitted from message",
139+
description: "Re-add them if you want that terminal output included.",
140+
});
141+
expect(buildExpiredTerminalContextToastCopy(1, "omitted").description).toBe(
142+
"Re-add it if you want that terminal output included.",
143+
);
144+
});
145+
});
146+
130147
describe("hasServerAcknowledgedLocalDispatch", () => {
131148
it("acknowledges a settled newer background turn", () => {
132149
const localDispatch = createLocalDispatchSnapshot(

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,15 +782,16 @@ export function buildExpiredTerminalContextToastCopy(
782782
): { title: string; description: string } {
783783
const count = Math.max(1, Math.floor(expiredTerminalContextCount));
784784
const noun = count === 1 ? "Expired terminal context" : "Expired terminal contexts";
785+
const pronoun = count === 1 ? "it" : "them";
785786
if (variant === "empty") {
786787
return {
787788
title: `${noun} won't be sent`,
788-
description: "Remove it or re-add it to include terminal output.",
789+
description: `Remove ${pronoun} or re-add ${pronoun} to include terminal output.`,
789790
};
790791
}
791792
return {
792793
title: `${noun} omitted from message`,
793-
description: "Re-add it if you want that terminal output included.",
794+
description: `Re-add ${pronoun} if you want that terminal output included.`,
794795
};
795796
}
796797

0 commit comments

Comments
 (0)