-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
App Version
v3.3.1 (or latest)
API Provider
Not Applicable / Other
Model Used
N/A
π Steps to Reproduce
- Open Roo Code in VS Code
- Start any task (e.g., type "explain this code" and press Enter)
- While the AI is processing (you'll see the response being generated):
- Copy an image to your clipboard (e.g., screenshot)
- Try to paste it into the chat input area (Ctrl/Cmd+V)
- Observe that the image is not pasted
π₯ Outcome Summary
Expected: Image should be pasted and queued along with any text message, just like text messages are queued when the AI is busy.
Actual: Image paste is completely blocked while a task is active, even though text can still be typed and queued.
π Comprehensive Issue Scoping
Root Cause / Implementation Target
The bug is caused by an inconsistency in the chat interface logic. While text messages can be queued when sendingDisabled is true (AI is busy), the image paste handler explicitly blocks image pasting during this state.
Affected Components
-
Primary Files:
webview-ui/src/components/chat/ChatView.tsx(lines 813-815): Contains theshouldDisableImageslogicwebview-ui/src/components/chat/ChatTextArea.tsx(lines 667): Contains the paste handler that checksshouldDisableImages
-
Secondary Impact:
webview-ui/src/components/chat/QueuedMessages.tsx: Already supports displaying images in queued messages- Message queue processing logic: Already handles messages with images
Current Implementation Analysis
The shouldDisableImages flag at line 813 in ChatView.tsx is calculated as:
const shouldDisableImages = !model?.supportsImages || sendingDisabled || selectedImages.length >= MAX_IMAGES_PER_MESSAGEWhen sendingDisabled is true (AI is processing), this makes shouldDisableImages true, which causes the paste handler in ChatTextArea.tsx to skip image processing entirely.
Proposed Implementation
Step 1: Update the shouldDisableImages logic
- File:
webview-ui/src/components/chat/ChatView.tsx - Changes: Remove
sendingDisabledfrom theshouldDisableImagescalculation - Rationale: Allow images to be selected/pasted even when sending is disabled, consistent with text input behavior
Step 2: Ensure paste handler processes images regardless of sending state
- File:
webview-ui/src/components/chat/ChatTextArea.tsx - Changes: The paste handler will now process images when
shouldDisableImagesis false (which it will be after Step 1) - Rationale: Images should be added to
selectedImagesstate for queueing
Code Architecture Considerations
- The existing message queue already supports images (QueuedMessage type includes
images: string[]) - The queue display component already renders image thumbnails
- No changes needed to the queue processing logic
Testing Requirements
- Unit Tests:
- Test that
shouldDisableImagesis false when onlysendingDisabledis true - Test that paste handler adds images to selectedImages when AI is busy
- Test that
- Integration Tests:
- Test full flow: paste image while AI busy β image queued β message sent when AI ready
- Edge Cases:
- Test pasting when already at MAX_IMAGES_PER_MESSAGE limit
- Test pasting multiple images while AI is busy
Performance Impact
- Expected performance change: Neutral
- No additional processing or state management required
Security Considerations
- No new security risks - existing image validation remains in place
Dependencies and Breaking Changes
- No external dependencies affected
- No API contract changes
- No breaking changes for users
Metadata
Metadata
Assignees
Labels
Type
Projects
Status