microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.18k stars 29.28k forks source link

Configuration option or extension for dynamic resize of side bar contents #96150

Closed eamondo2 closed 4 years ago

eamondo2 commented 4 years ago

This is a bit of a specific tweak I am looking for. I'm running VSCode - Insiders on Linux (Ubuntu 19.10) for reference.

In the left-hand pane (the "side-bar") the drop-down containers (for files in Explorer context or the "Recommended" and "Enabled" containers for lists of options) often the lowest container contains only two or three options, while the upper container overflows into a scrollable interface.

I am looking for an option that allows dynamic vertical resizing of these containers, e.g the topmost container which is overflowing would be allowed to consume vertical space enough such that the "unused" space of the lower containers is absorbed.

While I'm fairly certain that this can be accomplished via some CSS injection or overrides of the base application itself, I'm not sure how best to go about it while allowing potential "pinning" of the vertical divisions, or configuring the option via settings.

Most of the time I run into this problem when using the "Explorer" view in the side-pane, the list of files overflows the bottom while the sub-menus (either provided by extensions or outline info) have blank unused space.

For more technical detail:

I know that each container is of class type split-view, contained within split-view-container in the left-hand pane. I know of some CSS tricks that would automatically resize the class's vertical spacing based on content, but am not sure how nicely that would play with different containers and potentially those provided by extensions. Currently, the pane class contains the individual container blocks, and is set up as a display: flex; element, set to vertical scaling.

I've fiddled with modifying the rendered CSS some, but have been unable to get a stable tweak implemented that allows for content length based scaling.

Any suggestions/tips would be appreciated, Thanks!

joaomoreno commented 4 years ago

While this is indeed an often case, it is definitely not the only case. Especially now that one can move views around. What if there are two views with scrollable content? Or three? Most views are that way.

BTW: This can't be achieved with CSS, since the splitview uses JS for layouting.

@sbatten The splitview has enough API to support this, if necessary, let me know if you need more.