fix(chat): only auto-scroll when messages change, not on every render

This commit is contained in:
Ajax Davis 2026-01-17 05:00:35 +10:00
parent f8302c92d6
commit 860d13f44f

View file

@ -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}`);