From 5c0961431909f83536790677f46b6a08dadb3434 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 2 Mar 2026 10:10:15 -0800 Subject: [PATCH] refactor: remove redundant workLogCount stick-to-bottom effect timelineEntries is derived from workLogEntries; the timelineEntries effect already runs when work log changes. Dropped duplicate effect and unused workLogCount variable. Made-with: Cursor --- apps/web/src/components/ChatView.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 23a6c4f18666b42d0f121f7eb606231b2e6cfbee..8dd15be5b1c67e642989b9019f157636838d5d10 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -1284,7 +1284,6 @@ export default function ChatView({ threadId }: ChatViewProps) { // Auto-scroll on new messages const messageCount = timelineMessages.length; - const workLogCount = workLogEntries.length; const scrollMessagesToBottom = useCallback((behavior: ScrollBehavior = "auto") => { const scrollContainer = messagesScrollRef.current; if (!scrollContainer) return; @@ -1354,11 +1353,6 @@ export default function ChatView({ threadId }: ChatViewProps) { if (!shouldAutoScrollRef.current) return; scheduleStickToBottom(); }, [messageCount, scheduleStickToBottom]); - useEffect(() => { - if (phase !== "running") return; - if (!shouldAutoScrollRef.current) return; - scheduleStickToBottom(); - }, [phase, scheduleStickToBottom, workLogCount]); useEffect(() => { if (phase !== "running") return; if (!shouldAutoScrollRef.current) return; -- 2.54.0