From 281834df3070cfbdfc28314ab2a2e84d321ca5df Mon Sep 17 00:00:00 2001
From: Matthias Nott <mnott@mnsoft.org>
Date: Sat, 07 Mar 2026 14:06:30 +0100
Subject: [PATCH] fix: project picker scroll, reconnect scroll, keyboard dismiss
---
components/chat/MessageList.tsx | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/components/chat/MessageList.tsx b/components/chat/MessageList.tsx
index 6ec43bb..b413d2b 100644
--- a/components/chat/MessageList.tsx
+++ b/components/chat/MessageList.tsx
@@ -20,13 +20,14 @@
useEffect(() => {
if (messages.length > 0) {
- // If the message count changed by more than 1, it's a session switch —
- // snap to bottom instantly instead of visibly scrolling down.
+ // If the message count changed by more than 1, it's a session switch or
+ // initial load — snap to bottom instantly instead of visibly scrolling.
const delta = Math.abs(messages.length - prevLengthRef.current);
const animated = delta === 1;
+ const delay = delta > 1 ? 200 : 50;
setTimeout(() => {
listRef.current?.scrollToEnd({ animated });
- }, 50);
+ }, delay);
}
prevLengthRef.current = messages.length;
}, [messages.length, isTyping, lastContent]);
--
Gitblit v1.3.1