Matthias Nott
2026-03-07 281834df3070cfbdfc28314ab2a2e84d321ca5df
components/chat/MessageList.tsx
....@@ -20,13 +20,14 @@
2020
2121 useEffect(() => {
2222 if (messages.length > 0) {
23
- // If the message count changed by more than 1, it's a session switch —
24
- // snap to bottom instantly instead of visibly scrolling down.
23
+ // If the message count changed by more than 1, it's a session switch or
24
+ // initial load — snap to bottom instantly instead of visibly scrolling.
2525 const delta = Math.abs(messages.length - prevLengthRef.current);
2626 const animated = delta === 1;
27
+ const delay = delta > 1 ? 200 : 50;
2728 setTimeout(() => {
2829 listRef.current?.scrollToEnd({ animated });
29
- }, 50);
30
+ }, delay);
3031 }
3132 prevLengthRef.current = messages.length;
3233 }, [messages.length, isTyping, lastContent]);