jupyterlab / jupyterlab

JupyterLab computational environment.
https://jupyterlab.readthedocs.io/
Other
14.18k stars 3.39k forks source link

Large empty space in file browser toolbar #14125

Open krassowski opened 1 year ago

krassowski commented 1 year ago

Description

Screenshot from 2023-03-04 11-25-16

Reproduce

  1. Open file browser
  2. Resize the sidebar to dimensions as on screenshot

Expected behavior

Space is utilised efficiently.

Context

JasonWeill commented 1 year ago

On tip of master, I see the search box appear to the right of the "reload" button when the file browser is expanded to 473px wide:

image

At 455 px or narrower, I see it on a separate line.

JasonWeill commented 1 year ago

@krassowski What is the expected behavior? Do you want the search box to get progressively smaller beyond its current min. width? Should it eventually collapse to an icon, and then when the icon is clicked, it expands to allow text input?

GabrielaVives commented 1 year ago

When the icon is clicked, I would expect the whole panel to expand to allow space for the text box to reach its min. width. Was that what you were thinking about @JasonWeill ?

JasonWeill commented 1 year ago

@GabrielaVives I think that expanding the panel may be a visually jarring change. Instead, what about reducing the search/filter box to a very small size:

image

… then, when the user clicks on it, expand it and make the other buttons invisible, and add a collapser that makes the other buttons visible again:

image

krassowski commented 1 year ago

This seems like a good idea @JasonWeill but with a minor adjustment: because the filter stays active, collapsing it back would introduce hidden state and require us to add an indicator. So instead of ">" collapse button on the left I would suggest x on the right which would clear the filter and collapse the filter field.

JasonWeill commented 1 year ago

We may need both, if collapsing the filter keeps it active. (We would then have to modify the collapsed filter control to indicate that a filter is active.

amzon-ex commented 1 year ago

Just a minor suggestion: you could also check if the search box is empty and is focused. If empty and not in focus > collapse; in all other cases, keep it expanded until user explicitly closes it.

As another suggestion, you could keep the search box in the second row all the time, and let both the search box and the buttons take up all the space in the sidepanel (grow and shrink as required).