Skip to content

feat: show diff stats in PR file trees - #66

Merged
rrbe merged 2 commits into
mainfrom
feat/pr-file-tree-diff-stats
Nov 29, 2026
Merged

rrbe merged 2 commits into
mainfrom
feat/pr-file-tree-diff-stats

Conversation

@rrbe

@rrbe rrbe commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Summary

Show additions and deletions beside file names in PR file trees, with an independent toggle and English, Simplified Chinese, and Traditional Chinese settings text. Uses data already on the page and requires no token or extra requests.

Preview: initial diff summaries → file tree
Classic and preview: rendered file headers → file tree
View change → discard previous statistics → populate from current headers

Preview summaries populate files before their diffs render. After a soft navigation, statistics appear as current file headers render. Folder expansion and tree rerenders restore the numbers.

Evidence

  • Before: File tree entries showed file names and change indicators.
    After: Browser checks displayed statistics for all 33 preview entries; classic entries showed +15 −1 and +82 −5, positioned after file names.
  • Browser checks confirmed preview folder expansion restores statistics and selecting one commit updates its file to +3 −0.
  • DOM behavior checks passed for stale view invalidation, lazy headers, deduplication, tree rerenders, teardown, and classic counts with thousands separators.
  • pnpm typecheck, pnpm test (300 tests), and pnpm build passed.

Merge Danger

Door: Two-way

The feature can be disabled in settings or reverted.

Blast Radius: PRs

Limited to the file tree on classic and preview PR diff pages. GitHub DOM and embedded payload changes may require selector updates.

@rrbe
rrbe merged commit 7f2ad7a into main Nov 29, 2026
1 check passed
@rrbe
rrbe deleted the feat/pr-file-tree-diff-stats branch November 29, 2026 10:40
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.

1 participant