From f7eddbf9affe21c3dea55f3607d14ff04416e5f5 Mon Sep 17 00:00:00 2001 From: Chris Hasson Date: Fri, 25 Jul 2025 12:49:48 -0700 Subject: [PATCH 1/2] fix(chat): Prevent input clearing when clicking chat buttons The chat box is no longer cleared when clicking buttons Previously, we had a bug where if either of the buttons in the agent chat was clicked, the ChatTextArea would get cleared. Now, the text box will only get cleared if the message is sent as part of the response. Moved input clearing logic to only execute when a message is successfully sent, preventing the input field from clearing prematurely when clicking "yes" or "no" buttons in the chat interface. This improves user experience by retaining the input content if an action fails or requires further interaction Fixes #1520 --- .changeset/calm-pears-fry.md | 7 +++++++ webview-ui/src/components/chat/ChatView.tsx | 16 ++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 .changeset/calm-pears-fry.md diff --git a/.changeset/calm-pears-fry.md b/.changeset/calm-pears-fry.md new file mode 100644 index 0000000000..bf53d43a7f --- /dev/null +++ b/.changeset/calm-pears-fry.md @@ -0,0 +1,7 @@ +--- +"kilo-code": patch +--- + +The chat box is no longer cleared when clicking buttons + +Previously, if either of the buttons in the agent chat was clicked, the ChatTextArea would get cleared. Now, the ChatTextArea will only get cleared if a message is sent as part of the response. diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index efd2db856c..1c7ec2949a 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -622,12 +622,12 @@ const ChatViewComponent: React.ForwardRefRenderFunction handlePrimaryButtonClick(inputValue, selectedImages)}> + onClick={() => handlePrimaryButtonClick()}> {primaryButtonText} @@ -1824,7 +1824,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction handleSecondaryButtonClick(inputValue, selectedImages)}> + onClick={() => handleSecondaryButtonClick()}> {isStreaming ? t("chat:cancel.title") : secondaryButtonText} From adbc997e7ba51423bf8bd60fe6c0c5b4aa2691f3 Mon Sep 17 00:00:00 2001 From: Daniel <57051444+daniel-lxs@users.noreply.github.com> Date: Mon, 28 Jul 2025 18:02:57 -0500 Subject: [PATCH 2/2] Delete .changeset/calm-pears-fry.md --- .changeset/calm-pears-fry.md | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .changeset/calm-pears-fry.md diff --git a/.changeset/calm-pears-fry.md b/.changeset/calm-pears-fry.md deleted file mode 100644 index bf53d43a7f..0000000000 --- a/.changeset/calm-pears-fry.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"kilo-code": patch ---- - -The chat box is no longer cleared when clicking buttons - -Previously, if either of the buttons in the agent chat was clicked, the ChatTextArea would get cleared. Now, the ChatTextArea will only get cleared if a message is sent as part of the response.