You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hunk diff doesn't show "unchanged files" after the last change #1154
I reproduced this on main (8da0984, Linux, bun). I used a 63-line file with two inserted blank lines (lines 4 and 49), which leaves 11 unchanged lines after the last hunk. hunk diff shows the leading ··· 1 unchanged line ··· row and the ··· 38 unchanged lines ··· row between hunks, but nothing after the last hunk. The output stops at line 51/53 with no ··· 11 unchanged lines ··· row. A plain one-line modification behaves the same way, so this isn't limited to the zero-count case.
Cause, as far as I can tell:reviewTrailingGap (packages/hunk/src/core/review/expansion.ts) returns nothing when isPartial is true. Every git-diff-sourced file is partial (core/changeset/diffFile.ts sets isPartial: true), because a patch doesn't carry the file's total line count. The terminal rows (buildSplitRows/buildUnifiedRows), the browser view and note validation all share this rule, so none of them offer a trailing gap. docs/browser-review-seam-audit.md (A2) says the trailing-gap work is staged separately, so I didn't want to open a PR without asking first.
Possible approach:
Once the full source has been loaded through sourceFetcher, record the file's line count in core.
Have reviewTrailingGap derive the trailing gap from that count instead of bailing on isPartial. Until the source is known, it would keep returning nothing.
Make it a single change in core, so the terminal, the browser and note validation (reviewGapAddress, resolveReviewExpandedLine) keep agreeing on gap addresses.
Add tests for both the split and unified rows and for note validation.
Would you like a PR along these lines? Or is there a design you'd prefer, for example loading line counts eagerly or keeping this tied to the staged A2 work? I'm happy to follow whichever direction you pick.
Activity
liziye627-design commentedon Oct 24, 2026
I reproduced this on
main(8da0984, Linux, bun). I used a 63-line file with two inserted blank lines (lines 4 and 49), which leaves 11 unchanged lines after the last hunk.hunk diffshows the leading··· 1 unchanged line ···row and the··· 38 unchanged lines ···row between hunks, but nothing after the last hunk. The output stops at line 51/53 with no··· 11 unchanged lines ···row. A plain one-line modification behaves the same way, so this isn't limited to the zero-count case.Cause, as far as I can tell:
reviewTrailingGap(packages/hunk/src/core/review/expansion.ts) returns nothing whenisPartialis true. Every git-diff-sourced file is partial (core/changeset/diffFile.tssetsisPartial: true), because a patch doesn't carry the file's total line count. The terminal rows (buildSplitRows/buildUnifiedRows), the browser view and note validation all share this rule, so none of them offer a trailing gap.docs/browser-review-seam-audit.md(A2) says the trailing-gap work is staged separately, so I didn't want to open a PR without asking first.Possible approach:
sourceFetcher, record the file's line count in core.reviewTrailingGapderive the trailing gap from that count instead of bailing onisPartial. Until the source is known, it would keep returning nothing.reviewGapAddress,resolveReviewExpandedLine) keep agreeing on gap addresses.Would you like a PR along these lines? Or is there a design you'd prefer, for example loading line counts eagerly or keeping this tied to the staged A2 work? I'm happy to follow whichever direction you pick.
(Drafted with AI assistance.)