-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When an image is attached to the chatbox but no text is in the context, and a follow-up question is triggered, clicking a suggestion or auto-approval clears the attached images from the chatbox.
Steps to Reproduce
- Attach an image to the chatbox
- Do not enter any text in the chatbox
- Trigger a follow-up question (either through a suggestion or auto-approval)
- Click on a follow-up suggestion
- Observe that the attached images are cleared
Expected Behavior
The attached images should be preserved when follow-up question suggestions are clicked, just like the input text is preserved.
Root Cause
The handleSuggestionClickInRow function in ChatView.tsx was preserving the input text value but not the selected images. When handleSendMessage is called, it triggers handleChatReset() which clears both input and images. The input text was being restored after the send, but the images were not.
Fix
Fixed in PR #10707 by:
- Adding
selectedImagesRefto track selected images state - Adding useEffect to keep
selectedImagesRefin sync withselectedImagesstate - Modified
handleSuggestionClickInRowto preserve and restore both input text and images
Related
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done