From 3d9c9daf989c301e16177b5ae96b6c01d621c17f Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Thu, 18 Jun 2026 05:51:24 +0300 Subject: [PATCH] feat(ai-chat): focus composer on chat creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add autoFocus to the chat composer Textarea so a freshly created chat (window open, "New chat", chat switch — all remount ChatThread via key) lands with the cursor ready in the input field, letting the user type immediately without clicking into it. --- apps/client/src/features/ai-chat/components/chat-input.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/client/src/features/ai-chat/components/chat-input.tsx b/apps/client/src/features/ai-chat/components/chat-input.tsx index 73a7f126..42649aa6 100644 --- a/apps/client/src/features/ai-chat/components/chat-input.tsx +++ b/apps/client/src/features/ai-chat/components/chat-input.tsx @@ -52,6 +52,10 @@ export default function ChatInput({ minRows={1} maxRows={6} disabled={disabled} + // Focus the composer whenever this input mounts. ChatThread is remounted + // via `key` on every chat appearance (window open, "New chat", chat + // switch), so a fresh chat lands with the cursor ready in the field. + autoFocus /> {isStreaming ? (