Skip to content

Pause live output follow while reading#3936

Open
lnieuwenhuis wants to merge 20 commits into
pingdotgg:mainfrom
lnieuwenhuis:codex/pause-stream-auto-scroll
Open

Pause live output follow while reading#3936
lnieuwenhuis wants to merge 20 commits into
pingdotgg:mainfrom
lnieuwenhuis:codex/pause-stream-auto-scroll

Conversation

@lnieuwenhuis

@lnieuwenhuis lnieuwenhuis commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop following streamed output once the reader scrolls away from the live edge
  • preserve the current reading position while new output arrives
  • resume following when the reader returns to the bottom or uses the existing scroll-to-end control

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.tsx
  • vp check
  • vp run typecheck

Note

Pause live output auto-follow in chat timeline during manual scroll navigation

  • Adds manual navigation detection to MessagesTimeline via wheel, touch, keyboard, pointer, and minimap interactions; confirmed upward navigation disables auto-follow and shows the scroll-to-bottom pill.
  • Auto-follow resumes only when the user scrolls back to the bottom after confirmed manual navigation, using the new shouldResumeTimelineAutoFollow logic in timelineScrollAnchoring.ts.
  • Auto-follow state is tracked per-route and resets to enabled on route change via resolveTimelineAutoFollowEnabledForRoute.
  • LegendList maintainScrollAtEnd is disabled when auto-follow is off or a navigation probe is active, preventing the list from snapping back to the bottom during reading.
  • Behavioral Change: onIsAtEndChange now receives a structured { isAtEnd, manualNavigationReachedEnd } object instead of a plain boolean.

Macroscope summarized 7be9742.


Note

Medium Risk
Scroll and follow behavior is intricate and user-facing; the onIsAtEndChange callback shape changed, though coverage is added in unit tests.

Overview
Stops the chat timeline from pulling the viewport back to the live edge while the user reads older messages during streaming. LegendList maintainScrollAtEnd is now tied to an explicit autoFollowEnabled flag instead of staying on after the parent thought follow was off.

MessagesTimeline detects real navigation toward history (wheel, touch, keyboard, scrollbar drag, minimap jumps) via capture handlers and a short navigation probe, then calls onManualNavigation. Scroll handling reports { isAtEnd, manualNavigationReachedEnd } so ChatView only re-enables follow when shouldResumeTimelineAutoFollow agrees (e.g. user scrolled back down after detaching, not spurious “at end” during new-turn anchoring). Thread/route switches reset follow on by default through resolveTimelineAutoFollowEnabledForRoute.

The old ChatView scroll-node listeners on wheel/touch/pointerdown are removed in favor of this timeline-owned logic. resolveTimelineIsAtEnd now prefers isWithinMaintainScrollAtEndThreshold so “near end” maintenance does not count as the true live edge.

Reviewed by Cursor Bugbot for commit 7be9742. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0931e55a-cabb-4340-86b5-8f0248343781

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Jul 13, 2026
@lnieuwenhuis
lnieuwenhuis marked this pull request as ready for review July 13, 2026 11:50
Comment thread apps/web/src/components/chat/MessagesTimeline.logic.ts Outdated
Comment thread apps/web/src/components/chat/MessagesTimeline.logic.ts
@macroscopeapp

macroscopeapp Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new user-facing feature that pauses live output auto-follow when the user scrolls up to read history. It adds substantial new logic for detecting user navigation intent across multiple input types (wheel, touch, keyboard, scrollbar) and modifies the timeline's auto-scroll behavior. New features with runtime behavior changes warrant human review.

You can customize Macroscope's approvability policy. Learn more.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread apps/web/src/components/chat/MessagesTimeline.logic.ts
Comment thread apps/web/src/components/chat/MessagesTimeline.logic.ts
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
Comment thread apps/web/src/components/chat/MessagesTimeline.logic.ts Outdated
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
Comment thread apps/web/src/components/chat/MessagesTimeline.logic.ts
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
NeilTheFisher pushed a commit to NeilTheFisher/t3code that referenced this pull request Jul 17, 2026
@juliusmarminge
juliusmarminge self-requested a review July 20, 2026 08:51
@lnieuwenhuis lnieuwenhuis reopened this Jul 20, 2026
Comment thread apps/web/src/components/ChatView.tsx Outdated
@lnieuwenhuis

Copy link
Copy Markdown
Contributor Author

Sorry for closing without warning, I thought this PR was stale and only saw @juliusmarminge self-requested a review an hour ago after I closed it. Hope this didn't fuck anyone's workflows.

…to-scroll

# Conflicts:
#	apps/web/src/components/chat/MessagesTimeline.tsx
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
Comment thread apps/web/src/components/chat/MessagesTimeline.logic.ts
Comment thread apps/web/src/components/chat/MessagesTimeline.logic.ts Outdated
@lnieuwenhuis

Copy link
Copy Markdown
Contributor Author

@juliusmarminge I think it's ready if you wanna merge it

Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
Comment thread apps/web/src/components/ChatView.tsx
Comment thread apps/web/src/components/chat/MessagesTimeline.tsx Outdated
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Jul 20, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4c3da13. Configure here.

Comment thread apps/web/src/components/chat/MessagesTimeline.tsx
NeilTheFisher pushed a commit to NeilTheFisher/t3code that referenced this pull request Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Stop auto-scrolling when the user reads earlier streamed output

1 participant