Skip to content

Add diff-stats-by-extension#9476

Draft
samaluk wants to merge 5 commits into
refined-github:mainfrom
samaluk:codex/diff-stats-by-extension
Draft

Add diff-stats-by-extension#9476
samaluk wants to merge 5 commits into
refined-github:mainfrom
samaluk:codex/diff-stats-by-extension

Conversation

@samaluk
Copy link
Copy Markdown

@samaluk samaluk commented May 15, 2026

Closes #9475

This adds diff-stats-by-extension, a small enhancement for PR review: clicking GitHub's existing line-count diffstat opens a popover with additions and deletions grouped by file extension.

I kept the native diffstat in place and only intercept a normal left click. Cmd/Ctrl-click and other altered clicks still fall through to GitHub. The numbers come from the PR files REST endpoint, so the feature uses GitHub's own changed-file metadata instead of parsing patches locally.

The grouping logic is split into a helper with focused Vitest coverage, and the feature runs on both the Conversation and Files tabs. For very large PRs, the popover notes when the file list may have been capped.

Fork-side review PR: samaluk#1

Test URLs

Screenshot

Popover: lines by file type

samaluk added 5 commits May 15, 2026 19:22
Extract pure aggregation for basename labels and per-extension +/−
totals with vitest coverage.
Wire click on native diffstat to anchored popover with per-extension
breakdown from REST pull files API, caching, and cursor affordance CSS.
Hosts screenshot for raw.githubusercontent.com links in gh-generated text.
Import feature entry point and refresh readme-parser snapshots.
Restore the feature import after dropping the broken root commit, refresh
imported-features metadata, and exempt the readme entry from the inline
screenshot rule (preview lives under media/).
@samaluk samaluk force-pushed the codex/diff-stats-by-extension branch from 044fc5e to dd64996 Compare May 15, 2026 23:24
@github-actions
Copy link
Copy Markdown

Please avoid force-pushing to this PR. It makes it harder for reviewers to track what changed since the last review.

Just push new commits on top of the branch instead — PRs are squashed on merge, so the commit history doesn't need to be clean.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Feature: click PR diffstat for per-extension line breakdown

1 participant