| ... | ... | @@ -29,13 +29,19 @@ type RenderablePatch = |
| 29 | 29 | reason: string; |
| 30 | 30 | }; |
| 31 | 31 | |
| 32 | | function getRenderablePatch(patch: string | undefined): RenderablePatch | null { |
| 32 | function getRenderablePatch( |
| 33 | patch: string | undefined, |
| 34 | cacheScope = "diff-panel", |
| 35 | ): RenderablePatch | null { |
| 33 | 36 | if (!patch) return null; |
| 34 | 37 | const normalizedPatch = patch.trim(); |
| 35 | 38 | if (normalizedPatch.length === 0) return null; |
| 36 | 39 | |
| 37 | 40 | try { |
| 38 | | const parsedPatches = parsePatchFiles(normalizedPatch, buildPatchCacheKey(normalizedPatch)); |
| 41 | const parsedPatches = parsePatchFiles( |
| 42 | normalizedPatch, |
| 43 | buildPatchCacheKey(normalizedPatch, cacheScope), |
| 44 | ); |
| 39 | 45 | const files = parsedPatches.flatMap((parsedPatch) => parsedPatch.files); |
| 40 | 46 | if (files.length > 0) { |
| 41 | 47 | return { kind: "files", files }; |
| ... | ... | @@ -190,7 +196,10 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { |
| 190 | 196 | const selectedPatch = selectedTurn ? selectedTurnCheckpointDiff : conversationCheckpointDiff; |
| 191 | 197 | const hasResolvedPatch = typeof selectedPatch === "string"; |
| 192 | 198 | const hasNoNetChanges = hasResolvedPatch && selectedPatch.trim().length === 0; |
| 193 | | const renderablePatch = useMemo(() => getRenderablePatch(selectedPatch), [selectedPatch]); |
| 199 | const renderablePatch = useMemo( |
| 200 | () => getRenderablePatch(selectedPatch, `diff-panel:${resolvedTheme}`), |
| 201 | [resolvedTheme, selectedPatch], |
| 202 | ); |
| 194 | 203 | const renderableFiles = useMemo(() => { |
| 195 | 204 | if (!renderablePatch || renderablePatch.kind !== "files") { |
| 196 | 205 | return []; |