diff --git a/apps/web/package.json b/apps/web/package.json index 517a6bba0b52274109d9610ab80ad1272f60af69..f777c322208965df8f78a8144e91c75b297c44a4 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@base-ui/react": "^1.2.0", - "@pierre/diffs": "^1.0.11", + "@pierre/diffs": "^1.1.0-beta.16", "@t3tools/contracts": "workspace:*", "@tanstack/react-pacer": "^0.19.4", "@tanstack/react-query": "^5.90.0", diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index 598b6a9604dca6171598a6268de518f940940477..3afec7e3a2989b8ae0437241d735ae3d99dc1c1c 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -1,5 +1,5 @@ import { QueryClient, QueryClientProvider, useQueryClient } from "@tanstack/react-query"; -import { Activity, Suspense, lazy, useEffect, useRef, useState } from "react"; +import { Activity, Suspense, lazy, useEffect, useRef } from "react"; import ChatView from "./components/ChatView"; import Sidebar from "./components/Sidebar"; diff --git a/apps/web/src/components/DiffPanel.tsx b/apps/web/src/components/DiffPanel.tsx index c8ce00f7df1337a3b0ffc03e29cbcd738ea02b3f..6cf7b61ced6d2da91e8e7fc90968151a062f245f 100644 --- a/apps/web/src/components/DiffPanel.tsx +++ b/apps/web/src/components/DiffPanel.tsx @@ -1,5 +1,10 @@ import { parsePatchFiles } from "@pierre/diffs"; -import { FileDiff, type FileDiffMetadata, WorkerPoolContextProvider } from "@pierre/diffs/react"; +import { + FileDiff, + type FileDiffMetadata, + Virtualizer, + WorkerPoolContextProvider, +} from "@pierre/diffs/react"; import { useQuery, useQueryClient } from "@tanstack/react-query"; import { Columns2Icon, Rows3Icon } from "lucide-react"; import { type ReactNode, useEffect, useMemo, useRef, useState } from "react"; @@ -15,6 +20,7 @@ import { useStore } from "../store"; import { ToggleGroup, Toggle } from "./ui/toggle-group"; type DiffRenderMode = "stacked" | "split"; +type DiffThemeType = "light" | "dark" | "system"; type RenderablePatch = | { @@ -61,6 +67,10 @@ function resolveFileDiffPath(fileDiff: FileDiffMetadata): string { return raw; } +function buildFileDiffRenderKey(fileDiff: FileDiffMetadata): string { + return fileDiff.cacheKey ?? `${fileDiff.prevName ?? "none"}:${fileDiff.name}`; +} + interface DiffPanelProps { mode?: "inline" | "sheet"; } @@ -396,46 +406,60 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { ) : ( <> -
- Showing diffs for the active thread. -
++ Showing diffs for the active thread. +
+{checkpointDiffError}
+{checkpointDiffError}
++ {isLoadingCheckpointDiff + ? "Loading checkpoint diff..." + : "No patch available for this selection."} +
{renderablePatch.reason}
-
- {renderablePatch.text}
-
+ {renderablePatch.reason}
+
+ {renderablePatch.text}
+
+