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

Keyboard tab navigation #921

Merged
merged 5 commits into from
May 10, 2022
Merged

Conversation

narickmann
Copy link
Contributor

Added keyboard tab navigation.
Selected item/element is highlighted with an orange outline/border.
All elements should be accessible via keyboard (except for the svg-icon at the moment, still in progress)

Added keyboard tab navigation.
Selected item/element is highlighted with an orange outline/border.
All elements should be accessible via keyboard (except for the svg-icon at the moment, still in progress)
Copy link
Member

@LukasKalbertodt LukasKalbertodt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THANKS for being the person that finally tackles this :D

While this is certainly already an improvement over the current status, I noticed some things and left some comments. If you have any more questions about those, just ask.

src/style/global-style.js Outdated Show resolved Hide resolved
src/style/global-style.js Outdated Show resolved Hide resolved
/* Remove the focus indicator on mouse-focus for browsers
that do support :focus-visible */
outline: none !important;
background: transparent;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why background: transparent?

I also observed that a red button, when focused, appears green:

image

Could this be related?

src/style/global-style.js Outdated Show resolved Hide resolved
src/style/global-style.js Outdated Show resolved Hide resolved
@lkiesow
Copy link
Contributor

lkiesow commented Apr 11, 2022

Here are a few things I found in addition to Lukas' review:

studio-tab-navigation.mp4

Changes:
- Highlight-Color changed
- every element should now be reachable and selectable/clickable via keyboard
- added a few tabindex=-1 for elements, that should not be reachable via keyboard (and are also not clickable via mouse)
Copy link
Member

@LukasKalbertodt LukasKalbertodt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding functionality, this is much better. I think everything can be used now with keyboard alone. And no elements are moving around anymore, so that's also good! The remaining comments are just about the design/style.

One major bug is that the buttons, when focused, are still always green (even if they were white or red before). Not sure why that happens, but it should be fixed.

Regarding design, my suggestion would be:

  • Remove the box-shadow completely (I know, I suggested it in the first place :P)
  • For the links in the header (recording, settings, about), I would set outline: orange solid 3px and outline-offset: -3px. For orange you can choose a more specific tone, but I think literally orange works quite well, too.
  • For the settings cog icon button to open video settings, maybe pick a specific style as well. Maybe that's too subtle without the box-shadow?

Of course, this means we have either a dark green outline or an orange one, depending on the element. But personally, I don't think that's a problem. And it's certainly good to see IMO!


*:focus-visible {
outline: 2px solid #286244 !important;
box-shadow: 0 0 5px 3px inset #8ec8aa !important;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm not a fan of the blur :/ I would use a blur of 0. But also, apparently I was wrong and outline works fine with border-radius. So maybe there is no use for box-shadow at all anymore.

}

*:focus-visible {
outline: 2px solid #286244 !important;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In chrome, the download button has a outline-offset: 1px from the user agent style, for some strange reason. Resulting in:

image

So maybe just add outline-offset: 0 here?

Comment on lines 48 to 49


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two empty lines could be removed I guess.

@@ -422,7 +427,7 @@ const RadioButton = ({ id, value, checked, name, onChange, label, state }) => {
},
}}
/>
<label htmlFor={id}>{ label || value }</label>
<label tabIndex={isExpanded ? '0' : '-1'} onKeyDown={e => (e.key === 'Enter' || e.key === ' ' ) && onChange(value)} htmlFor={id}>{ label || value }</label>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a long line, I would break it up.

Suggested change
<label tabIndex={isExpanded ? '0' : '-1'} onKeyDown={e => (e.key === 'Enter' || e.key === ' ' ) && onChange(value)} htmlFor={id}>{ label || value }</label>
<label
tabIndex={isExpanded ? '0' : '-1'}
onKeyDown={e => (e.key === 'Enter' || e.key === ' ' ) && onChange(value)}
htmlFor={id}
>{ label || value }</label>

- removed box-shadow
- adjusted colors for dark and light background
- adjusted colors for buttons
Logo is now accessible via keyboard.
Small bug fixed (navigation bar could be controlled via keyboard during recording.)
Copy link
Member

@LukasKalbertodt LukasKalbertodt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the design now. I think it's usable and looks good.

Only one last thing: the button color on hover. I'd suggest:

  • Remove background-color: #f5f5f5 !important;

  • In theme.js, on roughly line 85 (buttons -> danger), behind &:not(:disabled):hover, add ,&:not(:disabled):focus. So that it reads:

    '&:not(:disabled):hover,&:not(:disabled):focus': {
      bg: darken('error', 0.03)
    }
    
  • Do the same for line roughly 94 (buttons -> text)

This is the bug that made the danger button background green. It was introduced in #902. It would be great if you could fix it!

And then I'm very happy with this.

- removed background-color from global-style.js
- added '&:not(:disabled):focus' to buttons and text in theme.js
Copy link
Member

@LukasKalbertodt LukasKalbertodt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy now ^_^ Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants