Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): keep following the stream after scrolling back to the live edge #6519

Mergedlnieuwenhuis(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/6519/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

What Changed

Releases the send-time anchored end space when the chat timeline re-arms live follow, so scrolling back down to the live edge during a streaming turn actually resumes following it.

One call site changed: the isAtEnd branch of onIsAtEndChange in ChatView.tsx now drops the timeline anchor, the same way scrollToEnd already did for the scroll-to-bottom pill. The shared updater is named releaseChatTimelineAnchor so the reason lives in one place.

Why

While the anchored end space is installed (it holds a sent message near the top while its turn streams), MessagesTimeline deliberately passes maintainScrollAtEnd={false}, and ChatView drives the streaming scrolls itself — but only while timelineScrollModeRef is "anchoring-new-turn".

Scrolling up mid-turn switches the mode to "free-scrolling" and intentionally keeps the anchor installed (collapsing it mid-gesture would clamp the viewport back to the end). Scrolling back down then re-armed follow — mode "following-end", liveFollowEnabled true — but left the anchor in place. Neither mechanism was pinning the list any more:

  • LegendList's maintainScrollAtEnd stayed off, because the anchor was still there.
  • The anchoring effect no longer ran, because the mode was no longer "anchoring-new-turn".

So further output kept appending below the viewport, and the scroll-to-bottom pill stayed hidden because the list did consider itself at the end. Reopening the thread (which clears the anchor) was the only way to recover.

The re-arm branch is only reachable once manual navigation has already broken follow, so the send-time "keep the sent message at the top" framing during normal streaming is unaffected.

UI Changes

Interaction-only; no static visual difference, so no before/after screenshots apply.

Reproduction: send a prompt whose response fills more than a screen; while it is streaming, scroll up, then scroll back to the bottom. Before this change, subsequent output ran off the bottom of the viewport with no pill and no way back except switching threads. After it, the timeline sticks to the live edge again.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes — not applicable, nothing static changes
  • I included a video for animation/interaction changes — not applicable, didn't change visuals, only fixed a behaviour issue

Note

Low Risk Scoped to chat scroll/anchor state in ChatView with a regression test; no auth, data, or API changes.

Overview Fixes chat live-edge follow after you scroll up during a streaming turn and then scroll back down.

The send-time timeline anchor keeps LegendList’s maintainScrollAtEnd off while ChatView drives scroll in anchoring mode. Re-arming follow (mode + liveFollowEnabled) used to leave that anchor in place, so new output could grow below the viewport with no scroll-to-bottom affordance. releaseChatTimelineAnchor centralizes clearing the anchor; it’s now invoked when the user returns to the end (same as the scroll-to-bottom path), not only from scrollToEnd.

Adds a MessagesTimeline test that data-maintain-scroll-at-end="enabled" returns once anchorMessageId is null while live follow is on.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1a02177d20f2ced7bf411c3e54cfc37d02a81b73. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. 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 Plus

      Run ID: 5f632b12-631c-4ad5-bf48-b89d0ea24e15

      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

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Approvability

      Verdict: Approved 1a02177

      This is a straightforward, self-contained bug fix that extracts existing logic into a helper function and applies it in an additional code path to fix stream-following behavior. The change is well-documented and includes unit test coverage.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. @juliusmarminge @t3dotgg I've gone through some of the issues with no PR's attached and opened PR's for them, these should all be pretty easy small wins with no drawbacks as far as I can see. I know you guys are busy yourselves but if/when you have the time I'd appreciate if you could look at some of my PR's.

    5. Closing this one — it's been open since Aug 13 and ChatView.tsx has moved substantially on main since (~14 commits touching it), so the branch is stale enough that it'd need a rewrite rather than a rebase. Happy to reopen a fresh PR against current main if the follow-resume behavior is still wanted.

    6. Reopening — I re-checked against current main and the staleness worry that made me close this was wrong.

      • The bug is still there: onIsAtEndChange in ChatView.tsx still flips timelineScrollModeRef to following-end and re-enables live follow without releasing the send-time anchor, so the timeline lands in "following-end" with nothing following.
      • The branch still merges cleanly into current main, and the hunk lands in exactly the right place — no rebase needed.

Sign in to join this conversation.