Skip to content

Changes list renders blank, unclickable rows after bulk external file changes #22619

Open

Agent suggestions

Public preview

Description

@francisrath

The problem

When many files are modified in bulk by an external tool (in my case a coding agent writing across the repo while Desktop is open), the Changes list allocates the right number of rows but renders almost all of them blank. The blank rows aren't clickable — only the row that renders text responds.

This is the symptom #22497 describes ("the correct number of rows are allocated, but cells don't render their content"), but that fix shipped in 3.6.3 and I'm seeing it on 3.6.3.

The data is fine — only the rendering is wrong:

Count
git status --porcelain 13
Desktop's "N changed files" header 13
Rows that actually render content 1

Two details that may help narrow it down:

  • The single row that renders is the last entry in git status order, drawn at the bottom of the pane. Row positions are correct; the content isn't drawn.
  • The diff pane was showing phpstan.neon (the 4th entry), so selection state is also correct — that row simply renders blank.

Resizing the window fixes it immediately. Switching to History and back does not. That distinction seems like the useful one: an ordinary re-render doesn't repair it, only whatever the resize path recomputes.

Distinct from #22596, which reports files genuinely missing from the list (count disagrees with git status). Here the count is right and only the cells fail to paint, so I don't think they're the same bug — happy to be told otherwise.

Release version

3.6.3

Operating system

macOS 26.5.2 (Darwin 25.5.0), Apple silicon

Steps to reproduce the behavior

  1. Open a repository in Desktop.
  2. Have an external tool modify a dozen or so files in quick succession (a coding agent, a codemod, a bulk find-and-replace — anything writing many files rapidly).
  3. Look at the Changes tab.
  4. Observe the header reports the correct file count, but most rows are blank and unclickable.
  5. Switch to History and back — still blank.
  6. Resize the window — all rows render correctly.

Log files

No response

Screenshots

The Changes pane reads "13 changed files" with a single rendered row sitting at the bottom of an otherwise empty list, while the diff pane shows a different file entirely.

Image

Additional context

Related: #22497 (same symptom, fix shipped in 3.6.3), #22596 (different symptom, same trigger).

