feat(ui): make file and hunk spacing configurable - #865
Open
Ajay-Satish-01 wants to merge 1 commit into
Open
Conversation
Let reviewers set file_gap and hunk_gap from config or CLI so the review stream can add or hide vertical space between files and hunks.
Contributor
|
PR author is not in the allowed authors list. |
|
@Ajay-Satish-01 is attempting to deploy a commit to the Modem Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
@benvinegar, would you be able to take a look at this? Thanks |
Member
|
I'm good with the behavior (adding the config + feature) - good call I just want to look over the code first |
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.
Summary
file_gap/--file-gap(0–8, default1) so the space between files in the review stream is configurable.1keeps the current─rule,0hides it, and larger values add blank rows above the rule.hunk_gap/--hunk-gap(0–8, default0) so later hunks can have blank rows before@@(still inserted when hunk headers are hidden).Fixes #839
Test plan
bun run start -- diff --no-sidebar --mode stack --file-gap 3 --hunk-gap 2on a repo with at least two files and two hunks--file-gap 0hides the─;--file-gap 1is the current look--hunk-gap 2puts two blanks before later@@; first file/hunk stay flush--no-hunk-headers --hunk-gap 2still inserts blanks before later hunk contentfile_gap/hunk_gapapply; CLI flags override;--file-gap 9and--hunk-gap abcerror[/]still land on hunk content, not the spacerVerified: unit tests for parse/config/plan/geometry; PTY layout tests for
--file-gap 3and--hunk-gap 2; live PTY frames for 0/1/3 file gaps and 0/2 hunk gaps (including hidden headers).format:check,lint,typecheck,check:docs,deps:check, andbun run testpassed.Screenshots
Real Hunk TUI (PTY capture), 100×32,
--no-sidebar --mode stack, default theme, macOS.Default look (
file_gap=1,hunk_gap=0)One
─rule between files; no extra space before later hunks.--file-gap 0Hides the
─; the next file header sits on the previous body.--file-gap 3Two blank rows, then the
─rule, thenbeta.ts.--hunk-gap 2Two blank rows before the later
@@inalpha.ts. First hunk stays flush.--file-gap 3 --hunk-gap 2Both gaps together.
--no-hunk-headers --hunk-gap 2Blanks still appear before later hunk content when hunk headers are hidden.