-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
File browser items in focus
state draw a rectangle around the itemText
node, which disappears when hovering on any menu
#14678
Comments
Any updates on this design feature? Can the behavior be reverted easily to jupyter 3.6.3 style behavior? |
GNOME file browser uses a subtle border colour change to differentiate focused from selected. The slight challenge here is that we also have checkboxes (hidden by default) so I guess this is why it is not an outline over the entire item but only over the file name. I do agree that this is suboptimal and a bit distracting. Suggestions welcome! |
Hmmm. I think at least my aesthetic issue could be resolved effectively with a css override that removes the outline properties from jupyter/packages/style/base.css? Or maybe I'm not quite getting the subtleties here?
|
I got rid of this by running a manual override in my web environment. Would there be a way to inject this when loading jupyterlab? Maybe in the ServerApp.extra_static_paths = [] config?
|
Together with a duplicate issue we got 6 reports that the current behaviour is annoying. I think that in the first instance we should change jupyterlab/packages/filebrowser/style/base.css Lines 279 to 288 in 558c60f
so that the browser auto-hides it when its heuristics show it is not relevant. CC @gabalafou as the author of #13577 and accessibility expert. |
Some possibilities for a different focus indicator are discussed in https://themesbycarolina.com/indicating-focus-without-outline/, one of which is using underline - it could look like: |
FWIW, I find the checkmark confusing. I like the "one of which is using underline" option best. |
I appreciate people looking into this. I would like to make a number of points to hopefully get us all on the same page. The current state of things
Guiding principleAs a guiding principle: a user should always be able to answer the question "which element on the page has focus?" in order for the site to meet the Web Content Accessibility Guidelines (refer to Understanding Success Criterion SC 2.4.7). Constraints to consider
Question@krassowski could you elaborate on this comment you made from before?
My two centsI am in favor of moving forward with one of the designs that Mike put forward, using one of those as a focus ring that always appears on focus, whether via keyboard or mouse (in other words, applying the focus indicator with |
My assumption was that the reason the focus ring was put around the file name rather than around the entire item was because user may need to distinguish between checkbox being focused and the item being focused. |
Thanks @gabalafou!
This is a good point.
Selection head and focus can be indicated with the same visual when element is focused, so as as an alternative we could use a hue+lightness combination:
The downside is that distinction between blue and grey (e.g.
I do not see it this way. I think that using
I believe it is expected NOT to show the focus ring when focusing an element with mousedown because if I am a user and clicked on an element with a mouse I do know which element is becoming focused because I just clicked on it ; on the other hand if I switched focus using Tab key it may have landed me on the active browser item and I might not immediately know that so I would want to see the focus ring. Can you point to a more specific argument against switching to
Probably worth adding tests for it then. |
Nope, no need to distinguish so long as we make sure that the space bar can be used to select a file and that the checked state of the checkbox matches the selected state of the file.
For the reasons you pointed out and others, it's considered bad practice to visually indicate semantically distinct states through the use of color alone. But I also think there's another problem here. How are we to communicate when a file is focussed but not selected? Imagine the user has selected file A, B, and the selection head is on C. So A and B are colored light blue, and C dark blue. But now the user wants to add file E to the selection and has to step over file D. Our user can only use a keyboard. So they press control + down arrow to move focus to (but not select) D and press control + down arrow again to move the focus to E. Then they add E to the selection by pressing the space bar. So now A, B, and C should be colored light blue. E should be dark blue I guess. But how should we have indicated focus earlier on D and E before E was selected? If we use light gray then I think that makes the use of gray ambiguous since as I understand it, gray is meant to indicate to the user that there are files selected in the file browser but that the focus is somewhere outside the file browser.
It's possible that the confusing behavior that I observed when I was implementing #13577 (and originally wanted to use I think somehow you may have gotten the opposite of the point that I was trying to make with my Codepen. I totally agree with you that a focus ring should not be shown on mousedown. And if you leave focus management up to the browser, that's what you generally get. But, as my Codepen demonstrates, you can get weird behavior from the browser if you call The other reason I opted for
Agreed. I will try to find some time this week to figure out and hopefully fix and test what broke. |
I created an issue about the file browser checkboxes and assigned myself #15819 |
The guidelines you link to specifically allows for use of hue+lightness though:
My mockup was not great with this respect but we could make the blurred state use lighter greys and dark text; further we could solve the blue vs grey limitation on that front by having an additional indicator on file listing level (focus-within).
Discontinuous selections 🎉 Yeah, I forgot about this. Let's have a think:
This seems to check all the boxes, even for achromatopsia. |
Right. I wasn't clear but I was referring specifically to your mockups and even more specifically to the fact that color (more specifically, hue) was being relied on too heavily to distinguish the left mockup from the right. But the newest set of mocks don't have that problem, so we are both on the same page here! 😃 I'm really liking this newest set of mockups. One thing I'm wondering though... if the user moves the (blue) focus ring into the selected area (by pressing control + up arrow), does the ring disappear and become a darker shade of blue to represent the selection head? Or does it become a white focus ring? To put my cards on the table, I'm a little concerned about changing how we indicate focus with respect to how we indicate selection. I think it's fine to make the focus ring surround the entire file instead of just the file name, and to change its color. I think it's also fine to try to get I say that because I spent many, many hours playing with keyboard-only file selection across different operating systems, and I learned that it's very tricky to get it to behave in ways that feel consistent and intuitive. For example, a naive implementation of a file browser would say that whenever the user holds down shift and presses the arrow key, then add to the selection. But operating systems use a more complicated rule, which is that shift + arrow adds to the selection unless the user is shift-arrowing into an already selected region of files and coming from an unselected region. When you throw discontinuous groups of selected files into the mix and the user shift-arrows across them, you quickly find yourself with questions about UI state transitions that don't have clear and obvious answers. What I'm saying is that I spent a very long time and was very careful about the way I implemented the file browser focus ring given the existing way to visually indicate selection. We can certainly try to create new and better ways to do this, but be warned: as they say, here be dragons. |
Is this an accurate representation of the current consensus plan moving forward?
|
#15860 is ready for review. |
Description
File browser items in
focus
state draw a rectangle around theitemText
node, which disappears when hovering on any menuReproduce
Select any item in the file browser and then hover over the top menu, or right click on the currently selected file. See attached gif.
Expected behavior
Two behaviors I'd expect:
focus
state in the file browser (Make file browser respond to focussed elements #13577), but perhaps there is a better way of indicating focus than drawing this rectangle around the object.focus
, then hovering over other files in the browser, which are currently not selected or clicked on, should follow the same logic as hovering over menu items.Context
The text was updated successfully, but these errors were encountered: