Remove unused export from splitUnifiedDiffByFile and gate checkpoint diff hydration on diffOpen

This commit is contained in:
Cursor Agent committed 2026-02-18 23:53:22 +00:00
1 parent a2e4c7198a
commit a233939fc8
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -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,
]);
+1 -1
View File
@@ -531,7 +531,7 @@ function parsePathFromDiff(diff: string): string | undefined {
return direct[1];
}
export function splitUnifiedDiffByFile(diff: string): Map<string, string> {
function splitUnifiedDiffByFile(diff: string): Map<string, string> {
const normalized = diff.replace(/\r\n/g, "\n");
const byPath = new Map<string, string>();
const headerMatches = [...normalized.matchAll(/^diff --git .+$/gm)];