fix(web): live reasoning stays scrolled to the newest text while it streams #19334
main fromrefs/pull/19334/head·merged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubWhen a Thought row is expanded during a live turn, the reasoning trace sits in a box capped at 24rem. Nothing kept that box scrolled to the end, so new reasoning appeared below the visible area and you had to scroll by hand to read it. This affects every provider, not just OpenCode, because all reasoning goes through the same ReasoningTraceContent path.
Fix#
WorkLogDetailstakes afollowLiveprop. While it is on, a layout effect pins the scroller to the end before paint, so each streamed chunk is visible with no jump. No smooth scroll and no animation.- An
onScrollhandler records whether the reader is within 4px of the end. Scrolling up pauses following. Scrolling back to the end resumes it. ReasoningTraceContentturnsfollowLiveon while any of its entries is streaming. It uses the same check that already setsisStreamingon each entry. This covers both the expanded single reasoning row and the reasoning-only group.- When the trace is not streaming, nothing changes: the effect does no layout reads, and the panel and media details do not use
followLive.
What you see now: when you expand a live trace, it opens at the newest text and stays there as reasoning streams. If you scroll up inside the trace, it stays where you put it. If you scroll back to the bottom, it follows again. No screen capture was made, because this change was made without a browser.
Proof#
- New
apps/web/src/components/chat/WorkLog.test.tsx(jsdom, simulated scroll geometry). It covers three cases: it follows as text streams, it pauses when you scroll up and resumes at the end, and it leaves a trace that is not streaming alone. Onmain, 2 of 3 fail. With the fix, 3 of 3 pass. MessagesTimeline.test.tsxpasses. Lint on the changed files adds no warnings. Theapps/webtypecheck is clean.
Mobile has the same capped reasoning ScrollView (apps/mobile/src/features/threads/thread-work-log.tsx) without follow. That is out of scope here.
The diagnosis in #16225 helped. This PR has its own implementation.
Fixes #16201
Reviewed with sol-loop: 1 round with GPT-6.1-Sol.
Model and harness: Claude Opus 5.5 in Claude Code via T3 Code.
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
juliusmarminge added labelsmacroscope-review
Approvability#
Verdict: Approved at
ed8f41bMacroscope's review found this PR approvable — This is a small, self-contained web UI bug fix that adds live-edge scrolling only for expanded reasoning traces while preserving existing behavior for other work-log detail types. The new behavior is covered by focused jsdom tests and introduces no schema, infrastructure, security, billing, or configuration changes.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
7676a214-4c46-4798-be7a-556ab2f7538d
📥 Commits
-
Reviewing files that changed from the base of the PR and between d10621de5f8f7e3af4831be04c0564a4ae65eade and ed8f41b78db1ccadb50b5a7947704cf28833eeee.
📒 Files selected for processing: 3
-
apps/web/src/components/chat/MessagesTimeline.tsxapps/web/src/components/chat/WorkLog.test.tsxapps/web/src/components/chat/WorkLog.tsx
Limit details: You’ve used all 10 included reviews currently available. Your 21 included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.
-
📝 Walkthrough
-
WorkLogDetails now supports optional scroll following during streamed updates. ReasoningTraceContent enables it when a reasoning entry is streaming. The details stop following when the reader scrolls away from the bottom and resume when the reader returns.
Changes: Live reasoning scroll follow
Layer / File(s) Summary Add live-edge following to WorkLogDetails
apps/web/src/components/chat/WorkLog.tsx,apps/web/src/components/chat/WorkLog.test.tsxWorkLogDetails adds an optional followLiveprop, which defaults tofalse. When enabled, it scrolls to the bottom during updates while the reader remains within 4 px of the bottom. Tests cover following, pausing, resuming, and disabled behavior.Enable following for streaming reasoning
apps/web/src/components/chat/MessagesTimeline.tsxReasoningTraceContent uses one streaming predicate for WorkLogDetails.followLiveand each entry’sChatMarkdown.isStreamingprop.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
maria-rcks
Merge Risk: ⚪ Minimal · up to
ed8f4-
Live reasoning should follow incoming text while the reader remains near the bottom. No actionable merge-blocking risk was identified.
Pre-merge checks:
3 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Description check The description explains the problem, implementation, affected scope, tests, and known limitations. However, it does not provide the required scope and approval information, and it does not include th… Add a Scope and approval section with the linked issue and explicit maintainer approval, or explain why this focused fix qualifies for an exemption. Add before-and-after UI screenshots, and a short recording if needed to demonstrate the str… Passed checks: 3 passed-
Check name Status Explanation Title check The title clearly and concisely describes the primary change: keeping live reasoning scrolled to the newest text. Linked Issues check The active directly linked issue is #16201. It requires the live reasoning view to keep the newest streamed text visible without manual scrolling.ReasoningTraceContentnow passesfollowLivewhen …Out of Scope Changes check The changes stay within the live reasoning scroll objective. The shared predicate is reused for ChatMarkdown.isStreaming. The new tests verify the new behavior. The optional prop defaults to false, …
Full details: Description check
-
Explanation
The description explains the problem, implementation, affected scope, tests, and known limitations. However, it does not provide the required scope and approval information, and it does not include the required UI screenshots or explain an approved exception.
Resolution
Add a Scope and approval section with the linked issue and explicit maintainer approval, or explain why this focused fix qualifies for an exemption. Add before-and-after UI screenshots, and a short recording if needed to demonstrate the streaming scroll behavior, or document the approved exception.
-
- Fix all pre-merge checks with AI
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Usage-based review receipt#
- Mode: Continue automatically
- Reviewed files: 3
- Charged: $0.75
- View usage details
Comment `@coderabbitai help` to get the list of available commands.Note
This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.
-
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 5.0 KiB +7 B (+0.1%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB +7 B (+0.6%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 0 (0.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅ Claude Live turn messages 1 1 0 (0.0%) 8 ✅ Baseline:
d10621d· PR result:ed8f41b· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes