Skip to content
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

Enable scrolling tabs in tab bar in main area #12278

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

krassowski
Copy link
Member

@krassowski krassowski commented Mar 27, 2022

References

Fixes #10305, depends on jupyterlab/lumino#297

TODO:

  • decide on the minimum tab width or make it into a setting
  • maybe reduce the scroll buttons
  • add active and pressed style to the buttons

Code changes

Adds a setting allowing to enable scrolling of tabs.

User-facing changes

Users can scroll:

  • by pressing the arrow buttons at the ends of tabs list (which only show up if the tab bar overflows)
  • by using browser built-in scrolling (e.g. Shift + mouse wheel; shift needed as this is left-right scrolling)
  • when dragging tabs by hovering over the arrow buttons

scrollbar

Backwards-incompatible changes

None

@krassowski krassowski added this to the 4.0 milestone Mar 27, 2022
@jupyterlab-probot
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@github-actions github-actions bot added Design System CSS pkg:application pkg:ui-components tag:CSS For general CSS related issues and pecadilloes labels Mar 27, 2022
@krassowski krassowski marked this pull request as draft March 27, 2022 23:24
@krassowski krassowski modified the milestones: 4.0, 3.4.0 Mar 28, 2022
@aiqc
Copy link

aiqc commented Mar 30, 2022

One thing to consider about width is the kernel status indicator:
image

it gets hidden when min width is too small
image

@krassowski
Copy link
Member Author

krassowski commented Apr 5, 2022

The proposed positioning of scroll buttons < and > is as in Firefox. Having the buttons on the ends allows to designate these buttons as dual purpose: scrolling on click and scrolling on hover when dragging tabs.

The potential downsides of having buttons at the ends are:

  • a mouse user might need to go back and forth between the edges of the screen (if they do not have a mouse wheel); however, we can expect that a sizable portion of JupyterLab users has the main area divided into multiple areas (as this is what distinguishes JupyterLab from Notebook), so the distance to be traversed will be on average much smaller than the width of the screen (and it is more likely that the scrolling will be needed when using multiple areas over a single area).
  • a keyboard-only user might need to press tab multiple times to navigate to the button scrolling in the other direction; we could think about alleviating this by binding left and right arrows to these buttons (when tabbar is focused).

Chrome had tab scrolling and scrolling buttons for over a year now (since Chrome 88 from Dec 2020), but differently to Firefox it is disabled by default (and buttons are next to each other). Chrome allows to choose the min-width behaviour between:

  • no min-width
  • pinned tab width (which is basically the width of an icon + padding)
  • "medium" width
  • "large" width
  • full size width

chrome-options

Firefox allows to set min-width in pixels (browser.tabs.tabMinWidth) and the default seems to be 76:

Screenshot from 2022-04-05 18-12-26

@ajbozarth
Copy link
Contributor

I'll make time to take a look at this and the lumino PR before end of week

@ajbozarth
Copy link
Contributor

Note: I left my review on the lumino PR

@krassowski krassowski modified the milestones: 4.2.0, 4.3.0 Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When too many tabs are open in a supanel they overflow
4 participants