| ... | ... | @@ -6,6 +6,7 @@ import { |
| 6 | 6 | WorkerPoolContextProvider, |
| 7 | 7 | } from "@pierre/diffs/react"; |
| 8 | 8 | import { useQuery, useQueryClient } from "@tanstack/react-query"; |
| 9 | import { useParams } from "@tanstack/react-router"; |
| 9 | 10 | import { Columns2Icon, Rows3Icon } from "lucide-react"; |
| 10 | 11 | import { type ReactNode, useEffect, useMemo, useRef, useState } from "react"; |
| 11 | 12 | import { checkpointDiffQueryOptions, providerQueryKeys } from "~/lib/providerReactQuery"; |
| ... | ... | @@ -105,7 +106,10 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { |
| 105 | 106 | const queryClient = useQueryClient(); |
| 106 | 107 | const [diffRenderMode, setDiffRenderMode] = useState<DiffRenderMode>("stacked"); |
| 107 | 108 | const patchViewportRef = useRef<HTMLDivElement>(null); |
| 108 | | const activeThread = state.threads.find((thread) => thread.id === state.activeThreadId); |
| 109 | const params = useParams({ strict: false }); |
| 110 | const routeThreadId = typeof params.threadId === "string" ? params.threadId : null; |
| 111 | const activeThreadId = state.diffThreadId ?? routeThreadId; |
| 112 | const activeThread = state.threads.find((thread) => thread.id === activeThreadId); |
| 109 | 113 | const activeThreadRuntimeId = |
| 110 | 114 | activeThread?.codexThreadId ?? activeThread?.session?.threadId ?? null; |
| 111 | 115 | const activeSessionId = activeThread?.session?.sessionId ?? null; |