Skip to content

Commit a375134

Browse files
voltcrashclaude
andcommitted
fix(web): a pending fork's dialog stays closed after leaving its thread
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent f979e40 commit a375134

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,12 +1286,13 @@ export default function ChatView(props: ChatViewProps) {
12861286
const [showScrollToBottom, setShowScrollToBottom] = useState(false);
12871287
const [isWorkspaceFileDragActive, setIsWorkspaceFileDragActive] = useState(false);
12881288
const [optimisticUserMessages, setOptimisticUserMessages] = useState<ChatMessage[]>([]);
1289-
// Keyed by thread so the fork dialog closes when the route changes.
12901289
const [forkSource, setForkSource] = useState<{
12911290
sourceThreadId: ThreadId;
12921291
runId: RunId;
12931292
threadKey: string;
12941293
} | null>(null);
1294+
// ChatView survives route changes; a pending fork must not reopen its dialog on return.
1295+
if (forkSource !== null && forkSource.threadKey !== routeThreadKey) setForkSource(null);
12951296
// Set by "Work locally": the draft whose restored message should be resent
12961297
// once the cancelled dispatch has settled and the draft is in local mode.
12971298
// Keyed by draft id so a bootstrap rotating the thread id keeps it, while

0 commit comments

Comments
 (0)