Add gui.shrinkSidePanelsToContent option#5754
Merged
Merged
Conversation
7 tasks
|
ooh me likey Thanks a ton, i couldn't have thought of it in the same way in #5689 |
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>
6704168 to
a929f34
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


In many cases some of the side panels show a lot of empty space; for example the branches panel when there is only a
mainbranch. This gets worse whenexpandFocusedSidePanelis 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.shrinkSidePanelsToContentoption 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
expandFocusedSidePaneloption; that one just makes the effect even more pronounced.