Activity

  1. desktop-triage commented on Jul 28, 2026

    @desktop-triage

    Suggesting bug + priority-2: the report describes a rendering regression where Changes list cells fail to paint after bulk external file writes on 3.6.3, despite #22497 targeting the same symptom — the row count is correct but content is blank until the window is resized, which is a clear broken-behavior bug with a workaround. The issue is distinct from #22596 (missing files, wrong count) and is not a duplicate of any other open issue.

    Generated by Issue Triage (skills-driven) for #22619 · sonnet46 21.7 AIC · ⌖ 5.21 AIC · ⊞ 5.7K · ◷

  2. francisrath commented on Jul 28, 2026

    @francisrath
    ContributorAuthor

    I spent a while trying to reproduce this synthetically and couldn't, so posting the negative results and what I did learn — hopefully it narrows things for whoever picks it up.

    Couldn't reproduce with any of these

    Fresh repo, 49 files across six directories, GitHub Desktop 3.6.3 on macOS. In every case the Changes list rendered correctly:

    Trigger Result
    20 files modified at once, app focused renders
    20 files modified at once, app backgrounded renders
    3 files, pause, then 12 more (row count grows in stages) renders
    15 dirty files swapped for 15 different ones (row count unchanged) renders
    20 files replaced via temp-file + rename renders
    30 files rendered, then dropped to 13 while backgrounded renders
    Real coding-agent writes at the agent's own cadence renders
    14 files pulled in at once as a staged bulk change renders
    Same, with a linked worktree present and the repo on a non-default branch renders

    How coding agents actually write files

    This may be relevant since both this and #22596 involve an agent. Claude Code's file writes (both its whole-file and partial-edit paths, which are mechanically identical) look like this:

    rename  src/ui/file-1.txt.tmp.33402.bc72762a69f7  GONE
    rename  src/ui/file-1.txt  inode=46083657
    rename  src/ui/file-1.txt  inode=46083657
    
    • It writes <file>.tmp.<pid>.<hex> inside the same directory, then renames it over the target. The temp file lives inside the repo, so git status would briefly see an untracked file.
    • The inode changes on every write, so a watcher sees a rename rather than a modify, and any inode-based watch on the original is invalidated.
    • Three filesystem events per file, versus one change for an ordinary in-place write.

    Also worth noting, because it surprised me and it invalidates "bulk write" as a mental model: the writes are sequential, roughly 2–3 seconds apart, even when the agent issues them together. Ten files took 23 seconds. So an agent session is a slow drip sustained over minutes, not a burst — the accumulated list grows one row at a time over a long period.

    Behaviour when it does happen

    From the original report:

    • The row count in the header was correct (13, matching git status) and rows were allocated — only the cell contents failed to draw, and blank rows weren't clickable.
    • Selection state was correct too: the diff pane showed the 4th file while its row rendered blank.
    • Resizing the window fixes it immediately. Switching to History and back does not. So an ordinary re-render isn't enough; only whatever the resize path recomputes.

    That last point seems like the most useful clue. #22497 added recomputeGridSize() on the root grid plus forceUpdate() on the section grids, but only when !hasEqualRowCount — so it's scoped to row-count changes, and the section grids get a re-render rather than a size recompute. Given that a resize repairs it and a re-render doesn't, the difference between those two paths seems worth a look.

    I don't have a reliable enough reproduction to attempt a fix myself.

  3. added
    bug
    priority-3
    and removed on Jul 29, 2026
  4. francisrath commented on Aug 17, 2026

    @francisrath
    ContributorAuthor

    I have a deterministic repro and a fix that resolves it, and it turns out my original report had the premise wrong: the rows aren't rendering blank, they're not being rendered at all. Only one cell element exists in the DOM. Details below, but the repro is the useful part:

    Repro (5/5 on 3.6.3, macOS)

    1. In any repo, get ~60 changed files so the Changes list scrolls.
    2. Scroll the Changes list to the bottom.
    3. Switch to the History tab.
    4. While on History, drop the changed-file count to a handful (commit, discard, stash, or just delete them).
    5. Switch back to Changes.

    The header shows the right count, and exactly one row renders — the last one, at the bottom of an otherwise empty pane. Resizing the window repairs it; a History round trip does not.

    Step 2 is the necessary ingredient. Running the identical sequence without scrolling first renders correctly every time — I ran that as a control. Row counts don't matter: 60→5, 40→3, 80→12 and 30→2 all failed identically, and the untouched control passed.

    Script that automates the above (macOS)

    Launch Desktop with open -a "GitHub Desktop" --args --remote-debugging-port=9222, open the repo you want to use, then node repro-22619.mjs /path/to/that/repo. It only creates and deletes files inside <repo>/ghd-repro-tmp. On 3.6.3 it prints header says "5 changed files", rows rendered: 1.

    // Reproduces desktop#22619 against a running GitHub Desktop on macOS.
    import { execFileSync } from 'node:child_process'
    import { mkdirSync, rmSync, writeFileSync, readdirSync } from 'node:fs'
    import { join } from 'node:path'
    
    const repo = process.argv[2]
    if (!repo) throw new Error('usage: node repro-22619.mjs <repo-path>')
    const dir = join(repo, 'ghd-repro-tmp')
    const sleep = ms => new Promise(r => setTimeout(r, ms))
    
    const page = (await fetch('http://127.0.0.1:9222/json').then(r => r.json()))
      .find(t => t.type === 'page' && !t.url.startsWith('devtools://'))
    const ws = new WebSocket(page.webSocketDebuggerUrl)
    await new Promise(r => ws.addEventListener('open', r))
    
    let id = 0
    const evaluate = expression =>
      new Promise(resolve => {
        const msgId = ++id
        const onMessage = ev => {
          const msg = JSON.parse(ev.data)
          if (msg.id !== msgId) return
          ws.removeEventListener('message', onMessage)
          resolve(msg.result?.result?.value)
        }
        ws.addEventListener('message', onMessage)
        ws.send(JSON.stringify({
          id: msgId, method: 'Runtime.evaluate',
          params: { expression, returnByValue: true },
        }))
      })
    
    // Desktop only re-reads the working tree on a window focus transition.
    const refresh = async () => {
      execFileSync('osascript', [
        '-e', 'tell application "Finder" to activate', '-e', 'delay 0.4',
        '-e', 'tell application "GitHub Desktop" to activate',
      ])
      await sleep(2600)
    }
    
    const files = n => {
      rmSync(dir, { recursive: true, force: true })
      mkdirSync(dir, { recursive: true })
      for (let i = 0; i < n; i++) writeFileSync(join(dir, `file-${i}.txt`), 'x\n')
    }
    
    const grid = 'document.querySelectorAll(".ReactVirtualized__Grid")[0]'
    const clickTab = i =>
      evaluate(`document.querySelectorAll("[role=tab]")[${i}].click()`)
    
    files(60)
    await refresh()
    await evaluate(`${grid}.scrollTop = ${grid}.scrollHeight - ${grid}.clientHeight`)
    await sleep(800)
    await clickTab(1) // -> History
    await sleep(800)
    for (const f of readdirSync(dir).slice(5)) rmSync(join(dir, f)) // shrink
    await refresh()
    await clickTab(0) // -> Changes
    await sleep(1500)
    
    console.log(await evaluate(`(() => {
      const grids = [...document.querySelectorAll('.ReactVirtualized__Grid')]
        .filter(el => !el.classList.contains('ReactVirtualized__List'))
      const rendered = grids[1]?.firstElementChild?.childElementCount ?? 0
      const header = [...document.querySelectorAll('*')]
        .find(e => e.children.length === 0 && /\\d+ changed files?/.test(e.textContent))
      return \`header says "\${header?.textContent.trim()}", rows rendered: \${rendered}\`
    })()`))
    
    rmSync(dir, { recursive: true, force: true })
    await refresh()
    ws.close()

    What's actually happening

    Reading React's state out of the running app at the moment of failure (60 files scrolled to the bottom, then shrunk to 5):

    value
    root grid state.scrollTop 1058.9 stale offset, from when the list was 1740px tall
    section grid scrollTop prop 145 = sectionHeight exactly (5 rows × 29px)
    rendered cells 1 of 5, at top: 116px index 4 — the last row
    blank cells 0 nothing rendered empty
    root grid DOM scrollTop 0 145px of content in a 681px viewport; not scrollable

    Toggling only that one value on the live list flips the symptom back and forth: scrollTop = 0 → all rows render; = 9999 → one row; = 0 → all rows. Nothing else changes.

    Same signature as the in-the-wild capture I hit earlier, sampled at 8, 12, 15, 16 and 17 files: content height always exactly rowCount × 29, always one cell, always index rowCount - 1 at top = (rowCount - 1) × 29, always zero blank cells.

    Cause

    section-list.tsx:1371-1374 clamps the per-section offset to the section's total content height instead of to sectionHeight - visibleHeight:

    const relativeScrollTop = Math.max(0, Math.min(sectionHeight, this.state.scrollTop - offset))

    So a stale state.scrollTop yields relativeScrollTop === sectionHeight. react-virtualized 9.22.6 then clamps that through _findNearestCell to cellCount - 1, and getVisibleCellRange's loop can't advance past the end — start = stop = lastIndex. overscanRowCount={4} adds nothing, since overscan only runs in the scroll direction.

    How the offset survives: SectionList.onScroll (:1783) stores whatever it's handed, unclamped, and the root grid is controlled via scrollTop={this.props.setScrollTop} (:1495). react-virtualized's getDerivedStateFromProps copies a changed scrollTop prop into state without clamping against totalRowsHeight — only the DOM _onScroll handler clamps — then fires onScroll with that unclamped value. And repository.tsx:270-273 supplies setScrollTop from the saved changesListScrollTop only on the History → Changes transition.

    That's why step 3–5 is required: the offset is re-injected after the list shrank, into a grid that is no longer scrollable (overflowY: hidden), so no DOM scroll event can ever fire the one clamp that exists. onScroll then re-saves the bad value, so it persists across further tab switches. The fake-scroll path that could otherwise resync is __WIN32__-only, so macOS/Linux have no escape hatch.

    This also inverts the clue from my earlier comment: History-and-back isn't a failed repair, it's the injection path.

    Not just cosmetic

    The files are real and all staged: in my original screenshot the header reads "17 changed files" with select-all checked and the button reads "Commit 17 files", while 16 of them have no row on screen. You can commit files you can't see, and can't uncheck one you didn't want — there's no row to click. Possibly worth more than priority-3.

    Suggested fix

    Clamp to the maximum scrollable offset:

           const sectionHeight = this.getSectionHeight(section)
           const offset = this.getSectionScrollOffset(section)
    +      const visibleHeight = Math.min(sectionHeight, height)
    
           const relativeScrollTop = Math.max(
             0,
    -        Math.min(sectionHeight, this.state.scrollTop - offset)
    +        Math.min(sectionHeight - visibleHeight, this.state.scrollTop - offset)
           )

    I built this and re-ran the identical script against both builds:

    released 3.6.3 patched build
    60 → 5 files, scrolled first 1 of 5 rendered 5 of 5
    40 → 3 1 of 3 3 of 3
    80 → 12 1 of 12 12 of 12
    30 → 2 1 of 2 2 of 2
    control (no scroll) 5 of 5 5 of 5

    The stale offset is still injected on the patched build — changesListScrollTop read 1319, 739, 1899 and 449 before each transition — so the clamp is doing the work, not some side effect of the rebuild.

    Scrolling still tracks correctly with the clamp in place. On a 60-row list in a 421px viewport: offset 0 draws rows 0-18, 400 draws 13-32, 900 draws 31-49, and the bottom draws 45-59 ending on the true final row.

    Clamping in SectionList.onScroll before setState would additionally stop the bad value being persisted and replayed, though it isn't needed to fix this.

    I checked whether the History list has the same defect, since commit-list.tsx passes compareListScrollTop into List the same way and its only reset (scrollCompareListToTop) fires just on branch-created-from-commit. It doesn't reproduce: planting a stale compareListScrollTop and going Changes → History still renders every commit. The likely reason is that the commit list mounts empty while commits load, so it passes through rowCount === 0, which react-virtualized explicitly zeroes the scroll offset for. SectionList's root grid never does, since its rowCount is the number of sections rather than the number of files.

    I added a case to section-list-scroll-test.tsx alongside the existing #22387 one: render a SectionList with a setScrollTop larger than its content and assert every row renders. It fails without the fix (expected all 5 rows to render, got 1) and passes with it. app/test/unit/ui is 166/166.

    One aside for anyone else running the suite locally: on Node 25+ every test that imports SectionList dies with Cannot read properties of undefined (reading 'getItem') from update-store. Those versions define localStorage in globalThis but leave it undefined unless --localstorage-file is passed, so global-jsdom treats it as already present and jsdom's real one never lands. On the pinned Node 24.15.0 it's fine.

    One aside for anyone scripting this

    Desktop only re-reads the working tree on a window focus transition, so an automated repro needs to defocus and refocus the window after changing files. By hand this happens naturally.

  5. francisrath commented on Aug 20, 2026

    @francisrath
    ContributorAuthor

    If you got time for it, have a look here also @niik - this one might actually be a bit worse than my first post suggested. You can end up committing loads of changes you don't actually see before it's committed. It has happened quite a few times in the last few weeks for me, and I think I finally nailed the repro on this one. I have PR draft ready for review if you want it.

  6. crea7or commented on Oct 3, 2026

    @crea7or
    Contributor

    It rarely appears and can be fixed only by the app restart (minimizing, switching tabs does not help).

    Image
  7. francisrath commented on Oct 3, 2026

    @francisrath
    ContributorAuthor

    It rarely appears and can be fixed only by the app restart (minimizing, switching tabs does not help).

    I have a proposed fix that took me quite some time to nail down, but I'm pretty sure it solves it: #22741 - however, I already have an open PR in this repo and I can't submit this one before that merges. Hopefully soon 😅

  8. francisrath commented on Oct 13, 2026

    @francisrath
    ContributorAuthor

    Could a maintainer add the help wanted label to this issue?

    I have a tested fix ready in #22741. It's a draft for now because I already have a PR open in this repo, and I'll take it out of draft as soon as that one merges. It includes a unit test that reproduces this on current development (one row rendered out of five) and passes with the fix.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions