Skip to content

AI-native design editor. Open-source Figma alternative.

Block chat input during AI streaming to prevent message spam

Anton A S54a418f555d7
diff --git a/src/components/ChatPanel.vue b/src/components/ChatPanel.vue
index 104d46af4..3dd812e02 100644
--- a/src/components/ChatPanel.vue
+++ b/src/components/ChatPanel.vue
@@ -33,6 +33,7 @@ function scrollToBottom() {
watch(messages, scrollToBottom, { deep: true })
function handleSubmit(text: string) {
+ if (status.value === 'streaming' || status.value === 'submitted') return
const c = ensureChat()
if (c) chat.value = markRaw(c)
chat.value?.sendMessage({ text }).catch(() => {
diff --git a/src/components/chat/ChatInput.vue b/src/components/chat/ChatInput.vue
index efbfcf767..3b4a16427 100644
--- a/src/components/chat/ChatInput.vue
+++ b/src/components/chat/ChatInput.vue
@@ -123,7 +123,7 @@ function handleSubmit(e: Event) {
data-test-id="chat-input"
placeholder="Describe a change…"
:class="uiInput({ class: 'min-w-0 flex-1 placeholder:text-muted' })"
- :disabled="status === 'submitted'"
+ :disabled="isStreaming"
@paste.stop
@copy.stop
@cut.stop