There are no expand controls before the first hunk or after the last hunk. GitHub and GitLab both allow expanding context in these regions, which is useful for seeing surrounding code.
Desired behavior: Show an expand-down control before the first hunk (to reveal lines 1 through hunk start) and an expand-up control after the last hunk (to reveal lines from hunk end through EOF). Expand in 20-line increments, consistent with #334.
Implementation notes:
- Both
renderDiffUnified and renderDiffSplit only render spacers when hi > 0 — need to add leading/trailing spacer calls outside the loop
renderDiffSpacer assumes a real prevHunk exists (click handler does hunks[prevIdx].Lines.concat()), so the leading spacer needs a special code path that prepends to hunk 0 rather than merging two hunks
file.content is available after load, so total line count for the trailing spacer is accessible via file.content.split('\n').length
- Purely frontend — no backend changes needed
Refs #320
There are no expand controls before the first hunk or after the last hunk. GitHub and GitLab both allow expanding context in these regions, which is useful for seeing surrounding code.
Desired behavior: Show an expand-down control before the first hunk (to reveal lines 1 through hunk start) and an expand-up control after the last hunk (to reveal lines from hunk end through EOF). Expand in 20-line increments, consistent with #334.
Implementation notes:
renderDiffUnifiedandrenderDiffSplitonly render spacers whenhi > 0— need to add leading/trailing spacer calls outside the looprenderDiffSpacerassumes a realprevHunkexists (click handler doeshunks[prevIdx].Lines.concat()), so the leading spacer needs a special code path that prepends to hunk 0 rather than merging two hunksfile.contentis available after load, so total line count for the trailing spacer is accessible viafile.content.split('\n').lengthRefs #320