authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-03-02 10:10:15-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-03-02 10:19:22-08:00
log5c0961431909f83536790677f46b6a08dadb3434
treed45d6fcd75ff4673c42754899361f7d8f5c8367a
parent4c846332c5c972b715862df9f19b6c095c76841b

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

1 files changed, 0 insertions(+), 6 deletions(-)

apps/web/src/components/ChatView.tsx-6
......@@ -1284,7 +1284,6 @@ export default function ChatView({ threadId }: ChatViewProps) {
12841284
12851285 // Auto-scroll on new messages
12861286 const messageCount = timelineMessages.length;
1287 const workLogCount = workLogEntries.length;
12881287 const scrollMessagesToBottom = useCallback((behavior: ScrollBehavior = "auto") => {
12891288 const scrollContainer = messagesScrollRef.current;
12901289 if (!scrollContainer) return;
......@@ -1354,11 +1353,6 @@ export default function ChatView({ threadId }: ChatViewProps) {
13541353 if (!shouldAutoScrollRef.current) return;
13551354 scheduleStickToBottom();
13561355 }, [messageCount, scheduleStickToBottom]);
1357 useEffect(() => {
1358 if (phase !== "running") return;
1359 if (!shouldAutoScrollRef.current) return;
1360 scheduleStickToBottom();
1361 }, [phase, scheduleStickToBottom, workLogCount]);
13621356 useEffect(() => {
13631357 if (phase !== "running") return;
13641358 if (!shouldAutoScrollRef.current) return;