Currently, clicking "Expand N unchanged lines" expands the entire gap at once and destructively merges the two adjacent hunks. For large gaps (hundreds of lines), this floods the view.
Desired behavior: Expand 20 lines per click, matching GitHub/GitLab conventions. Show directional controls (expand up / expand down) and an "expand all" option for the full gap.
Implementation approach:
- Instead of merging two hunks via
hunks.splice(prevIdx, 2, merged), insert a new context-only "bridge" hunk with the 20 expanded lines between the original hunks
- The spacer between the bridge and the next real hunk recalculates the remaining gap naturally
- Comments are keyed by line number (not hunk index), so they're unaffected
- Purely frontend change in
renderDiffSpacer (app.js) — no backend changes needed
Refs #320
Currently, clicking "Expand N unchanged lines" expands the entire gap at once and destructively merges the two adjacent hunks. For large gaps (hundreds of lines), this floods the view.
Desired behavior: Expand 20 lines per click, matching GitHub/GitLab conventions. Show directional controls (expand up / expand down) and an "expand all" option for the full gap.
Implementation approach:
hunks.splice(prevIdx, 2, merged), insert a new context-only "bridge" hunk with the 20 expanded lines between the original hunksrenderDiffSpacer(app.js) — no backend changes neededRefs #320