You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): returning to a finished thread no longer scrolls through its new work - #38765
Leave a thread while its agent works, come back after it finishes (more than 5 minutes later), and the timeline slides through everything the agent did before it reaches the end. On a long run it reads as a scroll from top to bottom.
Five minutes after you leave a thread, the client stops following it, so coming back reopens the thread from its disk cache. That copy still says the run is working. MessagesTimeline picks LegendList's animated keep-at-end mode whenever isWorking is true, so it starts an animated scroll to the end of the stale copy. When the server's fresh snapshot lands, LegendList retargets the scroll already in flight to the new end, and the animation runs through every new row.
Fixes#38753. Reopens #38754, which the open PR limit closed.
Change
The animated keep-at-end mode is for rows that stream in while you watch. MessagesTimeline now uses it only when the thread is live: ThreadTimeline passes its existing syncing flag through, and while the thread shows a cached or catching-up copy the list keeps the end without animating. A snapshot lands while the thread still reports synchronizing, so the catch-up arrives at the end in one step. Once the thread is live again, streaming keeps its smooth follow.
Scope
Web and desktop: fixed here (desktop renders the web timeline).
Mobile: its thread feed already keeps the end without animating, so it is unaffected.
Guest page: has no disk-cache reopen; it doesn't pass the new prop and behaves as before.
Coming back within 5 minutes reuses the in-memory copy, which doesn't slide; the view still shows that copy briefly before it updates, as before.
Verification
Recorded on a dev server holding only demo data. The demo thread copies the shape of a real long run (counts, order and sizes of its items) with filler text. A page reload stands in for the 5-minute absence; both reopen the thread from the disk cache.
Frames right after clicking back in, 100 ms apart. Before (main): the stale "Working for…" view, then the content glides up for about 450 ms.
After: the stale view, then the end on the next frame.
Before and after side by side, quarter speed:
return-slide-quarter-speed.mp4
Real speed:
return-slide-realtime.mp4
Same thread, same starting point (scrollTop 279 of 1027):
New browser test: a working thread that is still syncing takes a burst of new rows and reaches the end with no smooth scrollTo. It fails on main (a smooth scroll to 2191).
vp test run apps/web/src/components/chat/MessagesTimeline.browser.test.tsx: 72 passed.
vp run check:changed: format, lint, knip, typecheck, tests and React compiler pass.
…s new work
A thread the client stopped following reopens from its disk cache, which can
still say the run is working. The timeline used LegendList's animated
keep-at-end mode for that stale copy, and when the fresh snapshot landed the
in-flight animation was retargeted to the new end and scrolled through every
new row. Animate the follow only once the thread is live again, so a cached or
catching-up copy lands at the end at once.
Fixespingdotgg#38753
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewing files that changed from the base of the PR and between 5983a57 and 26d7aac.
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
No actionable comments were generated in the recent review.
Walkthrough
MessagesTimeline now accepts a syncing flag and avoids smooth end-follow scrolling while syncing. ThreadTimeline passes the flag, and a browser test checks that a syncing timeline stays at the end without smooth scrolling.
MessagesTimeline accepts syncing, which defaults to false. ThreadTimeline passes the flag. When syncing, end-follow uses non-smooth scrolling. The browser test checks that appending a long assistant message keeps the timeline at the end without smooth scrolling.
This change stops a reopened thread from scrolling smoothly through work added while the user was away. It keeps the end in view without animation while the thread is syncing. The change is small and tested, and no merge-blocking risk is identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: returning to a finished thread no longer scrolls through its new work. The diff passes the existing syncing flag to MessagesTimeline and disables animated keep-at-end …
Description check
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the cause and the expected behavior, and the Change section explains the fix. …
Linked Issues check
[#38753] Requirement: a thread reopened from the disk cache must not smoothly scroll through rows added while the user was away. The root cause is that MessagesTimeline selects LegendList's animated k…
Out of Scope Changes check
The reviewed changes are the syncing prop in MessagesTimeline.tsx (per the change summary), the syncing pass-through in ThreadTimeline.tsx (confirmed by diff), and a browser test in MessagesTimeline.b…
Full details: Title check
Explanation
The title names the main change: returning to a finished thread no longer scrolls through its new work. The diff passes the existing syncing flag to MessagesTimeline and disables animated keep-at-end while the thread is syncing, which matches the title. It uses the conventional commit form and plain language.
Full details: Description check
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the cause and the expected behavior, and the Change section explains the fix. The Scope section links issue #38753 and states the affected clients. The Verification section gives browser test results, frame data, and a test command with its output, and it includes before/after evidence. It notes the limits of the test setup (demo data, page reload in place of the five-minute absence). The template's model-attribution line is present at the end.
Full details: Linked Issues check
Explanation
[#38753] Requirement: a thread reopened from the disk cache must not smoothly scroll through rows added while the user was away. The root cause is that MessagesTimeline selects LegendList's animated keep-at-end mode (TIMELINE_MAINTAIN_SCROLL_AT_END_SMOOTH) whenever isWorking is true. The head adds an optional syncing prop to MessagesTimelineProps, defaulting to false in ConversationTimeline. The ThreadTimeline.tsx diff confirms it now passes syncing={syncing} to MessagesTimeline. The change summary states that smooth end-follow is enabled only when the timeline is not syncing. A browser test in MessagesTimeline.browser.test.tsx covers a syncing working thread that receives a burst of rows. It asserts arrival at the end with no smooth scrollTo, and the author reports it fails on main. Limits: the MessagesTimeline.tsx diff could not be read (changed blobs unavailable), and the head file read was truncated before the scroll-mode selection code. The selection logic is therefore established from the change summary and the PR description, not from a direct code read. Mobile and guest behavior are not coding requirements of #38753 and were not assessed further.
Full details: Out of Scope Changes check
Explanation
The reviewed changes are the syncing prop in MessagesTimeline.tsx (per the change summary), the syncing pass-through in ThreadTimeline.tsx (confirmed by diff), and a browser test in MessagesTimeline.browser.test.tsx. All of them connect directly to the scroll behavior described in #38753. No unrelated changes were identified in the available evidence. The MessagesTimeline.tsx diff could not be read directly, so its full content is established only from the change summary.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The automated pipeline ran the reported steps in the real app without this change, and the problem did not appear. So it cannot show that this change fixes anything.
What was run on ba640037e8, the commit before this change:
On both commits: seeded twelve completed replay turns, opened Long task, started a long replay task, switched to Other work, stayed away for more than five real minutes until Long task showed Done, waited for the sidebar row transition to settle, and clicked Long task. Recorded the return and captured the final position.
How: Real web app and server on each commit, driven by the scenario runner in Chromium on Linux, 1280×800, dark theme, reduced motion disabled. Fresh isolated databases, identical synthetic history, and the free replay provider. Captures and recordings were inspected before final reporting.
Closing this pull request. #38753 has been asked for the missing steps; once the problem can be shown this can be reopened, or the fix built again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).takeover:blockedTakeover blocked; reason in the PR bodyvouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Leave a thread while its agent works, come back after it finishes (more than 5 minutes later), and the timeline slides through everything the agent did before it reaches the end. On a long run it reads as a scroll from top to bottom.
Five minutes after you leave a thread, the client stops following it, so coming back reopens the thread from its disk cache. That copy still says the run is working.
MessagesTimelinepicks LegendList's animated keep-at-end mode wheneverisWorkingis true, so it starts an animated scroll to the end of the stale copy. When the server's fresh snapshot lands, LegendList retargets the scroll already in flight to the new end, and the animation runs through every new row.Fixes #38753. Reopens #38754, which the open PR limit closed.
Change
The animated keep-at-end mode is for rows that stream in while you watch.
MessagesTimelinenow uses it only when the thread is live:ThreadTimelinepasses its existingsyncingflag through, and while the thread shows a cached or catching-up copy the list keeps the end without animating. A snapshot lands while the thread still reportssynchronizing, so the catch-up arrives at the end in one step. Once the thread is live again, streaming keeps its smooth follow.Scope
Verification
Recorded on a dev server holding only demo data. The demo thread copies the shape of a real long run (counts, order and sizes of its items) with filler text. A page reload stands in for the 5-minute absence; both reopen the thread from the disk cache.
Frames right after clicking back in, 100 ms apart. Before (
main): the stale "Working for…" view, then the content glides up for about 450 ms.After: the stale view, then the end on the next frame.
Before and after side by side, quarter speed:
return-slide-quarter-speed.mp4
Real speed:
return-slide-realtime.mp4
Same thread, same starting point (
scrollTop279 of 1027):scrollTopper frame after the clickscrollTocallsmainscrollTo. It fails onmain(a smooth scroll to 2191).vp test run apps/web/src/components/chat/MessagesTimeline.browser.test.tsx: 72 passed.vp run check:changed: format, lint, knip, typecheck, tests and React compiler pass.Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code