Skip to content

Add gui.shrinkSidePanelsToContent option#5754

Open
stefanhaller wants to merge 2 commits into
masterfrom
dont-waste-space-in-accordion-mode
Open

Add gui.shrinkSidePanelsToContent option#5754
stefanhaller wants to merge 2 commits into
masterfrom
dont-waste-space-in-accordion-mode

Conversation

@stefanhaller

Copy link
Copy Markdown
Collaborator

In many cases some of the side panels show a lot of empty space; for example the branches panel when there is only a main branch. This gets worse when expandFocusedSidePanel is on (accordion mode), in which case the almost-empty panel gets even bigger when focused and steals valuable space from the other panels that do have something to show.

This PR adds a new gui.shrinkSidePanelsToContent option which causes side panels to never show more than their content (plus one blank line, so it's clear there's nothing more below). This means that panel heights are now dynamic and may change as their content changes; for example, when the working tree is clean the Files panel shows only two blank lines, but as you start changing file, it gets taller to show them.

The option is off by default because it takes some getting used to. It is also independent of the expandFocusedSidePanel option; that one just makes the effect even more pronounced.

stefanhaller and others added 2 commits July 2, 2026 11:29
The height thresholds that decide between the proportional layout and
the squashed layout (and, within the squashed layout, between 3-row and
1-row unfocused panels) were hard-coded constants tuned for the fixed
set of five side panels. Now that the panels are configurable, a layout
with fewer panels has less to fit, yet was still forced into the
squashed layout at the same height as five panels would be.

Scale the thresholds down in proportion to the panel count so a smaller
layout keeps using the proportional layout at smaller heights. Only ever
scale down: raising the thresholds for more panels would make them
squash sooner, which works against the reason someone adds panels in the
first place (they want to see them).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Accordion mode expands the focused side panel, but when that panel has
little content (an empty Files panel, a Branches panel with only master)
it just fills the extra height with blank space. The same waste happens
for any panel that gets more height than it has content to show.

When this option is enabled, each side panel is sized to its own content
(plus a blank line, so it's clear there's nothing more below) rather than
to an equal share of the height. The height a small panel gives up flows
to the panels that have more content than fits; those grow up to their
content and then scroll, weighted toward the focused panel in accordion
mode so the two features compose. Only when every panel fits with room to
spare is the leftover shared out equally, regardless of focus: enlarging
the focused panel there would reveal no more content and would only make
the panels jump around as the focus moves.

The option is independent of expandFocusedSidePanel and off by default.
The status panel, and the stash panel when unfocused, keep their fixed
one-line height as before.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@stefanhaller stefanhaller added the enhancement New feature or request label Jul 2, 2026
@viktorashi

viktorashi commented Jul 2, 2026

Copy link
Copy Markdown

expandFocusedSidePanel : false :
image

expandFocusedSidePanel: true "

image

ooh me likey

Thanks a ton, i couldn't have thought of it in the same way in #5689

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants