New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Responsive document toolbar #10720
Responsive document toolbar #10720
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
My slight preference would be to keep the items that indicate state (kernel name, kernel busy indicator, debugger toggle, cell type switch) visible as long as possible (hide them last). Would this be feasible to implement? What do others think? |
I had a slight inclination towards that idea while implementing this. It is definitely possible to implement, however I feel that it might increase the complexity of the code quite a bit without providing any huge benefit to users. Also, this code is quite general at the moment that it works for all toolbars, so it will require some kind of configuration added for all toolbars to define elements to hide last. Would love to hear feedback from others. |
50016dd
to
0f1fb34
Compare
We definitely should extend the metadata of toolbar items to add the ability to select which element should be hidden first. I see two paths:
I would favor the first approach as visibility importance will definitely depends on the user taste; so it should be customizable (don't worry about that here) and I think a simple primary / secondary approach will be easier to grasp than figure out the ranking of all items. cc @ellisonbg |
@fcollonval I do think that over time we need to tackle this question of additional metadata for toolbar items to help prioritze when different items get moved to the overflow toolbar. Adding another option to the list:
Full width: A few groups moved to the overflow: |
At the same time, I believe this PR is enough of an improvement, that we should merge it and iterate further to add sections and/or other metadata. |
0f1fb34
to
22831d2
Compare
22831d2
to
b2156c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge and iterate sounds good, thank you!
@krassowski @fcollonval Opened a new PR for further updates to responsive toolbar. |
References
This PR fixes the issue #10595
Code changes
Toolbar class has a new default button and a popup. The resize handler is added which keeps track of widths of items and moves them to the popup if the cumulative width increases toolbar width. Alternatively, if toolbar width is big enough to accommodate any widgets in the popup, they are moved back to the toolbar.
User-facing changes
Toolbar has a new default button and a popup that stores items that don't fit in the toolbar when the toolbar is resized.
Backwards-incompatible changes
None