feat: list the commits a pull request would land#98
Merged
Conversation
The Pulls screen showed what a pull request changes — the description, the files, the checks — but never what it is made of. Reading how the branch got there meant leaving for the browser, and the diff alone never tells that story: one 40-file diff can be one commit or fifteen. A "Commits" tab now lists them, counted next to its name, oldest first as gh lists them: subject, author and date, with the message body under it the way git prints one. The commits ride along with the gh pr view the screen already makes, so the tab costs no extra round-trip.
The first tab printed every message in full, so a branch of fifteen commits became a wall of prose you had to scroll past to count them. A row is now the subject line, who committed it and when; the body sits behind the row's toggle, the way GitHub's own list reads.
Reading a message meant hitting a small ellipsis button beside the subject — GitHub's affordance, and a target you have to aim at for something the row already stands for. The row itself is the button now: it fills on hover, a chevron marks the commits that have a body, and one that doesn't stays inert instead of offering a toggle with nothing behind it.
The app turns every enabled button into a pointer target, which reads as "this goes somewhere". A commit row goes nowhere — it unfolds in place — so it keeps the arrow, like the text it is.
This was referenced Jul 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A Commits tab on the Pulls screen: every commit the pull request would land, counted next to the tab name, oldest first as gh lists them — subject, author and date, with the message body under it the way git prints one.
Why
The screen showed what a pull request changes — description, files, checks — but never what it is made of. Reading how the branch got there meant leaving for the browser, and the diff alone never tells that story: one 40-file diff can be one commit or fifteen.
How
commitsjoins thegh pr view --jsonselection the screen already requests, so the tab costs no extra round-trip.toCommitsflattens gh's entries intoPRCommit{oid, headline, body, author, date}— the first author names the row (the list exists for co-authored commits), gh's order is kept, and no commits yieldsnilso the tab can tell "none" from a list.internal/project/pr.go—PRCommit,toCommits, the field inprViewFieldsandPRDetailfrontend/src/lib/api-types.ts— the hand-owned mirrorfrontend/src/components/pulls/PullsCommits.tsx— the tabfrontend/src/components/pulls/Pulls.tsx— tab button with the count, panel wiringTest plan
go test ./...— 404 pass, includingTestToCommits(body/author/order, bare commit, login→name fallback) and the commits assertion inTestParsePRDetailgofmt -l ./go vet ./...cleanpnpm check,tsc --noEmit,vitest run(408),vite buildgh pr view --json <full field set>accepted by the real CLItask dev: the tab renders, the count matches, a one-line commit shows no body block — the frontend suite is node-only and does not renderNotes
Deliberately out: opening a commit on GitHub from a row, collapsing long bodies, grouping by author. None of it was asked for; the tab answers "how many, and which".