Remove unused export from splitUnifiedDiffByFile and gate checkpoint diff hydration on diffOpen
This commit is contained in:
1 parent
a2e4c7198a
commit
a233939fc8
2 files changed
+3
-2
No files matched your search
@@ -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,
|
||||
]);
|
||||
|
||||
|
||||
@@ -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)];
|
||||
|
||||
Reference in new issue
Block a user