diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 67bb3d88..f9ff8fc3 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -293,6 +293,9 @@ }; onMount(() => { + const chatInput = document.getElementById('chat-textarea'); + window.setTimeout(() => chatInput?.focus(), 0); + const dropZone = document.querySelector('body'); const onDragOver = (e) => { diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte index e0965b08..0cc8b872 100644 --- a/src/lib/components/layout/Sidebar.svelte +++ b/src/lib/components/layout/Sidebar.svelte @@ -101,17 +101,16 @@ : 'invisible'}" >
- +
{#if $user?.role === 'admin'} diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index 7d424be4..581db7c0 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -134,6 +134,9 @@ settings.set({ ..._settings }); + + const chatInput = document.getElementById('chat-textarea'); + setTimeout(() => chatInput?.focus(), 0); }; const scrollToBottom = () => { diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 36f34219..515cbeea 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -99,6 +99,9 @@ if (await loadChat()) { await tick(); loaded = true; + + const chatInput = document.getElementById('chat-textarea'); + chatInput?.focus(); } else { await goto('/'); }