Skip to content

Commit 5b7692e

Browse files
authored
🤖 Fix auto-scroll when PinnedTodoList updates (#346)
Auto-scroll effect was missing `todos` dependency, so scroll position wouldn't adjust when TODO list changed. _Generated with `cmux`_
1 parent d2a4808 commit 5b7692e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/AIView.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,18 @@ const AIViewInner: React.FC<AIViewProps> = ({
345345
void window.api.workspace.openTerminal(namedWorkspacePath);
346346
}, [namedWorkspacePath]);
347347

348-
// Auto-scroll when messages update (during streaming)
348+
// Auto-scroll when messages or todos update (during streaming)
349349
useEffect(() => {
350350
if (workspaceState && autoScroll) {
351351
performAutoScroll();
352352
}
353-
}, [workspaceState?.messages, autoScroll, performAutoScroll, workspaceState]);
353+
}, [
354+
workspaceState?.messages,
355+
workspaceState?.todos,
356+
autoScroll,
357+
performAutoScroll,
358+
workspaceState,
359+
]);
354360

355361
// Scroll to bottom when workspace loads or changes
356362
useEffect(() => {

0 commit comments

Comments
 (0)