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
Clicking Scroll to end queues the scroll for the next animation frame. The timeline list is shared between conversations, so switching to another chat before that frame ran scrolled the newly opened chat to its latest message, and the reader lost their place. The queued frame now does nothing if the visible conversation has changed since the click, and the scenario checks that the restored reading position stays within a few pixels.
Commit 2a89bf9680 (main). The first conversation jumps to its latest message. Expected: The first conversation stays at the older messages you were reading.
Scroll up in a long conversation.
Open a second long conversation.
Scroll up in the second conversation.
Click Scroll to end.
Switch back to the first conversation before the scroll runs.
The cause is at apps/web/src/components/chat/useTimelineFollow.ts:315. Ran pnpm scenarios:prove scripts/scenarios/scroll-to-end-stays-with-its-thread.e2e.ts --target web with the repro scenario added: it failed in 2 of 2 runs on a clean checkout, with expected 0 to be greater than 100 in the output.
Evidence
Environment: The web app in Chromium on Linux x64, a fresh checkout.
e76e696208 adds the failing test, alone, before the fix.
pnpm exec vp run check:changed 30351f789f4f0a6c6556eeb15ff1c950c32a83a1 passed on head.
Not in this change
A scroll to end that has already started and settles after a switch only keeps adjusting while the new conversation is following its end. Its target is then that conversation's own end, so no extra visit check was added there.
The anchor size-change restore frame in useTimelineFollow also outlives a thread switch. It only scrolls when the offset still matches, so it is left unchanged.
Mobile has its own timeline follow logic and is not covered by this repro.
Who did the work
Repro written by GPT 6.2 Sol, in Codex
Duplicate check judged by Claude Opus 5.5, in Claude Code
Written by Claude Opus 5.5, in Claude Code
Reviewed by Claude Opus 5.5, in Claude Code, and by GPT 6.2 Sol, in Codex
Reproduction, checks and proof run by a program on base and head, not by an agent
Made in T3 Code by Claude Opus 5.5 and GPT 6.2 Sol
Macroscope's review found this PR approvable — The change prevents a delayed scroll-to-end action from scrolling another conversation after navigation. Its effects are limited to timeline positioning, with no product-default or persistent-data changes.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 10e7bdc and ff0a0ac.
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
The timeline follow hook now skips a deferred scroll if the current visit has changed. A browser end-to-end test delays animation frames and checks that returning to a conversation preserves its reading position.
Changes: Timeline follow
Layer / File(s)
Summary
Deferred scroll guard and regression test apps/web/src/components/chat/useTimelineFollow.ts, scripts/scenarios/scroll-to-end-stays-with-its-thread.e2e.ts
The hook reads the current visit before a deferred scroll and skips scrolling if the visit changed or the list is unavailable. The browser test delays animation frames while switching conversations, then checks that the restored distance from the end remains above 100 pixels and changes by less than 4 pixels.
This change stops a queued "Scroll to end" from scrolling a different conversation after the reader switches threads. The change is small, covered by a new browser regression test, and I found no concrete defects. Merge risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the primary change: a scroll-to-end action no longer scrolls a different conversation to its end. The raw summary confirms the queued animation-frame callback now skips when the visit …
Description check
The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section explains the shared timeline list race with reproduction steps. The Change section explains…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the primary change: a scroll-to-end action no longer scrolls a different conversation to its end. The raw summary confirms the queued animation-frame callback now skips when the visit has changed. The title is specific and follows the conventional commit style that the template recommends. It does not cover the scenario test, but it does not need to.
Full details: Description check
Explanation
The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section explains the shared timeline list race with reproduction steps. The Change section explains the visit check in the queued frame. The Scope section links related issues and explains the limits of the change. The Verification section gives the failing and passing runs, before and after tables, commit references, and the check command. It also states the excluded areas and the authorship. The Scope section does not explain why no issue is linked. The author links related issues (#45206, #36193, and others), but it is unclear whether one of them shows the bug itself. The description also lists the scenario checks, but the Verification section does not state the observed result of the full repo check beyond a pass. Those gaps are minor.
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; 0 remain after this review.
Real web app, scenario runner’s Chromium browser, Linux, 1280×800, light theme; independent fresh databases seeded through t3.project/t3.thread using the recorded Replay (dev) multi-turn provider. App code ran from separate exact-commit worktrees. Inspected all screenshots and recording contact sheets.
Seed two conversations with ten completed Replay (dev) turns each. Open A, focus the composer and press PageUp once; open B and press PageUp twice. Switch A → B → A → B through the sidebar and confirm both saved positions restore. At the start of one animation frame, click B’s Scroll to end and A’s sidebar row synchronously in the same task, before the queued next frame. Wait 90 frames and capture A. The base jumps from 572px above the end to 0px and loses Scroll to end; the head retains the earlier reading position and the button.
Scenario: Scroll to end queued in B preserves A's reading position
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:L100-499 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or 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.
Clicking Scroll to end queues the scroll for the next animation frame. The timeline list is shared between conversations, so switching to another chat before that frame ran scrolled the newly opened chat to its latest message, and the reader lost their place. The queued frame now does nothing if the visible conversation has changed since the click, and the scenario checks that the restored reading position stays within a few pixels.
Related: #45206, #36193, #38503, #21564, #38228, #42601
Reproduction on main
Commit 2a89bf9680 (main). The first conversation jumps to its latest message. Expected: The first conversation stays at the older messages you were reading.
The cause is at
apps/web/src/components/chat/useTimelineFollow.ts:315. Ranpnpm scenarios:prove scripts/scenarios/scroll-to-end-stays-with-its-thread.e2e.ts --target webwith the repro scenario added: it failed in 2 of 2 runs on a clean checkout, withexpected 0 to be greater than 100in the output.Evidence
Environment: The web app in Chromium on Linux x64, a fresh checkout.
Proven: the repro fails at the test commit e76e696208 and passes on the head 10e7bdc357, both on main 30351f789f.
The first conversation jumps to its latest message.
The first conversation stays at the older messages you were reading.
Tests
pnpm exec vp run check:changed 30351f789f4f0a6c6556eeb15ff1c950c32a83a1passed on head.Not in this change
Who did the work
Made in T3 Code by Claude Opus 5.5 and GPT 6.2 Sol