Repository navigation
Fix disappearing files in Changes view after backgrounding - #22497
Merged
tidy-dev merged 1 commit intoJul 7, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an intermittent rendering issue in the Changes view where modified files could appear as blank rows after GitHub Desktop is backgrounded and then brought back to the foreground (notably on Windows), by ensuring per-section react-virtualized grids re-render when the underlying rowCount changes.
Changes:
- Forces all section grids to
forceUpdate()whenrowCountchanges to avoid missed cell re-renders due toPureComponentoptimizations. - Adds inline rationale and links the fix to the corresponding GitHub issue for future context.
Show a summary per file
| File | Description |
|---|---|
app/src/ui/lib/list/section-list.tsx |
Forces per-section grids to re-render when rowCount changes to prevent blank rows after background throttling. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Low
When the app returns from background with new file changes, the SectionList's per-section Grid components may not re-render their cells despite the rowCount changing. This happens because react-virtualized's PureComponent optimization can skip updates when the root Grid's re-render cascade doesn't properly propagate to section grids (especially when render scheduling is throttled while backgrounded). Fix by explicitly calling recomputeGridSize() and forceUpdate() on all section grids whenever rowCount changes, ensuring stale internal caches are cleared and cells are re-rendered. Fixes #20566 Co-authored-by: Copilot <[email protected]>
tidy-dev
force-pushed
the
tidy-dev-investigate-changes-view-disappearing-fi
branch
from
July 6, 2026 16:15
85e1e95 to
35be06f
Compare
tidy-dev
enabled auto-merge
July 6, 2026 16:15
sergiou87
approved these changes
Jul 7, 2026
sergiou87
left a comment
Member
There was a problem hiding this comment.
LGTM! I didn't see performance issues, let's see if this fixes the problem 🤞
This comment has been minimized.
This comment has been minimized.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Maybe fixes... #20566
Description
When GitHub Desktop returns from the background after file changes have occurred, items in the Changes list can appear as blank rows -- the correct number of rows are allocated, but cells don't render their content. This happens because
SectionList's nested Grid architecture (root Grid -> section Grids) doesn't fully propagate re-renders to section grids whenrowCountchanges.The root Grid's
recomputeGridSize()recalculates positional layout, but the section Grids (which are react-virtualizedGridcomponents usingPureComponentoptimization) may skip re-rendering their cells because the render cascade from the root doesn't always reach them -- particularly under Chromium's background throttling on Windows.The fix adds
forceUpdate()on all section grids wheneverrowCountchanges, ensuring cells always re-render with fresh content. This matches the existing pattern used forinvalidationPropsChangedlower in the same method. The performance cost is negligible since it only fires when the file count actually changes and only re-renders the currently visible cells (4-10 rows determined byoverscanRowCount).Screenshots
The fix addresses a rendering issue that manifests as blank/empty rows in the Changes file list. There is not a way to consistently reproduce this so it is hard to ensure that it is fixed.
Release notes
Notes: