<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/rendering-huge-pull-requests-in-the-github-copilot-app-z4andgcgu" -->

---
title: Rendering huge pull requests in the GitHub Copilot app
description: An engineering deep-dive describes how the GitHub Copilot app's pull request view was rebuilt to handle a real-world pull request with 2,200 files, over a...
canonical: https://daily.dev/posts/rendering-huge-pull-requests-in-the-github-copilot-app-z4andgcgu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Rendering huge pull requests in the GitHub Copilot app | daily.dev
og:description: An engineering deep-dive describes how the GitHub Copilot app's pull request view was rebuilt to handle a real-world pull request with 2,200 files, over a...
og:url: https://daily.dev/posts/rendering-huge-pull-requests-in-the-github-copilot-app-z4andgcgu
og:image: https://api.daily.dev/og/posts/Z4AndgcGu.png
og:image:alt: Rendering huge pull requests in the GitHub Copilot app
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Rendering huge pull requests in the GitHub Copilot app

**[GitHub Blog](https://daily.dev/sources/ghblog)** · 16 min read · 4 upvotes · 3 comments

## Summary

An engineering deep-dive describes how the GitHub Copilot app's pull request view was rebuilt to handle a real-world pull request with 2,200 files, over a million changed lines, and 400+ inline comments. The core challenge was that code diffs have deterministic, known-in-advance row heights (enabling simple virtualization), while review comments have unpredictable heights depending on markdown wrapping, expandable sections, reply composers, and loading images. The solution splits geometry into two domains: deterministic code height and dynamically measured comment block height, each tracked separately. A carefully scoped, idle- and scroll-gated measurement scheduler replaces a naive per-block ResizeObserver approach that caused feedback loops. Scroll-anchoring logic corrects layout shifts by identity rather than pixel position to avoid jarring scroll jumps. The piece also covers data-pipeline choices (streaming structure before content, deferring highlighting, caching recent diffs) and an autonomous 'change → measure → improve' testing loop using headless probes and an autopilot that drives the real app to catch regressions via structured health signals rather than manual inspection.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://github.blog/engineering/user-experience/rendering-huge-pull-requests-in-the-github-copilot-app>

## Questions this post answers

### How do you virtualize a list with rows of unknown, dynamic height, like comments in a code review UI?

Split the layout into two independent geometries: deterministic content (like code rows) with exact, prefix-summed heights computed up front, and dynamic content (like comments) with estimated heights that get measured lazily. Dynamic blocks are identified by stable keys tied to file/line/side rather than pixel position, with fingerprints tracking what could change their height, so a resize never forces a rebuild of the deterministic geometry.

_For teams building complex virtualized UIs, daily.dev surfaces engineering deep-dives like this one on layout strategy._

### Why does using one ResizeObserver per element in a virtualized list cause performance problems?

An observer that writes a measured height back into the layout of the element it watches can retrigger itself, creating a feedback loop whose cost grows with every mounted element. The fix is a single idle- and scroll-gated measurement pass that reads all mounted candidates in one batch reflow, while the ResizeObserver only flags blocks for re-reading rather than writing heights directly, except for one synchronous same-frame correction for user-caused resizes.

_Engineers debugging virtualization jank can find implementation patterns like this via daily.dev._

### How do you prevent a viewport scroll jump when a dynamically measured element's height changes during scrolling?

Correct by identity rather than pixel position: capture what the user is anchored to (a specific row or block plus offset within it) before applying height updates, apply the deltas, resolve that same anchor to its new pixel position, then scroll to keep the anchor in place. Rules also skip correction for off-screen content below the viewport and suppress it for blocks the user directly interacted with.

_Developers fighting scroll-jump bugs in dynamic lists can track solutions like this through daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@trevorsuna** · 0 upvotes

> Separating deterministic code height from measured comment height is a clean way to keep virtualization predictable. Identity-based scroll anchoring is equally important: large reviews become unusable if late image loads or expanded threads move the reader. Structured health probes sound much more durable than screenshot-only regression tests here.

**@nark3d** · 0 upvotes

> I've hit that exact problem.  Comments grow sideways as well as down, because a quoted diff inside a reply composer wraps to the width of the thread it's nested in, so the measured height is only valid for the width it was taken at.  Track the width the measurement was taken at alongside the height and remeasure on column resize rather than only on content change.  Knowing which heights are fixed in advance and which aren't is most of the battle.  Scroll anchoring by identity keeps the viewport steady when a stale height is corrected, so the fix shows up as a smooth adjustment rather than a...

**@pdfopsdev** · 0 upvotes

> the anchor-by-identity-not-pixel-position trick is the same fix react-window/react-virtual users end up hand-rolling when items resize above the viewport. surprised more virtualization libs don't ship it as a first-class option instead of everyone reinventing it per app.

## Similar posts on daily.dev

- [Copilot code review: Comment experience improvements](https://daily.dev/posts/copilot-code-review-comment-experience-improvements-k5clhdhrn) · GitHub Changelog · 0 upvotes · 0 comments
- [The uphill climb of making diff lines performant](https://daily.dev/posts/the-uphill-climb-of-making-diff-lines-performant-dmkgp6vib) · GitHub Blog · 0 upvotes · 0 comments
- [GitHub adds Stacked PRs to speed complex code reviews](https://daily.dev/posts/github-adds-stacked-prs-to-speed-complex-code-reviews-ufanab95z) · InfoWorld · 0 upvotes · 0 comments

---

Tags: [#github](https://daily.dev/tags/github), [#infrastructure](https://daily.dev/tags/infrastructure)

[View this post on daily.dev](https://daily.dev/posts/rendering-huge-pull-requests-in-the-github-copilot-app-z4andgcgu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Rendering huge pull requests in the GitHub Copilot app","url":"https://daily.dev/posts/rendering-huge-pull-requests-in-the-github-copilot-app-z4andgcgu","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/rendering-huge-pull-requests-in-the-github-copilot-app-z4andgcgu"},"datePublished":"2026-09-23T18:30:07.767Z","dateModified":"2026-09-23T18:31:32.777Z","description":"An engineering deep-dive describes how the GitHub Copilot app's pull request view was rebuilt to handle a real-world pull request with 2,200 files, over a...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bab984d74b7473c9d004058f6ff917cc?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bab984d74b7473c9d004058f6ff917cc?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"GitHub Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"GitHub Blog","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/106cf162b88840808484d4b5429b59b1","url":"https://daily.dev/sources/ghblog"},"commentCount":3,"discussionUrl":"https://daily.dev/posts/rendering-huge-pull-requests-in-the-github-copilot-app-z4andgcgu","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":3}],"keywords":"github,infrastructure","timeRequired":"PT16M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"GitHub Blog","item":"https://daily.dev/sources/ghblog"},{"@type":"ListItem","position":3,"name":"Rendering huge pull requests in the GitHub Copilot app"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/rendering-huge-pull-requests-in-the-github-copilot-app-z4andgcgu","comment":[{"@type":"Comment","text":"Separating deterministic code height from measured comment height is a clean way to keep virtualization predictable. Identity-based scroll anchoring is equally important: large reviews become unusable if late image loads or expanded threads move the reader. Structured health probes sound much more durable than screenshot-only regression tests here.","datePublished":"2026-09-28T01:58:15.625Z","url":"https://daily.dev/posts/Z4AndgcGu#c-rbGmlbI7Y","author":{"@type":"Person","name":"Trevor Suna","url":"https://daily.dev/trevorsuna","image":"https://media.daily.dev/image/upload/s--dZ7gXxpp--/f_auto/v1784081551/avatars/avatar_EMoP47rpuw8DNjhp6R1b6?_a=BAMAMicg0"}},{"@type":"Comment","text":"I’ve hit that exact problem.  Comments grow sideways as well as down, because a quoted diff inside a reply composer wraps to the width of the thread it’s nested in, so the measured height is only valid for the width it was taken at.  Track the width the measurement was taken at alongside the height and remeasure on column resize rather than only on content change.  Knowing which heights are fixed in advance and which aren’t is most of the battle.  Scroll anchoring by identity keeps the viewport steady when a stale height is corrected, so the fix shows up as a smooth adjustment rather than a jump.","datePublished":"2026-09-30T16:29:15.578Z","url":"https://daily.dev/posts/Z4AndgcGu#c-KwCqyMnfT","author":{"@type":"Person","name":"Adam","url":"https://daily.dev/nark3d","image":"https://avatars.githubusercontent.com/u/2162621?v=4"}},{"@type":"Comment","text":"the anchor-by-identity-not-pixel-position trick is the same fix react-window/react-virtual users end up hand-rolling when items resize above the viewport. surprised more virtualization libs don’t ship it as a first-class option instead of everyone reinventing it per app.","datePublished":"2026-09-24T18:07:50.074Z","url":"https://daily.dev/posts/Z4AndgcGu#c-tbsKqqDuq","author":{"@type":"Person","name":"PDFops","url":"https://daily.dev/pdfopsdev","image":"https://media.daily.dev/image/upload/s---8isRBKc--/f_auto/v1782922291/avatars/avatar_orjMeK8QKaaVZwGq7ScPz?_a=BAMAMicg0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/rendering-huge-pull-requests-in-the-github-copilot-app-z4andgcgu#faq","mainEntity":[{"@type":"Question","name":"How do you virtualize a list with rows of unknown, dynamic height, like comments in a code review UI?","acceptedAnswer":{"@type":"Answer","text":"Split the layout into two independent geometries: deterministic content (like code rows) with exact, prefix-summed heights computed up front, and dynamic content (like comments) with estimated heights that get measured lazily. Dynamic blocks are identified by stable keys tied to file/line/side rather than pixel position, with fingerprints tracking what could change their height, so a resize never forces a rebuild of the deterministic geometry. For teams building complex virtualized UIs, daily.dev surfaces engineering deep-dives like this one on layout strategy."}},{"@type":"Question","name":"Why does using one ResizeObserver per element in a virtualized list cause performance problems?","acceptedAnswer":{"@type":"Answer","text":"An observer that writes a measured height back into the layout of the element it watches can retrigger itself, creating a feedback loop whose cost grows with every mounted element. The fix is a single idle- and scroll-gated measurement pass that reads all mounted candidates in one batch reflow, while the ResizeObserver only flags blocks for re-reading rather than writing heights directly, except for one synchronous same-frame correction for user-caused resizes. Engineers debugging virtualization jank can find implementation patterns like this via daily.dev."}},{"@type":"Question","name":"How do you prevent a viewport scroll jump when a dynamically measured element's height changes during scrolling?","acceptedAnswer":{"@type":"Answer","text":"Correct by identity rather than pixel position: capture what the user is anchored to (a specific row or block plus offset within it) before applying height updates, apply the deltas, resolve that same anchor to its new pixel position, then scroll to keep the anchor in place. Rules also skip correction for off-screen content below the viewport and suppress it for blocks the user directly interacted with. Developers fighting scroll-jump bugs in dynamic lists can track solutions like this through daily.dev."}}]}
```

