jupyterlab icon indicating copy to clipboard operation
jupyterlab copied to clipboard

Show outline on the full item in file browser, only when needed

Open krassowski opened this issue 2 years ago • 7 comments

References

Fixes https://github.com/jupyterlab/jupyterlab/issues/14678, supersedes #15802

Code changes

Use :focus-within and :focus-visible to target the intended state which minimizes user confusion.

User-facing changes

Selection with mouse, keyboard and editing file name:

after

Dis-continuous multi-selection with keyboard:

multi-select-behaviour

Backwards-incompatible changes

None

krassowski avatar Feb 23 '24 10:02 krassowski

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

jupyterlab-probot[bot] avatar Feb 23 '24 10:02 jupyterlab-probot[bot]

@krassowski I tried to use the binder link but it's broken...chat me sometime if you're free and would like to test.

ericsnekbytes avatar Feb 23 '24 20:02 ericsnekbytes

Binder just needs a lot of patience ;)

krassowski avatar Feb 23 '24 20:02 krassowski

It gave me some kind of invalid token error I believe...

ericsnekbytes avatar Feb 23 '24 20:02 ericsnekbytes

It gave me some kind of invalid token error I believe

@ericsnekbytes you just need to refresh the tab/open it again. Invalid token is when you open the build by navigation from browser after the token has expired.

Usually by the time the image gets built (and I have time to get back to it) the token expires so it just needs refreshing the tab/opening again.

krassowski avatar Feb 23 '24 20:02 krassowski

I checked with Firefox ESR 115.7.0, and the outline doesn't show up:

firefox

In Chrome 121.0.6167.184, the outline does appear:

chrome

JasonWeill avatar Feb 24 '24 01:02 JasonWeill

Firefox ESR 115.7.0

Yes, :has support was enabled in Firefox 121 (current version is 123).

krassowski avatar Feb 24 '24 02:02 krassowski

I'm also not seeing the outline with Safari (macOS) Version 17.3 (18617.2.4.11.11, 18617), which, per caniuse.com, should support :has.

JasonWeill avatar Feb 26 '24 18:02 JasonWeill

I can reproduce that on Safari 17.3 it does not work after clicking and then navigating, but it does work on edges and when tabbing into the file browser from outside (and then navigating). It looks like the Safari Bug 234077: [selectors] :focus-visible not matching on accessKey focus after focusing something via mouse but it is said to have been fixed in 2022. It might be a slightly different variant of that bug in Safari.

What does not work What works
safari-works safari-ok-works

krassowski avatar Feb 26 '24 19:02 krassowski

This might be the issue @gabalafou was speaking of. What do we think about adding a custom class like .jp-mod-last-focused-by-keyboard and using it together with standard :focus instead of :focus-visible to have more consistent user experience across browsers? The alternative is acknowledging that even in Safari it works for all-keyboard workflow so it is still accessible where needed most.

krassowski avatar Feb 26 '24 19:02 krassowski

I feel like this still represents an improvement for usability and accessibility, and if we're using standards-compliant design, the fault isn't with JupyterLab if a browser doesn't comply.

JasonWeill avatar Feb 26 '24 21:02 JasonWeill

@meeseeksdev please backport to 4.1.x

krassowski avatar Mar 13 '24 09:03 krassowski