Skip to content

fix: preserve leading unchanged context before the first diff hunk#321

Closed
omry wants to merge 1 commit intotomasz-tomczyk:mainfrom
omry:leading-diff-spacer
Closed

fix: preserve leading unchanged context before the first diff hunk#321
omry wants to merge 1 commit intotomasz-tomczyk:mainfrom
omry:leading-diff-spacer

Conversation

@omry
Copy link
Copy Markdown
Contributor

@omry omry commented Apr 21, 2026

  • Show an expandable spacer before the first diff hunk when a file begins with unchanged lines.
  • Fix leading-context handling for zero-count unified diff hunks, including pure insertions and deletions.
  • Recompute merged hunk ranges from merged line numbers so expanded hunk headers stay accurate.
  • Tighten the Playwright diff-rendering coverage by using the shared server.go helper and retryable spacer-count assertions.

Updated UI:
image

Fixes #319

Show an expandable spacer before the first diff hunk when a file has unchanged lines at the top, including zero-count unified diff cases like pure insertions or deletions.

Recompute merged hunk ranges from the merged line numbers so expanded headers stay accurate after revealing leading context.

Also tighten the Playwright diff-rendering spec to use the shared server.go helper and retryable spacer-count assertions.
@omry omry marked this pull request as ready for review April 21, 2026 08:15
@tomasz-tomczyk
Copy link
Copy Markdown
Owner

Thank you ❤️ I've reimplemented it in #338 including support for the last diff hunk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot unfold code at the top of the file.

2 participants