Skip to content

Commit 7dd7949

Browse files
committed
fix: preserve pasted images when api_req_started fires during chat activity
1 parent 4272a69 commit 7dd7949

File tree

2 files changed

+490
-1
lines changed

2 files changed

+490
-1
lines changed

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,11 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
456456
// Clear button state when a new API request starts
457457
// This fixes buttons persisting when the task continues
458458
setSendingDisabled(true)
459-
setSelectedImages([])
459+
// Note: Do NOT clear selectedImages here. This handler fires
460+
// every time the backend starts an API call, which would wipe
461+
// images the user has pasted while the chat is in progress.
462+
// Images are already cleared in the appropriate user-action
463+
// handlers (handleSendMessage, handlePrimaryButtonClick, etc.).
460464
setClineAsk(undefined)
461465
setEnableButtons(false)
462466
setPrimaryButtonText(undefined)

0 commit comments

Comments
 (0)