Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix: prevent double auto-scroll on task completion

Gusffaf5a309d53
diff --git a/src/web/src/components/agent-chat/agent-chat-view.tsx b/src/web/src/components/agent-chat/agent-chat-view.tsx
index f10fc7138..094ffe47c 100644
--- a/src/web/src/components/agent-chat/agent-chat-view.tsx
+++ b/src/web/src/components/agent-chat/agent-chat-view.tsx
@@ -252,7 +252,12 @@ export function AgentChatView() {
// Keep taskMessages so the trace stays visible under the completed assistant reply.
const latest = await listMessages(conversationId, workspaceId);
setMessages((prev) => mergeMessages(prev, latest));
- scrollToBottom();
+ requestAnimationFrame(() => {
+ scrollRef.current?.scrollTo({
+ top: scrollRef.current.scrollHeight,
+ behavior: "instant",
+ });
+ });
} catch {
toast.error("Failed to refresh messages");
}