diff --git a/src/lib/components/ChatSidebar.svelte b/src/lib/components/ChatSidebar.svelte index 6f0af49..430e772 100644 --- a/src/lib/components/ChatSidebar.svelte +++ b/src/lib/components/ChatSidebar.svelte @@ -251,8 +251,11 @@ } // Anchor to bottom on new messages, unless user is reading older ones. + // Also runs when the mobile panel becomes visible: while hidden the list + // has no height, so earlier scrolls were no-ops. $effect(() => { messages.length; + mobileActive; if (!listEl || userScrolledUp) return; tick().then(() => { if (listEl) listEl.scrollTop = listEl.scrollHeight;