From 860d13f44f40064ff07647fa3c93ca5c3ed34a31 Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Sat, 17 Jan 2026 05:00:35 +1000 Subject: [PATCH] fix(chat): only auto-scroll when messages change, not on every render --- apps/web/src/app/dashboard/agents/[id]/chat/[chatId]/page.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/dashboard/agents/[id]/chat/[chatId]/page.tsx b/apps/web/src/app/dashboard/agents/[id]/chat/[chatId]/page.tsx index 61b496e..5d2f927 100644 --- a/apps/web/src/app/dashboard/agents/[id]/chat/[chatId]/page.tsx +++ b/apps/web/src/app/dashboard/agents/[id]/chat/[chatId]/page.tsx @@ -357,9 +357,10 @@ export default function AgentChatPage(): React.ReactElement { } }, [activeConversationId, fetchMessages]); + // Scroll to bottom only when messages change or streaming content updates useEffect(() => { messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' }); - }); + }, [messages.length, streamingContent]); const handleSelectConversation = (convSlug: string) => { router.push(`/dashboard/agents/${agentId}/chat/${convSlug}`);