Skip to content

Hide the diff minimap when the diff barely scrolls - #15343

Open
mtsgrd wants to merge 1 commit into
masterfrom
hide-minimap-on-short-diffs
Open

Hide the diff minimap when the diff barely scrolls#15343
mtsgrd wants to merge 1 commit into
masterfrom
hide-minimap-on-short-diffs

Conversation

@mtsgrd

@mtsgrd mtsgrd commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

The minimap ruler took a column on every diff, including ones a flick of the
wheel covers, where it says nothing the native scrollbar does not. Below three
windows of content it now stands down.

Expressed as a null geometry rather than a new flag: getMinimapGeometry
already returns null for "nothing worth mapping", so this path hides the ruler
and hands the scrollbar back with no new wiring — both the CSS and the geometry
doc already described this case, it was simply never enforced.

The threshold is measured in windows to match MAX_MAP_TRACKS next door, where
a track is a ruler-full. A window of zero is a pane that hasn't been laid out
yet rather than a short diff, so it is excluded from the test; the resize that
gives the pane a height brings the map back.

The ruler took a column on every diff, including ones a flick of the wheel
covers, where it says nothing the native scrollbar does not. Below three
windows of content it now stands down.

Expressed as a null geometry rather than a new flag: that is already the
"nothing worth mapping" path, so it hides the ruler and hands the scrollbar
back with no new wiring — both the CSS and the geometry doc already described
this case, it was simply never enforced. Measured in windows to match
MAX_MAP_TRACKS next door, where a track is a ruler-full.
@mtsgrd
mtsgrd marked this pull request as ready for review August 17, 2026 09:55
Copilot AI lite review requested due to automatic review settings August 17, 2026 09:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Lite diff minimap so it automatically hides (by returning null geometry) when the diff content is short enough that the native scrollbar provides sufficient navigation, restoring the scrollbar in those cases without adding new flags or wiring.

Changes:

  • Introduces a “minimum mapped windows” threshold (MIN_MAPPED_WINDOWS = 3) to decide when the minimap is worth showing.
  • Updates getMinimapGeometry to return null when the total diff content height is less than 3× the viewer height (excluding the pre-layout height === 0 case).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants