Skip to content

Fix disappearing files in Changes view after backgrounding - #22497

Merged
tidy-dev merged 1 commit into
developmentfrom
tidy-dev-investigate-changes-view-disappearing-fi
Jul 7, 2026
Merged

tidy-dev merged 1 commit into
developmentfrom
tidy-dev-investigate-changes-view-disappearing-fi

Conversation

@tidy-dev

@tidy-dev tidy-dev commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

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 when rowCount changes.

The root Grid's recomputeGridSize() recalculates positional layout, but the section Grids (which are react-virtualized Grid components using PureComponent optimization) 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 whenever rowCount changes, ensuring cells always re-render with fresh content. This matches the existing pattern used for invalidationPropsChanged lower 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 by overscanRowCount).

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:

@tidy-dev
tidy-dev marked this pull request as ready for review July 6, 2026 16:12
@tidy-dev
tidy-dev requested a review from a team as a code owner July 6, 2026 16:12
@tidy-dev
tidy-dev requested review from Copilot and niik July 6, 2026 16:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() when rowCount changes to avoid missed cell re-renders due to PureComponent optimizations.
  • 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

Comment thread app/src/ui/lib/list/section-list.tsx Resolved
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
tidy-dev force-pushed the tidy-dev-investigate-changes-view-disappearing-fi branch from 85e1e95 to 35be06f Compare July 6, 2026 16:15
@tidy-dev
tidy-dev enabled auto-merge July 6, 2026 16:15
@tidy-dev
tidy-dev requested a review from sergiou87 July 6, 2026 18:23

@sergiou87 sergiou87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I didn't see performance issues, let's see if this fixes the problem 🤞

@tidy-dev
tidy-dev merged commit 5ca92e4 into development Jul 7, 2026
9 checks passed
@tidy-dev
tidy-dev deleted the tidy-dev-investigate-changes-view-disappearing-fi branch July 7, 2026 08:12
@fundzm538-beep

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants