-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Make status bar accessible at 400% zoom by hiding items with priority of zero (default) #14854
Make status bar accessible at 400% zoom by hiding items with priority of zero (default) #14854
Conversation
Thanks for making a pull request to jupyterlab! |
Please could this PR be reviewed. @krassowski |
Please could this PR be reviewed. @gabalafou |
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.
While I think this PR has some great ideas, it also makes me uncomfortable because I feel like it's trying to achieve at the CSS level what should be achieved at the app/JS level.
For example, the StatusBar class provides a registerStatusItem
method. This method is used by extensions, including built-in extensions, to add items to the status bar, like so:
// Add the status item to the status bar.
statusBar.registerStatusItem(lineColItem.id, {
item,
align: 'right',
rank: 2,
isActive: () => !!item.model.editor
});
It seems to me that this is the point at which something like your "priority-zoom" property should be passed.
I also question some of the decisions about what is and isn't priority in this PR. To me the notification icon is a better use of space than the simple-mode toggle—both because the toggle takes up a lot of space and also because the same command can be accessed in two other ways, via the menu and via the command palette; also there are other more obvious cues about when the app is in simple mode or the not, so I'm not sure how much value is added by always showing that state in the status bar.
I also question how effective this approach is because, for example, here's a screenshot on my laptop with the UI zoomed to 400% and it shows that the changes in this PR have done nothing to help because my laptop screen at 400% does not trigger the at-media rule:

I agree that the status bar is too cluttered at narrow width and/or high zoom. But I'm not sure this is the way to solve it. Or maybe this is the right direction, maybe the items in the status bar need to indicate some priority-level, and then if the status bar doesn't have enough width for all of the items, it starts to remove the lower-priority ones. But I think that functionality probably needs to implemented at the level of the StatusBar TypeScript class.
…pyterlab into status-bar-zoom-accessibility
Hi @gabalafou looking at the comment you made above about implementing the changes that you want for the 400% zoom through the app/JS level and not CSS; I have made the relevant code changes required to achieve this. |
please update galata snapshot |
please update documentation snapshots |
Documentation snapshots updated. |
Hi @gabalafou could you please review the changes I have made from your feedback. |
private _isWindowZoomed = () => { | ||
// Check is the window width is less than or equal to 630px as this is when the staus bar become unaccessible to the user. | ||
// Works across all screen resolution. | ||
return window.innerWidth <= 630; |
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.
Question from @gabalafou on the call: is there a justification for this specific number?
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.
This number is because this is when the status bar starts to become inaccessible. The comment above has been reviewed by @gabalafou and changed to make the reasoning of this number clearer.
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.
Thank you for working on this! I added just a few suggestions to reflect the last changes in the comments and method names
Co-authored-by: gabalafou <[email protected]>
for more information, see https://pre-commit.ci
Co-authored-by: gabalafou <[email protected]>
Co-authored-by: gabalafou <[email protected]>
Thank you for reviewing this ! |
This looks good to go from my perspective. The only check failing is UI Tests / Visual Regression, which may be unrelated to this PR. If there are no objections, I will merge it in on Monday, December 18. |
Can you approve it? It seems there is still a an "X" from you. I often sort by approved when merging things before release.
I think they are unrelated, but I kicked it
I might merge it earlier to fit it in |
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.
Thank you @j264415!
@j264415 I updated the top-level comment's Code Changes and Backwards-incompatible changes sections. Please take note for future PRs that we need to keep them aligned with the content of the PR and they can be brief, as long as the key take-away messages are conveyed :) @j264415 can you please follow with another pull request adding a note to extension migration guide about the new |
@krassowski All done. This is the PR: #15556 |
References
Code changes
priority
argument is added toIStatusBar.IRankItem
, which defaults to0
User-facing changes
Currently with 400% zoom at 1280px the status bar elements overlap each other which hinders usability. Unrequired elements have been removed and the remaining elements no longer overlap at 320px apparent width (1280px/400%).
This means that when a window is below 320px apparent width, the kernel title, document name and the processor icons will be hidden from view to allow space for the simple switch and the line-column number to be fully visible and accessible. If future text elements are added these will also be hidden unless they are given the priority-zoom class.
Backwards-incompatible changes
Extensions which add custom status bar items may want to set custom priority greater than one if these need to be visible at narrow screens.