From a6d497b9d90aceda3ed89fe63560fc4f7235c265 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Wed, 14 Jan 2026 02:21:38 +0000 Subject: [PATCH] fix: preserve images when follow-up question is answered --- webview-ui/src/components/chat/ChatView.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index 8f34de2cda..896bcd5809 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -133,6 +133,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction(null) const [sendingDisabled, setSendingDisabled] = useState(false) const [selectedImages, setSelectedImages] = useState([]) + const selectedImagesRef = useRef(selectedImages) // We need to hold on to the ask because useEffect > lastMessage will always // let us know when an ask comes in and handle it, but by the time @@ -186,6 +187,11 @@ const ChatViewComponent: React.ForwardRefRenderFunction { + selectedImagesRef.current = selectedImages + }, [selectedImages]) + // Compute whether auto-approval is paused (user is typing in a followup) const isFollowUpAutoApprovalPaused = useMemo(() => { return !!(inputValue && inputValue.trim().length > 0 && clineAsk === "followup") @@ -1247,12 +1253,14 @@ const ChatViewComponent: React.ForwardRefRenderFunction