-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix: Preserve chat input when queueing messages #7869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -599,7 +599,8 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro | |||||||||||
| try { | ||||||||||||
| console.log("queueMessage", text, images) | ||||||||||||
| vscode.postMessage({ type: "queueMessage", text, images }) | ||||||||||||
| setInputValue("") | ||||||||||||
| // Don't clear the input when queueing - let the user continue typing | ||||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While this fix correctly addresses the issue, consider adding a test to verify that input text is preserved when messages are queued. The existing tests in ChatView.spec.tsx don't specifically cover this behavior. You could add a test like:
Suggested change
|
||||||||||||
| // The input will be cleared when the message is actually sent | ||||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice comment explaining the behavior! Consider also documenting this input preservation feature in user-facing documentation or tooltips so users understand that they can continue typing while messages are queued. |
||||||||||||
| setSelectedImages([]) | ||||||||||||
| } catch (error) { | ||||||||||||
| console.error( | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider this edge case: What happens if the user modifies the text after queueing but before the message is sent? The current implementation preserves the input, which is correct, but users might not realize their queued message contains different text than what's currently displayed.
Maybe the QueuedMessages component could show a preview of the queued text to make this clearer?