Pause live output follow while reading#3936
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR introduces significant changes to how auto-scroll/auto-follow works in the chat timeline, including new event handlers to detect user navigation and pause auto-follow while reading. This represents a meaningful user-facing behavior change that warrants human review. You can customize Macroscope's approvability policy. Learn more. |
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3b93406. Configure here.

Summary
Why
LegendList's internal end-maintenance remained enabled after manual navigation, so streamed layout and data updates could pull the viewport back down even after the timeline scroll mode had detached.
Closes #3925
Validation
vp test apps/web/src/components/chat/MessagesTimeline.test.tsxvp checkvp run typecheckNote
Pause live output follow in chat timeline while user navigates toward history
autoFollowEnabledstate inChatViewContentto control whether the message timeline auto-follows the live end; this replaces direct wheel/touch/pointer listener attachment on the scroll node.MessagesTimelinegains anautoFollowEnabledprop and new capture-phase event handlers (wheel, touch, keyboard, pointer) that detect upward/history-directed input and mark a manual navigation session, disablingmaintainScrollAtEndon LegendList.resolveTimelineIsAtEndnow gives highest precedence toisWithinMaintainScrollAtEndThreshold, changing how the live-edge is determined when that value is present.Macroscope summarized 0e32afa.
Note
Medium Risk
Scroll and live-follow behavior is easy to regress across wheel, touch, keyboard, and streaming layout updates, though logic is extracted and covered by new unit tests.
Overview
Stops the chat timeline from snapping back to the live edge while the user reads older messages during streaming.
ChatView now tracks
timelineAutoFollowEnabledand passes it to the timeline. Auto-follow turns off when the user navigates away from the bottom (viaonManualNavigation) and turns back on when they reach the end, send a message, scroll to end, or switch threads. The olduseEffectthat listened for wheel/touch/pointer on the LegendList scroll node is removed.MessagesTimeline wires capture-phase handlers (wheel, touch, keyboard, scrollbar pointer) that only treat input as “read history” when it moves toward older content and the list can actually scroll up. That calls
onManualNavigationand turns off LegendListmaintainScrollAtEndwhenautoFollowEnabledis false (also briefly during keyboard-up navigation). Scroll handling uses new logic helpers to decide “at end” vs returning to the live edge after manual scroll.MessagesTimeline.logic adds pure helpers for directional input, scroll overflow, DOM-based end detection, and prefers
isWithinMaintainScrollAtEndThresholdoverisNearEndfor live-edge visibility.Reviewed by Cursor Bugbot for commit 0e32afa. Bugbot is set up for automated code reviews on this repo. Configure here.