Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions apps/web/src/components/ChatView.logic.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
boundAttachmentIds,
buildExpiredTerminalContextToastCopy,
findRecordedWorktreeSetup,
mergeDirectPreviewAnnotation,
planComposerTurn,
Expand Down Expand Up @@ -175,6 +176,22 @@ describe("deriveComposerSendState", () => {
});
});

describe("buildExpiredTerminalContextToastCopy", () => {
it("refers to several expired contexts as them", () => {
expect(buildExpiredTerminalContextToastCopy(2, "empty")).toEqual({
title: "Expired terminal contexts won't be sent",
description: "Remove them or re-add them to include terminal output.",
});
expect(buildExpiredTerminalContextToastCopy(2, "omitted")).toEqual({
title: "Expired terminal contexts omitted from message",
description: "Re-add them if you want that terminal output included.",
});
expect(buildExpiredTerminalContextToastCopy(1, "omitted").description).toBe(
"Re-add it if you want that terminal output included.",
);
});
});

describe("hasServerAcknowledgedLocalDispatch", () => {
it("acknowledges a settled newer background turn", () => {
const localDispatch = createLocalDispatchSnapshot(
Expand Down
5 changes: 3 additions & 2 deletions apps/web/src/components/ChatView.logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -879,15 +879,16 @@ export function buildExpiredTerminalContextToastCopy(
): { title: string; description: string } {
const count = Math.max(1, Math.floor(expiredTerminalContextCount));
const noun = count === 1 ? "Expired terminal context" : "Expired terminal contexts";
const pronoun = count === 1 ? "it" : "them";
if (variant === "empty") {
return {
title: `${noun} won't be sent`,
description: "Remove it or re-add it to include terminal output.",
description: `Remove ${pronoun} or re-add ${pronoun} to include terminal output.`,
};
}
return {
title: `${noun} omitted from message`,
description: "Re-add it if you want that terminal output included.",
description: `Re-add ${pronoun} if you want that terminal output included.`,
};
}

Expand Down
Loading