Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): live reasoning stays scrolled to the newest text while it streams #19334

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/19334/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

When 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

  • WorkLogDetails takes a followLive prop. 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 onScroll handler records whether the reader is within 4px of the end. Scrolling up pauses following. Scrolling back to the end resumes it.
  • ReasoningTraceContent turns followLive on while any of its entries is streaming. It uses the same check that already sets isStreaming on 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. On main, 2 of 3 fail. With the fix, 3 of 3 pass.
  • MessagesTimeline.test.tsx passes. Lint on the changed files adds no warnings. The apps/web typecheck 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

    2. juliusmarminge added labelsmacroscope-review

    3. Approvability

      Verdict: Approved at ed8f41b

      Macroscope'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).
    4. Review in Change Stack →

      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.tsx
      • apps/web/src/components/chat/WorkLog.test.tsx
      • apps/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.tsx
      WorkLogDetails adds an optional followLive prop, which defaults to false. 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.tsx
      ReasoningTraceContent uses one streaming predicate for WorkLogDetails.followLive and each entry’s ChatMarkdown.isStreaming prop.

      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: Passed 3 · Failed 1
      Failed Failed checks: 1 warning
      Check nameStatusExplanationResolution
      Description checkWarningThe 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 Passed checks: 3 passed
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the primary change: keeping live reasoning scrolled to the newest text.
      Linked Issues checkPassedThe active directly linked issue is #16201. It requires the live reasoning view to keep the newest streamed text visible without manual scrolling. ReasoningTraceContent now passes followLive when …
      Out of Scope Changes checkPassedThe 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

      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.

      Comment `@coderabbitai help` to get the list of available commands.
    5. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB+7 B (+0.1%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB+7 B (+0.6%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages110 (0.0%)8✅

      Baseline: d10621d · PR result: ed8f41b · Source CI: success

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

Sign in to join this conversation.