fix(chat): only auto-scroll when messages change, not on every render
This commit is contained in:
parent
f8302c92d6
commit
860d13f44f
1 changed files with 2 additions and 1 deletions
|
|
@ -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}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue