Rendering a million-line diff is the easy part. 👀
Comments are what break it. Their height depends on markdown wrapping, expanded details, open reply boxes, and images still loading (none of which you know until you render).
Here's how we rebuilt the PR view in the GitHub Copilot app 🧵
Oct 12, 2026 · 6:06 PM UTC
For the first design, we gave every dynamic block a ResizeObserver that wrote measured heights back into the layout.
We built it, then rejected it. An observer that writes a height back into the layout it’s watching can retrigger itself, and the cost grows with every mounted block.
What we shipped is a recurring measurement pass, gated on idle and scoped to roughly 2400px around the viewport. Mounted blocks are ground truth. Observers normally only flag a block for the pass. They don’t write heights themselves.
There’s one exception: a visible block resizing because of the user’s action can apply one synchronous correction before paint. That keeps the comment and code below it moving together without reopening the feedback loop.
One bug that held us back was “don’t correct while you’re scrolling.” It was a timestamp guard, and our own programmatic scrolls refreshed it.
Toggle the sidebar, and the diff pane changes width. Wrapped lines reflow, and the surface emits a small scroll as it settles. The guard read that as your input and skipped the correction meant to keep your place. The file you were reading drifted off screen.
Open the worst pull request you’ve got and try it out 👇
github.blog/engineering/user…

XYO@OfficialXYOOct 14
United States
United StatesConnected via WebAccount-level information, not a live location or per-post device.
Even the comment box gets an engineering origin story.
pierre.computer/writing/on-r…
I don't think rendering a million line diff was that easy...

Anthony Mongeluzo@PCS_AnthonyMOct 12
United States!
United StatesConnected via United States App StoreLocation may be affected by a proxy or VPN.Account-level information, not a live location or per-post device.
Rendering a million-line diff is the easy part; comments with unpredictable height are what usually break it. Splitting code rows and comments into two height domains is clever engineering.

Kiran Kumar G@imkirankumargOct 13
India
IndiaConnected via India Android AppAccount-level information, not a live location or per-post device.
comments breaking layout is so true, you can't know their height until everything finishes rendering



























