Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): pin turn diff baselines #10150

Closedsarjann(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/10150/headopened View on GitHub

Showing 5 changed files with 117 additions and 26 deletions (loading 3).

x
0 of 5 viewed, 5 left
4 additions and 1 deletionapps/web/src/components/ChatView.tsxModified
View file
@@ -3960,7 +3960,10 @@
if (diffAction !== "open" || newlyCompletedTurnId === null) return;
- useDiffPanelStore.getState().selectTurn(activeThreadRef, newlyCompletedTurnId);
+ const diffSelection = useDiffPanelStore.getState().byThreadKey[activeThreadKey];
+ if (diffSelection?.kind !== "turn" || !diffSelection.baselineTurnId) {
+ useDiffPanelStore.getState().selectTurn(activeThreadRef, newlyCompletedTurnId);
+ }
useRightPanelStore.getState().open(activeThreadRef, "diff");
onDiffPanelOpen?.();
113 additions and 25 deletionsapps/web/src/components/DiffPanel.tsxModified
View file
@@ -30,7 +30,13 @@
import { openDiffFilePrimaryAction } from "../diffFileActions";
import { useCheckpointDiff } from "~/lib/checkpointDiffState";
import { cn } from "~/lib/utils";
-import { selectThreadDiffPanelSelection, useDiffPanelStore } from "../diffPanelStore";
+import {
+ type DiffBaseline,
+ getCheckpointDiffRange,
+ THREAD_START_DIFF_BASELINE,
+ selectThreadDiffPanelSelection,
+ useDiffPanelStore,
+} from "../diffPanelStore";
import { useLocalStorage } from "../hooks/useLocalStorage";
import { useTheme } from "../hooks/useTheme";