Skip to content

fix(web): returning to a finished thread no longer scrolls through its new work - #38765

Closed
pouyarezvani wants to merge 2 commits into
pingdotgg:mainfrom
pouyarezvani:fix/thread-return-scroll
Closed

pouyarezvani wants to merge 2 commits into
pingdotgg:mainfrom
pouyarezvani:fix/thread-return-scroll

Conversation

@pouyarezvani

Copy link
Copy Markdown
Contributor

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. 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.

return-before-frames

After: the stale view, then the end on the next frame.

return-after-frames

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):

scrollTop per frame after the click smooth scrollTo calls
main 279 → 281 → 290 → 306 → 337 → 392 → 486 → 601 → … → 1034 over ~450 ms 2, from LegendList's keep-at-end handler
this PR 279 → 1034 0
  • 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.

Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

…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.

Fixes pingdotgg#38753

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 18, 2026
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

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.

Changes: Sync-aware timeline scrolling

Layer / File(s) Summary
Sync-aware end-follow behavior
apps/web/src/components/chat/MessagesTimeline.tsx, apps/web/src/components/chat/ThreadTimeline.tsx, apps/web/src/components/chat/MessagesTimeline.browser.test.tsx
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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested labels: bugfix

Suggested reviewers: juliusmarminge, maria-rcks

Merge Risk: Minimal · previous review 5983a

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed [#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 Passed 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
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 378584a and 5983a57.

Files selected for processing: 3

  • apps/web/src/components/chat/MessagesTimeline.browser.test.tsx
  • apps/web/src/components/chat/MessagesTimeline.tsx
  • apps/web/src/components/chat/ThreadTimeline.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@juliusmarminge
juliusmarminge force-pushed the fix/thread-return-scroll branch from 8f5504b to 26d7aac Compare November 19, 2026 01:44
@juliusmarminge

Copy link
Copy Markdown
Member

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.

@juliusmarminge juliusmarminge added takeover:blocked Takeover blocked; reason in the PR body and removed takeover:in-progress A takeover lead is working on this PR labels Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). takeover:blocked Takeover blocked; reason in the PR body vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Returning to a thread that finished while you were away scrolls through its new work

2 participants