Skip to content

Fit each file box on the PR page to its diff; Global comment beside Split/Unified - #2632

Merged
backnotprop merged 4 commits into
mainfrom
fix/pr-page-diff-padding
Nov 5, 2026
Merged

backnotprop merged 4 commits into
mainfrom
fix/pr-page-diff-padding

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

On the PR page (the review in the PR pane, #2615), a 5-line file sat in a 304px box with empty space under its lines. Each file box used the guide's fixed height estimate, which counts git's header lines and has a 150px floor. The diff scrolls inside that fixed box, so the box never shrank to fit.

What changes:

  • In the readers built on GuideReader (the PR page, the guided review in a thread, the full-window review; the phone surface's SurfaceGuideReader and ShapeCodeGuide keep the fixed estimate), through a new opt-in GuideView prop, fitFileHeights, that GuideReader passes: each file box starts at the height of its hunk rows (in Split, paired removed and added lines count once; 40 px above a first hunk, 48 px between hunks, a row for each \ No newline note, as measured in the browser). Then it takes the height AllFilesCodeView reports through a new optional onContentHeightChange prop. The cap stays at 620px, and a longer diff still scrolls inside its box. Inline comments and wrapped lines make the box grow. After a remount, a first report that shrinks the box waits two frames, so a commented file does not dip.
  • On the PR page (bare), the Global comment button moves onto the Split | Unified tab's row, to the left of the tab (owner, q-bfcf3a4a B). On a phone there is no tab, so the button stays on its own row.

The review app, guides.show and VS Code do not opt in and keep the fixed estimate.

Stacked on #2615 (base feat/pulls-review-with-agent).

Tests: packages/guide-viewer/GuideView.test.tsx (box heights with the opt-in and unchanged without it; the Split estimate; the remount hold; the button row with a tab, without one, and outside bare mode). tests/e2e/inbox-guides.spec.ts checks the thread's box in Chromium. tests/e2e/inbox-pull-requests.spec.ts checks in Chromium that the 5-line file's last row ends within one row of its box, and that the button sits beside the switch without touching it.

…Split/Unified row

The PR page's file boxes used the guide's fixed estimate, which counted git's
header lines and had a 150px floor, so a 5-line file sat in a 304px box.
In GuideView bare mode each box now starts from the hunks' rows and then
takes the height AllFilesCodeView reports, capped at 620px as before. The
Global comment button moves onto the Split | Unified tab's row (owner,
q-bfcf3a4a B); with no tab (a phone) it keeps its own row. Outside bare
mode nothing changes.
…remount's first shrink

GuideView gets an opt-in fitFileHeights (default: bare only) and GuideReader
passes it, so the guided review in a thread fits too; the review app,
guides.show and VS Code keep the fixed estimate. The first estimate follows
the host's layout (Split pairs removed and added lines). After a remount, a
first report that shrinks the box waits two frames for the viewer to draw, so
a commented file does not dip for a frame.
…wait

The first estimate charged 32 px per separator; the browser draws 40 above a
first hunk and 48 between hunks, and a row for each "\ No newline" note, so
modified files grew on first mount.

Tests: the latest shrinking report lands, a wait dies with its CodeView, and the
lease-waiting tests carry an explicit timeout. Wording that still said the fit
came from `bare`, or from every Inbox reader, now says what does.
backnotprop added a commit that referenced this pull request Nov 5, 2026
…the review app's fill

The owner decided there is no height limit in the Inbox: #2635 removes the cap for
fitted hosts, so this drops --guide-file-fit-max, its 100cqh rule, GuideFileCard's
max-height and their tests. GuideFileCard is back to #2632's. The pane stays an
inline-size container for the note's room on the controls' row.

From REVIEW_FOLD_PANEL_BELOW up the comments column takes the review app's bg-card/30
over --background; folded, the sheet stays a card over the diff.
@backnotprop
backnotprop changed the base branch from feat/pulls-review-with-agent to main November 5, 2026 02:05
@backnotprop
backnotprop marked this pull request as ready for review November 5, 2026 02:06
@backnotprop backnotprop added the ci:full Run the heavy CI tier on this PR (added by the merge script) label Nov 5, 2026
@backnotprop
backnotprop merged commit bac8aaa into main Nov 5, 2026
103 of 105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the heavy CI tier on this PR (added by the merge script)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant