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 })
setInputValue("")
// Don't clear the input when queueing - user may be typing a new message
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 for preserving user input when queueing messages. However, I noticed that in other parts of this file (lines 702 and 757 in handlePrimaryButtonClick and handleSecondaryButtonClick), the input is still cleared when handling button clicks. Is this intentional? Should we consider making the input preservation behavior consistent across all queueing scenarios, or are those different use cases where clearing is desired?

// Only clear the images since they were queued with this message
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.

Would it be worth adding unit tests for this queueing behavior? I noticed there are no tests for the ChatView component currently. Tests would help prevent regressions and document the expected behavior for future maintainers.

} catch (error) {
console.error(
Expand Down
Loading