Right now Expand N unchanged lines is one-way because expanding mutates the hunk structure. Add a corresponding collapse action so reviewers can re-fold expanded unchanged sections.
Requirements:
- Support both leading folded context and gaps between hunks.
- Restore the original hunk boundaries when collapsed.
- Work in both split and unified diff views.
- Preserve comment behavior and avoid breaking open comment forms on expanded lines.
Implementation note:
- Prefer storing expand/collapse as UI state instead of destructively merging
file.diffHunks.
Right now
Expand N unchanged linesis one-way because expanding mutates the hunk structure. Add a corresponding collapse action so reviewers can re-fold expanded unchanged sections.Requirements:
Implementation note:
file.diffHunks.