diff --git a/frontend/src/ide/chat-ai/DefaultPromptInput.jsx b/frontend/src/ide/chat-ai/DefaultPromptInput.jsx index ceefb64..e941935 100644 --- a/frontend/src/ide/chat-ai/DefaultPromptInput.jsx +++ b/frontend/src/ide/chat-ai/DefaultPromptInput.jsx @@ -6,6 +6,7 @@ import { Sender } from "@ant-design/x"; function DefaultPromptInput({ value, isPromptRunning, + isResponseStreaming = false, onSenderChange, onSubmit, onCancel, @@ -25,7 +26,7 @@ function DefaultPromptInput({ actions={(_, info) => { const { SendButton, LoadingButton } = info.components; - if (isPromptRunning) { + if (isPromptRunning && !isResponseStreaming) { return ( @@ -51,7 +52,7 @@ function DefaultPromptInput({ /> } shape="default" - disabled={!value} + disabled={!value || isPromptRunning} className={shouldHighlightSend ? "onboarding-send-highlight" : ""} /> @@ -64,6 +65,7 @@ function DefaultPromptInput({ DefaultPromptInput.propTypes = { value: PropTypes.string.isRequired, isPromptRunning: PropTypes.bool.isRequired, + isResponseStreaming: PropTypes.bool, onSenderChange: PropTypes.func.isRequired, onSubmit: PropTypes.func.isRequired, onCancel: PropTypes.func.isRequired, diff --git a/frontend/src/ide/chat-ai/ExistingChat.jsx b/frontend/src/ide/chat-ai/ExistingChat.jsx index edc2b51..eafeaf2 100644 --- a/frontend/src/ide/chat-ai/ExistingChat.jsx +++ b/frontend/src/ide/chat-ai/ExistingChat.jsx @@ -246,6 +246,13 @@ const ExistingChat = memo(function ExistingChat({ return -1; }, [chatMessages, chatIntents]); + // Check if response is actively streaming (thought chain done, response started) + const isResponseStreaming = useMemo(() => { + if (!chatMessages?.length) return false; + const lastMessage = chatMessages?.[chatMessages.length - 1]; + return isPromptRunning && lastMessage?.response?.length > 0; + }, [chatMessages, isPromptRunning]); + useEffect(() => { if (chatMessages.length) { setLastChatMessageId( @@ -454,6 +461,7 @@ const ExistingChat = memo(function ExistingChat({ {editorContent} -
- {isPromptRunning ? ( + {isPromptRunning && !isResponseStreaming ? (