Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion webview-ui/src/components/chat/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
try {
console.log("queueMessage", text, images)
vscode.postMessage({ type: "queueMessage", text, images })
Copy link
Contributor Author

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?

setInputValue("")
// Don't clear the input when queueing - let the user continue typing
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
// Don't clear the input when queueing - let the user continue typing
it("preserves input text when queueing messages", async () => {
// Test that setInputValue("") is not called when sendingDisabled is true
// and that only setSelectedImages([]) is called
})

// The input will be cleared when the message is actually sent
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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(
Expand Down
Loading