Skip to content

feat: add expand controls before first and after last diff hunk#338

Merged
tomasz-tomczyk merged 1 commit intomainfrom
agent-a9862310
Apr 23, 2026
Merged

feat: add expand controls before first and after last diff hunk#338
tomasz-tomczyk merged 1 commit intomainfrom
agent-a9862310

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

@tomasz-tomczyk tomasz-tomczyk commented Apr 23, 2026

Summary

  • Adds an expand-down spacer before the first diff hunk when it doesn't start at line 1
  • Adds an expand-up spacer after the last diff hunk when it doesn't reach EOF
  • Expands 20 lines per click, matching GitHub/GitLab conventions
  • Handles pure insertion/deletion edge cases (zero-count hunk gap computation)
  • Recomputes hunk headers after expansion to keep line numbers accurate
  • Works in both split and unified diff views

Test plan

  • 12 new E2E tests in leading-trailing-expand.spec.ts covering visibility, click behavior, commentability in both modes
  • Auto-expand-gaps test selectors updated for compatibility with leading/trailing spacers
  • All 47 affected tests pass locally

Closes #335
Supersedes #321 (which covered leading spacer only — this adds both leading and trailing)

🤖 Generated with Claude Code

Closes #335

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tomasz-tomczyk tomasz-tomczyk merged commit 850d038 into main Apr 23, 2026
4 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the agent-a9862310 branch April 23, 2026 21:57
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.

Add expand controls before first and after last diff hunk

1 participant