From a327b24248dd5057ddf1bc03b94494cdb8408a8d Mon Sep 17 00:00:00 2001 From: vikingowl Date: Wed, 31 Dec 2025 21:55:55 +0100 Subject: [PATCH] fix: allow typing during streaming and maintain input focus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Textarea no longer disabled during streaming (only sending is blocked) - User can prepare their next message while LLM is responding - Focus maintained on input after sending a message - Image upload also enabled during streaming 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../src/lib/components/chat/ChatInput.svelte | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/components/chat/ChatInput.svelte b/frontend/src/lib/components/chat/ChatInput.svelte index 3d9804c..f9ecf5c 100644 --- a/frontend/src/lib/components/chat/ChatInput.svelte +++ b/frontend/src/lib/components/chat/ChatInput.svelte @@ -89,6 +89,9 @@ } onSend?.(content, images); + + // Keep focus on input after sending + requestAnimationFrame(() => focusInput()); } /** @@ -105,11 +108,18 @@ pendingImages = images; } - // Focus textarea on mount - $effect(() => { + /** + * Focus the textarea + */ + function focusInput(): void { if (textareaElement && !disabled) { textareaElement.focus(); } + } + + // Focus textarea on mount + $effect(() => { + focusInput(); }); @@ -119,7 +129,7 @@ {/if} @@ -147,14 +157,14 @@ {/if} - +