Skip to content

Unified Diff: Allow partial expansion of folded unchanged regions #2944

Description

@tobiasmelcher

Problem

When "Fold unchanged regions" is enabled, clicking the "Show N unchanged lines" bar expands the entire folded region at once. For large folded regions (e.g. "Show 868 unchanged lines"), this immediately reveals hundreds of lines, making it hard to incrementally explore context around a change.

GitHub's diff viewer, for comparison, offers "Expand upward" and "Expand downward" affordances that reveal a fixed number of lines (e.g. 5 or 10) at a time from either end of a collapsed region.

Expected Behavior

The "Show N unchanged lines" bar should offer partial expansion in addition to the existing full expansion:

  • Expand upward — reveal the next N lines above the nearest change.
  • Expand downward — reveal the next N lines below the nearest change.
  • The existing click-to-expand-all behaviour should be preserved.

The number of lines revealed per step should be consistent and ideally configurable or follow a sensible default (e.g. 5–10 lines).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions