@@ -731,12 +731,12 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
731731 text : trimmedInput ,
732732 images : images ,
733733 } )
734+ // Clear input state after sending
735+ setInputValue ( "" )
736+ setSelectedImages ( [ ] )
734737 } else {
735738 vscode . postMessage ( { type : "askResponse" , askResponse : "yesButtonClicked" } )
736739 }
737- // Clear input state after sending
738- setInputValue ( "" )
739- setSelectedImages ( [ ] )
740740 break
741741 case "completion_result" :
742742 case "resume_completed_task" :
@@ -786,13 +786,13 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
786786 text : trimmedInput ,
787787 images : images ,
788788 } )
789+ // Clear input state after sending
790+ setInputValue ( "" )
791+ setSelectedImages ( [ ] )
789792 } else {
790793 // Responds to the API with a "This operation failed" and lets it try again
791794 vscode . postMessage ( { type : "askResponse" , askResponse : "noButtonClicked" } )
792795 }
793- // Clear input state after sending
794- setInputValue ( "" )
795- setSelectedImages ( [ ] )
796796 break
797797 case "command_output" :
798798 vscode . postMessage ( { type : "terminalOperation" , terminalOperation : "abort" } )
@@ -1912,7 +1912,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
19121912 appearance = "primary"
19131913 disabled = { ! enableButtons }
19141914 className = { secondaryButtonText ? "flex-1 mr-[6px]" : "flex-[2] mr-0" }
1915- onClick = { ( ) => handlePrimaryButtonClick ( inputValue , selectedImages ) } >
1915+ onClick = { ( ) => handlePrimaryButtonClick ( ) } >
19161916 { primaryButtonText }
19171917 </ VSCodeButton >
19181918 </ StandardTooltip >
@@ -1934,7 +1934,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
19341934 appearance = "secondary"
19351935 disabled = { ! enableButtons && ! ( isStreaming && ! didClickCancel ) }
19361936 className = { isStreaming ? "flex-[2] ml-0" : "flex-1 ml-[6px]" }
1937- onClick = { ( ) => handleSecondaryButtonClick ( inputValue , selectedImages ) } >
1937+ onClick = { ( ) => handleSecondaryButtonClick ( ) } >
19381938 { isStreaming ? t ( "chat:cancel.title" ) : secondaryButtonText }
19391939 </ VSCodeButton >
19401940 </ StandardTooltip >
0 commit comments