fix(web): recover timeline following and bottom navigation #15859
main fromrefs/pull/15859/head·opened View on GitHubProblem#
A timeline can fall away from its latest answer while automatic-follow intent remains armed. The original onIsAtEndChange guard hides the scroll-to-end button in that state, leaving no recovery affordance. New-turn framing also keeps a text-only answer anchored at the prompt after it grows beyond the space above the composer.
Change#
Drive the recovery button from measured end position independently of follow intent. Keep the brief settling delay, but do not restart it on every streaming/layout report. Report end position after row and viewport size changes as well as scroll events. When a followed anchored turn outgrows the usable viewport, release its anchor and resume following the end; invalidate pending anchor positioning so it cannot pull the viewport back afterward. Manual navigation continues to opt out of follow.
This change applies to the shared web/desktop timeline and all providers rendered there. Native mobile scrolling is unchanged.
Scope and approval#
Related to the maintainer-triaged missing-recovery-button bug #12372 and the viewport-position report #5903. Additional user report, synthetic evidence, and scope request.
This PR was opened before checking the existing report. The earlier obvious-bug-exception rationale is withdrawn. The existing issue's triage does not approve every behavior proposed here, especially releasing long-answer anchors. Maintainer review is requested on whether to narrow this PR to recovery-button reconciliation and handle following behavior separately. The synthetic checks do not establish the cause of all spontaneous upward jumps. No approval of this implementation is claimed.
Verification#
pnpm exec vp test run apps/web/src/components/chat/timelineEndAffordance.test.ts apps/web/src/components/chat/timelineScrollAnchoring.test.tsx apps/web/src/components/chat/MessagesTimeline.test.tsx apps/web/src/components/ChatView.logic.test.ts: 232 tests passed. New tests cover sustained off-end reports, transient settling, immediate hiding/reappearance, and cancellation. Existing geometry tests cover anchored-turn viewport overflow.pnpm --filter @t3tools/web typecheck: passed.- Targeted
vp lint: no errors; existing React compiler/dependency warnings in the surrounding ChatView and timeline components. - Browser panel, isolated dev database, synthetic six-turn conversation: on the original code, set the viewport to the top without a manual wheel/key opt-out to simulate a stalled follow. Measured a 2,800px end gap and no return button. With this change, the same state exposes the button; clicking it reaches a 0px end gap and hides the button.
- Exercised anchor-ready/size-change callbacks against measured long-turn fixture geometry in the browser. The overflow path returns to the end and the delayed anchor-positioning callback does not pull it back. This is a synthetic layout check, not a live provider streaming run. Native mobile was not tested.
Before (off-end, recovery hidden):

After (same position, recovery available):

Recording: recovery button returns to the end
Implemented with GPT-6.1-Sol through the Codex harness in T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
- Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
- Review profile: CHILL
- Plan: Advanced
- Run ID:
af30cdb8-a0bc-46bc-ad6c-e40a83a1c90a
📥 Commits
Reviewing files that changed from the base of the PR and between 1e2ecbd9758830669684b494d4398f626b0576e0 and 24c90c42bc4e27729f032a95e2b525cc10cd7e5c.
📒 Files selected for processing (4)
apps/web/src/components/ChatView.tsxapps/web/src/components/chat/MessagesTimeline.tsxapps/web/src/components/chat/timelineEndAffordance.test.tsapps/web/src/components/chat/timelineEndAffordance.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
📝 Walkthrough
Walkthrough#
The timeline now reports its end state after overflow measurement. ChatView uses those reports to control the delayed scroll-to-end affordance and adjusts anchor handling when content grows during live-follow.
Changes#
Timeline end-state handling
Layer / File(s) Summary Timeline reporting and delayed affordance
apps/web/src/components/chat/MessagesTimeline.tsx,apps/web/src/components/chat/timelineEndAffordance.ts,apps/web/src/components/chat/timelineEndAffordance.test.tsMessagesTimeline reports a resolvable end state after scheduled overflow measurement, except during thread-position restoration, citation positioning, or when its data is not the current rows. The new controller hides the affordance when the timeline is at the end and schedules it to appear after 150 ms when the timeline is away from the end. Tests cover repeated reports, returning to the end, and cancellation. ChatView integration and anchor handling
apps/web/src/components/ChatView.tsxChatView routes end-state reports through the new controller. During live-follow, it scrolls to the end when the positioned anchor’s content overflows the usable viewport. After navigation, it retains guarded scroll-offset restoration. scrollToEndclears the positioned and settled anchor refs.Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)#
sequenceDiagram participant MessagesTimeline participant ChatView participant TimelineEndAffordance MessagesTimeline->>ChatView: Report resolvable end state ChatView->>TimelineEndAffordance: Report whether timeline is at end TimelineEndAffordance->>ChatView: Update affordance visibility immediately or after delaySuggested reviewers:
maria-rcksMerge Risk: ⚪ Minimal · up to
24c90No actionable merge-blocking issue remains in the reviewed timeline changes; merge after normal checks.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
Check name Status Explanation Resolution Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold. ✅ Passed checks (4 passed)
Check name Status Explanation Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. Title check ✅ Passed The title clearly summarizes the main change: restoring timeline follow behavior and bottom-navigation recovery. Description check ✅ Passed The description covers the required Problem, Change, Scope and approval, and Verification sections. It gives focused test results and states limitations. It also clearly says maintainer approval for t… - Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create a new PR
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment `@coderabbitai help` to get the list of available commands.Note
This comment is posted by Julius' dot
The recovery-button fix addresses #12372, but this also releases long-answer prompt anchors and resumes following, changing viewport behavior independently. The maintainer's triage of #12372 explicitly separates missing recovery from the stranded viewport in #5903, and the PR acknowledges that the anchor behavior lacks scope approval. Under one problem and prior approval, please narrow this PR to recovery-button reconciliation and discuss the anchor/following change separately with maintainers. Closing this combined submission; the reproduced recovery defect and its supplied evidence remain useful for a focused replacement.
juliusmarminge closed this
Sign in to join this conversation.
Approvability#
Verdict: Approved at
24c90c4Macroscope's review found this PR approvable — This is a localized web timeline bug fix that restores the existing return-to-end affordance and prevents oversized streamed turns from remaining hidden beneath the composer. The new timing and geometry logic is small, isolated, and covered by targeted tests, with no schema, deployment, or sensitive-area impact.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).