Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Sep 10, 2025

Description

This PR fixes issue #7861 where the chat input was being cleared when a queued message was sent, causing users to lose any text they had typed while waiting for the queue to process.

Problem

When a message is queued (e.g., while waiting for approval), the chat input is immediately cleared. If the user types new text before the queue processes, that text is lost when the queued message is sent.

Solution

Modified the handleSendMessage function in ChatView.tsx to preserve the input value when queueing messages:

  • Removed setInputValue("") when queueing a message
  • Only clear selected images when queueing
  • The input will be properly cleared when the message is actually sent (not when queued)

Testing

  • All existing tests pass
  • Manually tested the queue behavior to ensure input is preserved

Related Issue

Fixes #7861

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes

Important

Fixes issue #7861 by preserving chat input in ChatView.tsx when queueing messages, ensuring input is only cleared upon message sending.

  • Behavior:
  • Testing:
    • All existing tests pass.
    • Manually tested queue behavior to ensure input preservation.

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

- Modified handleSendMessage to not clear input value when queueing
- Only clear selected images when queueing a message
- Input will be cleared when message is actually sent, not when queued
- Fixes #7861 where unsent text was lost when queued messages were processed
@roomote roomote bot requested review from cte, jr and mrubens as code owners September 10, 2025 22:02
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Sep 10, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Sep 10, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 10, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing my own code is like debugging in a mirror - everything looks backwards but the bugs are still mine.

console.log("queueMessage", text, images)
vscode.postMessage({ type: "queueMessage", text, images })
setInputValue("")
// Don't clear the input when queueing - user may be typing more
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix! The comment clearly explains why we're not clearing the input when queueing. However, consider adding a test specifically for this queue behavior to prevent regression. The test should verify:

  • Input text is preserved when queueing
  • Input is properly cleared when the message is actually sent
  • Selected images are cleared immediately (current behavior)

setInputValue("")
// Don't clear the input when queueing - user may be typing more
// The input will be cleared when the message is actually sent
setSelectedImages([])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is clearing images immediately intentional? Users might want to continue adding images while waiting, similar to how text is now preserved. This could be a nice enhancement for consistency, though the current behavior might be by design to show images are attached to the queued message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Chat input is cleared when a queued message is sent

3 participants