GitHub says its rebuilt Copilot app can open a test pull request spanning 2,200 files, more than a million changed lines and more than 400 inline review comments. The key, principal design engineer Alberto Gimeno explained, was to stop treating code and comments as a single list of rows whose heights all had to be measured.
At a given font size, the viewer knows how tall a line of code will be, so it can calculate the space the code needs in advance. Comments are less predictable: Markdown wraps differently as the window changes width, images grow into place as they load, and reply editors get taller as reviewers type. The new layout adds the measured heights of these changing blocks to the known height of the code, plus padding for scrolling.
Keeping the reader’s place
The viewer identifies each dynamic block by its file, line and side of the diff rather than by its pixel position. It tracks the block’s content, expansion state and the width at which it was measured. When the browser is idle, it measures mounted blocks in batches, looking only about 2,400 pixels beyond the viewport in either direction. If a height needs correcting, the viewer anchors the adjustment to the content the reviewer is reading rather than fighting an active scroll.
An earlier design gave each block a ResizeObserver that wrote its measured height straight back into the layout. That created a feedback loop: a measurement triggered a layout change, which could prompt another measurement. The cost grew as more blocks were mounted. In the shipped design, observers usually just flag a block for remeasurement. Direct interactions are an exception: when a reviewer opens a reply editor, for example, the code below it moves in the same frame.
Testing for regressions
GitHub uses a synthetic, oversized pull request to check the viewer against a performance budget in continuous integration. Built-in probes check that the layout behaves as expected. A separate automated routine drives the actual desktop app through cold and warm starts and saves logs that an agent can inspect for regressions.
The work builds on an April 2026 optimization to the separate Files changed view on github.com. That team reported that a unified diff had previously required about eight React components and ten DOM elements per line; it cut both counts by roughly half.
Opening a large change and making it manageable for a human reviewer are different problems. GitHub’s stacked pull requests, which entered public preview on July 30, 2026, address the latter by breaking up large changes. The Copilot team’s million-line test checks the viewer’s performance, not a reviewer’s ability to assess that much code.