Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Scrolling inside one expanded PR diff rewrites unchanged lines and stutters on Windows #48019 (GitHub #48018)

Closedchristso(GitHub profile, opens in a new tab) opened this issue 0 comments

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Open a pull request in T3 Code and select Code. My repro had eight files, with 229 additions and 127 deletions.
  2. Collapse all files, then expand one file large enough to scroll for several screenfuls. I used a TypeScript file with 176 additions and 126 deletions.
  3. Scroll with the mouse wheel while staying inside that file. The slowdown happens without crossing a file header.
  4. Open the same diff on GitHub and scroll through the same section to compare.

Expected behavior

The diff scrolls smoothly and the pointer stays responsive across windows. Lines that remain visible with identical syntax highlighting should keep their existing DOM nodes.

Actual behavior

On Windows, the pointer stutters even over other windows while I scroll the diff in T3. At times, movement on screen appears to trail my input by several seconds. The same diff feels smooth on GitHub.

I profiled the PR Code tab and found that @pierre/diffs repeatedly assigns innerHTML to visible lines whose markup already matches. In a Windows wheel-scroll benchmark, checking the live markup before assigning it avoided 1,944 writes per 1,600-pixel scroll.

I tested that condition in the browser on T3 0.1.13. Each pass delivered 40 wheel events of 40 pixels each. I excluded the first pair because the baseline stopped 79 pixels short. All six remaining pairs covered the same distance. Median Chromium renderer task time fell from 1,306 ms to 793 ms (39%).

Renderer task time per pass (ms)Pair 1Pair 2Pair 3Pair 4Pair 5Pair 6
Stock behavior1,3571,2541,4441,1001,4221,254
Skip matching writes778886736814786800

These measurements come from headless Edge. They confirm redundant rendering work on Windows. I haven’t verified whether skipping those writes resolves the physical pointer lag.

The earlier report measured scrolling past collapsed file headers. Its closing comment identified the tooltip fix and invited a follow-up for the remaining scrolling cost. This repro stays inside one expanded file. Closing comment on #42438

Impact

Major degradation or frequent failure

Version or commit

T3 Code 0.1.13

Environment

Windows 11, Dell XPS 15. Renderer benchmark used the hosted T3 web app in Microsoft Edge 157.0.4341.60, headless, at 1280 × 800.

Logs or stack traces

applyHunksToDOM → replaceCodeColumns → writeColumn → reconcile → innerHTML setter

Workaround

Review the same PR in GitHub’s Files changed view.

  1. tanstack-source added labelsbug

  2. juliusmarminge closed this

Sign in to join this conversation.