Skip to content

Large pull requests #11

Closed
Closed

Description

@ribeirogab

Parent

#1

What to build

Filtering stays correct on large pull requests: files that GitHub loads later, diffs that GitHub virtualizes, and single file mode.

Acceptance criteria

  • Files that GitHub lists or loads after the first render are filtered without a reload, and the hidden count updates.
  • Diff blocks that GitHub removes and adds again while the user scrolls keep their state.
  • In single file mode the open file always stays visible. If it is a matching file, it shows Temporarily visible. The tree follows the tree filtering setting.
  • The extension's own injected nodes do not cause extra filtering passes.
  • End-to-end tests use the large pull request fixtures.

Blocked by

Activity

  1. self-assigned this
    on Oct 2, 2026
  2. ribeirogab commented on Oct 2, 2026

    @ribeirogab
    OwnerAuthor

    Finding from the fixtures (tests/fixtures/github/README.md, commit 49e302d):

    • 800 small files (pr2-changes, pr2-changes-scrolled): the sidebar tree lists every file at once, the diffs render progressively, and rendered blocks stay mounted after scrolling.
    • About 150,000 lines (pr3-optimized): GitHub opens a view optimized for large pull requests, with Load Diff placeholders and a link to single file mode.
    • Single file mode is the URL ?mode=single (pr3-single-file, pr3-single-file-next). J and K move between files and change the URL hash to the new file's #diff-<sha256 of path> anchor, so the direct-link handling from Reveal hidden files from direct links #9 applies to this navigation.
  3. ribeirogab commented on Oct 3, 2026

    @ribeirogab
    OwnerAuthor

    Filtering stays correct on large pull requests. Diff entries are located inside GitHub's progressive-diffs-list and virtualized-diffs-list (the optimized view), and the hidden entry wraps the Loading placeholder that shares a file's #diff-<sha256> anchor. The hidden count always comes from the sidebar tree, which lists every file before the diffs render. A MutationObserver re-applies visibility when GitHub lists or renders more files, or removes and re-adds blocks, and it ignores mutations inside the extension's own nodes, so the page stays quiet after a pass. In single file mode (?mode=single) the open file counts as revealed: it stays visible with Temporarily visible, the hidden count excludes it, and the tree follows the tree filtering setting; J/K hash changes go through the direct-link handling from #9.

    Tests (all on the large pull request fixtures):

    • PR 2 (800 files): 400 test files hidden from the complete tree; diffs rendered later (pr2-changes → pr2-changes-scrolled) filtered without a reload; blocks removed and re-created keep their state.
    • PR 1: files listed after the first render update the count (10 → 11) and get hidden.
    • PR 3 optimized view: 30 test files hidden; single file mode keeps migrations/001/up.sql visible with the label (299 hidden), and the next-file fixture with its #diff hash does the same for migrations/002/up.sql.
    • A MutationObserver sees zero mutations during a quiet second after filtering settles on PR 1 (with a reveal and tree hints) and PR 2.

    Commit: 57b2836.

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

Metadata

Metadata

Assignees

Labels

ready-for-agentFully specified; an agent can pick it up

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions