Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.8k
Make status bar accessible at 400% zoom by hiding items with priority of zero (default)#14854
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 ourterms of service andprivacy 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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thanks for making a pull request to jupyterlab! |
j264415 commentedAug 2, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Please could this PR be reviewed.@krassowski |
j264415 commentedAug 24, 2023
Please could this PR be reviewed.@gabalafou |
gabalafou left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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 aregisterStatusItem 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.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
j264415 commentedAug 31, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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. |
j264415 commentedSep 1, 2023
please update galata snapshot |
j264415 commentedSep 1, 2023
please update documentation snapshots |
Documentation snapshots updated. |
j264415 commentedSep 14, 2023
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. | ||
| returnwindow.innerWidth<=630; |
krassowskiDec 14, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
gabalafou left a comment
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 <gabriel@fouasnon.com>
for more information, seehttps://pre-commit.ci
Co-authored-by: gabalafou <gabriel@fouasnon.com>
Co-authored-by: gabalafou <gabriel@fouasnon.com>
j264415 commentedDec 15, 2023
Thank you for reviewing this ! |
gabalafou commentedDec 15, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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. |
krassowski commentedDec 15, 2023
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 |
krassowski left a comment
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!
krassowski commentedDec 20, 2023
@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 |
j264415 commentedDec 21, 2023
@krassowski All done. This is the PR:#15556 |

Uh oh!
There was an error while loading.Please reload this page.
References
Code changes
priorityargument is added toIStatusBar.IRankItem, which defaults to0User-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.