Large diffs need different layout rules for code and comments
GitHub’s pull-request renderer separates predictable code-row heights from comments whose size changes as text wraps, images load or reply boxes open. It keeps exact code geometry alongside a separate index of estimated and measured comment heights. Stable anchors and cached measurements let the interface correct layout without rebuilding every code row when a single discussion changes size.
GitHub · Sep 23, 2026
Why it matters
The same layout problem appears in logs, document editors and feeds that mix fixed and variable-height content.
More context
This card covers the article’s virtualization design. Compare your own scroll jumps with its separation of fixed rows and dynamic blocks; GitHub exercised the renderer with a million-line pull request.
Keep in mind
This is GitHub’s implementation report, not a reusable library or an independently reproduced benchmark. Rendering a huge change smoothly does not make it easy to review.
Original read