diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 232c07d976..01835dcd69 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -487,7 +487,7 @@ export default function ChatView() { }, [activeThreadId, dispatch, inferredCheckpointTurnCountByTurnId, turnDiffSummaries]); const checkpointDiffHydrationTargets = useMemo(() => { - if (!api || !activeThreadId || !activeSessionId || turnDiffSummaries.length === 0) { + if (!api || !activeThreadId || !activeSessionId || turnDiffSummaries.length === 0 || !state.diffOpen) { return []; } return turnDiffSummaries.flatMap((summary) => { @@ -508,6 +508,7 @@ export default function ChatView() { activeThreadId, api, inferredCheckpointTurnCountByTurnId, + state.diffOpen, turnDiffSummaries, ]); diff --git a/apps/web/src/session-logic.ts b/apps/web/src/session-logic.ts index 224d5f1291..a0792f0d8e 100644 --- a/apps/web/src/session-logic.ts +++ b/apps/web/src/session-logic.ts @@ -531,7 +531,7 @@ function parsePathFromDiff(diff: string): string | undefined { return direct[1]; } -export function splitUnifiedDiffByFile(diff: string): Map { +function splitUnifiedDiffByFile(diff: string): Map { const normalized = diff.replace(/\r\n/g, "\n"); const byPath = new Map(); const headerMatches = [...normalized.matchAll(/^diff --git .+$/gm)];