Skip to content

Commit e35e43e

Browse files
committed
fix(web): prevent auto-scroll when toggling work log expansion
Expanding a work log group during a running session would trigger scheduleStickToBottom via the timelineEntries effect, yanking the viewport to the bottom. Disable auto-scroll on toggle so the user stays where they clicked; the scroll-to-bottom button is shown if they want to jump back.
1 parent 644b808 commit e35e43e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

apps/web/src/components/ChatView.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3435,6 +3435,11 @@ export default function ChatView({ threadId }: ChatViewProps) {
34353435
return false;
34363436
};
34373437
const onToggleWorkGroup = useCallback((groupId: string) => {
3438+
// Disable auto-scroll so expanding/collapsing work groups doesn't
3439+
// yank the viewport to the bottom. The user clicked intentionally —
3440+
// they can use the scroll-to-bottom button if they want to jump back.
3441+
shouldAutoScrollRef.current = false;
3442+
setShowScrollToBottom(true);
34383443
setExpandedWorkGroups((existing) => ({
34393444
...existing,
34403445
[groupId]: !existing[groupId],

0 commit comments

Comments
 (0)