Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): reduce chat timeline scroll twitching and overlap #1054

Closedhuxcrux(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromrefs/pull/1054/headopened View on GitHub

What Changed

This PR reduces chat timeline scroll twitching and overlap.

Smaller and medium-sized threads now render without virtualization, which removes the late row mounting and remeasurement that were causing visible jumps while scrolling upward. Larger threads still use the standard virtualized path.

The remaining row height estimation is kept only for the cases that still need it:

grouped work/tool rows assistant messages with changed-files summaries

Fixes #1035 Related to #988, #905, #860

Why

Older rows were being mounted and resized after entering view, which caused the timeline to twitch while scrolling and sometimes contributed to overlap.

Disabling virtualization for the thread sizes users hit most often is the simplest and most reliable fix. It removes the unstable behavior directly while still keeping virtualization for larger threads.

UI Changes

This PR improves chat scroll stability and removes visible upward-scroll twitching in affected threads.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Improve timeline scroll stability with accurate row height estimation

  • Disables virtualization for short timelines (below MIN_ROWS_TO_ENABLE_VIRTUALIZATION) to avoid measurement overhead when it isn't needed.
  • Adds estimateTimelineWorkGroupHeight in timelineHeight.ts to size work-group rows based on visible entries, chip wrapping, and expansion state.
  • Adds estimateChangedFilesSummaryHeight and estimateTimelineRowHeight in MessagesTimeline.tsx to account for completion dividers and changed-files summaries in assistant message rows.
  • Adds countVisibleTurnDiffTreeNodes in turnDiffTree.ts to compute visible diff-tree node counts based on directory expansion state.
  • Behavioral Change: shouldAdjustScrollPositionOnItemSizeChange now triggers when remaining scroll distance is ≤ AUTO_SCROLL_BOTTOM_THRESHOLD_PX (previously only when greater), fixing auto-scroll near the bottom.
Macroscope summarized 0b7ecce.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: d90f1782-ff94-4231-b455-fced3f53d4b3

      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
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Post copyable unit tests in a comment
      📝 Coding Plan
      • Generate coding plan for human review comments

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. huxcrux(GitHub profile, opens in a new tab) changed the title

    4. juliusmarminge reviewed

      i think the actual fix is to do better, more accurate, estimations and having regression tests (ChatView.browser.tsx) to verify estimate === actual ? I've fixed it couple times but when new UI changes are made and we don't update the estimates it regresses. Need tests to ensure it stays in sync.

    5. i think the actual fix is to do better, more accurate, estimations and having regression tests (ChatView.browser.tsx) to verify estimate === actual ? I've fixed it couple times but when new UI changes are made and we don't update the estimates it regresses. Need tests to ensure it stays in sync.

      I created https://github.com/pingdotgg/t3code/pull/1093 to fix the estimation, and is working on another PR implementing tests to avoid this from happening again in the future.

Sign in to join this conversation.