Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 14, 2026

closes #10710

Fixes the issue where images attached to the chatbox are cleared when a follow-up question suggestion is clicked or auto-approved.

Problem

When a user attaches an image to the chatbox but has no text, and a follow-up question is triggered, clicking a suggestion (or auto-approval) would clear the attached images from the chatbox.

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.

Solution

Added a selectedImagesRef ref to track the current selected images state (similar to the existing inputValueRef). When handling follow-up suggestions, both the input text and selected images are now preserved and restored after the message is sent.

Changes

  • Added selectedImagesRef to track selected images state
  • Added useEffect to keep selectedImagesRef in sync with selectedImages state
  • Modified handleSuggestionClickInRow to preserve and restore both input text and images

Testing

  • All existing tests pass (ChatView, ChatTextArea, FollowUpSuggest)
  • Manually verified fix preserves images when answering follow-up questions

View task on Roo Code Cloud


Important

Fixes image clearing issue in ChatView.tsx by preserving images and input text when follow-up questions are answered.

  • Behavior:
    • Fixes issue where images in chatbox were cleared when follow-up question was answered in ChatView.tsx.
    • Preserves images and input text when handling follow-up suggestions.
  • Implementation:
    • Adds selectedImagesRef to track selected images state in ChatView.tsx.
    • Adds useEffect to sync selectedImagesRef with selectedImages state.
    • Modifies handleSuggestionClickInRow to restore input text and images after sending a message.
  • Testing:
    • All existing tests pass.
    • Manually verified image preservation when answering follow-up questions.

This description was created by Ellipsis for a6d497b. You can customize this summary. It will automatically update as commits are pushed.

@roomote
Copy link
Contributor Author

roomote bot commented Jan 14, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation correctly preserves selected images when a follow-up suggestion is clicked by:

  • Adding a selectedImagesRef to track the current images state
  • Capturing and restoring images in handleSuggestionClickInRow, following the existing pattern used for inputValueRef

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@roomote
Copy link
Contributor Author

roomote bot commented Jan 14, 2026

Fixes #10710

@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jan 14, 2026
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bug: Images cleared from chatbox when follow-up question is triggered with no text

3 participants