Skip to content

Commit 11982e3

Browse files
committed
fix(web): dismiss rewind choices when changing threads
1 parent 7036e55 commit 11982e3

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6539,6 +6539,10 @@ export default function ChatView(props: ChatViewProps) {
65396539
routeThreadKey: string;
65406540
} | null>(null);
65416541

6542+
if (pendingRevert && pendingRevert.routeThreadKey !== routeThreadKey) {
6543+
setPendingRevert(null);
6544+
}
6545+
65426546
const onRevertToTurnCount = useCallback(
65436547
async (turnCount: number, messageId: MessageId, restoreFiles?: boolean) => {
65446548
const localApi = readLocalApi();

‎packages/client-runtime/src/operations/commands.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe("environment commands", () => {
111111
commandId: CommandId.make("rewind-command"),
112112
threadId: ThreadId.make("thread-1"),
113113
turnCount: 0,
114-
restoreFiles,
114+
...(restoreFiles !== undefined ? { restoreFiles } : {}),
115115
createdAt: "2026-06-06T00:01:00.000Z",
116116
}).pipe(Effect.provideService(EnvironmentSupervisor.EnvironmentSupervisor, supervisor));
117117
}

0 commit comments

Comments
 (0)