Expand a hunk boundary from the file in diffs and PR files - #294
Merged
Conversation
A three-line-context patch never carries the lines around its hunks, so the band standing in for that gap had no control at all. The fold now takes the file's own text and offers what GitHub Desktop offers: the first hunk reads upward only, a gap within one 20-line step opens at once, and a longer one gets both ends — stacked in the gutter cell, downward reveal on top. PR files read their text through `contents_url` at the head, one request per opened file, so nothing needs fetching or checking out; without it the band stays inert, the way GitHub Desktop draws a gap it cannot expand.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
A diff's hunk-boundary band — the row standing in for the lines between two hunks — had no control in its gutter, because a three-line-context patch never carries those lines.
git diffrun locally asks for the whole file as context, so its gaps were already foldable; GitHub's PRpatchis fixed at three lines, and there the band was always inert.The fold now takes the file's own text and offers exactly what GitHub Desktop offers (its
getHunkExpansionType):PR files read their text through
contents_url, already pinned to the head — one request per opened file, nogit fetchand no checkout, matching how the Files tab already renders. When the read is unavailable (binary, too large, no access) the band stays inert, the way GitHub Desktop draws a gap it cannot expand.The gutter's paired controls are now stacked rather than side by side, following the same source.
Unit tests cover the three-state rule and the splice (line numbers on both sides, and the band keeping what is still hidden).
swift buildclean, 245 tests pass. The drawing itself is unverified on screen — screen capture is unavailable in this environment.Release Notes: Expand the context around a hunk in the diff and PR views — the gutter's reveal controls now open the lines between hunks, not just folded runs.