Compare commits

...
Author SHA1 Message Date
Cursor AgentandJulius Marminge d497cd72f7 Fix BranchToolbar errors silently dropped for draft threads
Route errors through onError callback prop so draft thread errors
are handled via ChatView's setThreadError, which correctly updates
localDraftErrorsByThreadId instead of dispatching SET_ERROR that
silently no-ops for threads not in state.threads.

Co-authored-by: Julius Marminge <[email protected]>
2026-03-02 06:44:05 +00:00
2 changed files with 8 additions and 1 deletions

No files matched your search

+7 -1
View File
@@ -34,6 +34,7 @@ interface BranchToolbarProps {
onEnvModeChange: (mode: "local" | "worktree") => void;
envLocked: boolean;
onComposerFocusRequest?: () => void;
onError?: (error: string | null) => void;
}
export default function BranchToolbar({
@@ -42,6 +43,7 @@ export default function BranchToolbar({
onEnvModeChange,
envLocked,
onComposerFocusRequest,
onError,
}: BranchToolbarProps) {
const { state, dispatch } = useStore();
const draftThread = useComposerDraftStore((store) => store.getDraftThread(threadId));
@@ -147,7 +149,11 @@ export default function BranchToolbar({
const setThreadError = (error: string | null) => {
if (!activeThreadId) return;
dispatch({ type: "SET_ERROR", threadId: activeThreadId, error });
if (hasServerThread) {
dispatch({ type: "SET_ERROR", threadId: activeThreadId, error });
} else {
onError?.(error);
}
};
const setThreadBranch = (branch: string | null, worktreePath: string | null) => {
+1
View File
@@ -2463,6 +2463,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
onEnvModeChange={onEnvModeChange}
envLocked={envLocked}
onComposerFocusRequest={scheduleComposerFocus}
onError={(error) => setThreadError(activeThread.id, error)}
/>
)}