Skip to content

feat: expand diff context incrementally (20 lines per click)#339

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

feat: expand diff context incrementally (20 lines per click)#339
tomasz-tomczyk merged 1 commit intomainfrom
agent-a077f59b

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

Summary

  • Large gaps (>20 lines) between diff hunks now show directional expand-up/expand-down buttons instead of a single "Expand N unchanged lines" click target
  • Each click reveals 20 lines from the chosen direction, inserting a "bridge" hunk rather than destructively merging
  • Gaps ≤20 lines retain the single-click expand-all behavior
  • Adds buildHunkHeader helper to properly recompute @@ ... @@ headers after expansion, preserving function name suffixes
  • Works in both split and unified diff views

Test plan

  • 7 new E2E tests in incremental-expand.spec.ts covering directional controls, partial expansion, remaining count update, and both diff modes
  • Existing expanded-comments, diff-rendering, auto-expand-gaps tests updated and passing
  • All 42 affected tests pass locally

Closes #334

🤖 Generated with Claude Code

Closes #334

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

Expand diff context incrementally (20 lines per click)

1 participant