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

improvement: improve a11y #4210

Merged
merged 28 commits into from
Nov 1, 2024
Merged

improvement: improve a11y #4210

merged 28 commits into from
Nov 1, 2024

Conversation

WofWca
Copy link
Collaborator

@WofWca WofWca commented Oct 12, 2024

Most of the commits are independent, thus they can be reviewed and merged / cherry-picked separately. Let me know which particular commits you reviewed, or up to which point, and I'll make a separate MR to merge only those.

I have tried to make sure to not introduce UI / style regressions.

Things that need more testing:

  • Contact lists (8060471) We have a lot of places where they are used, and I might have introduced a regression somewhere, though I tested quite a lot of places.

@WofWca WofWca force-pushed the wofwca/a11y-2 branch 2 times, most recently from a00b4fd to dcdc7db Compare October 12, 2024 14:07
@WofWca WofWca force-pushed the wofwca/a11y-2 branch 4 times, most recently from 82467f1 to b0d6655 Compare October 21, 2024 10:47
@WofWca WofWca marked this pull request as ready for review October 21, 2024 10:50
@WofWca WofWca force-pushed the wofwca/a11y-2 branch 10 times, most recently from 78885b4 to c926e84 Compare October 25, 2024 17:34
Copy link
Contributor

@nicodh nicodh left a comment

Choose a reason for hiding this comment

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

By testing, reading "some"n of the commits & talking to WofWca.

Should be merged AFTER next release (based on test release 1.147)!

@WofWca
Copy link
Collaborator Author

WofWca commented Oct 29, 2024

Rebased

WofWca added a commit that referenced this pull request Oct 30, 2024
Closes #2141

Basically what this commit comes down to:
1. Apply `useRovingTabindex` for message items
2. Set `tabindex="-1"` on all the interactive items
    inside every message that is currently not the active one,
    so that they do no have tab stops.

TODO:
- [ ] Address the TODOs in the code
- [ ] Manage what's gonna be the initially active message,
    because initially they're all active, so
    tabbing to the messages list from the top selects
    the first rendered one as the active one.
    #4292
    could help with this.
    This is also not great for performance: changing `tabindex`
    on a bunch of messages makes them all re-render.
    And otherwise, we probably want to update which one is
    the active one as new messages arrive.
- [ ] The interactive items with `onClick` must be actual semantic
    `<button>`s.
    See #4210
    for reference.
WofWca added a commit that referenced this pull request Oct 30, 2024
Closes #2141

Basically what this commit comes down to:
1. Apply `useRovingTabindex` for message items
2. Set `tabindex="-1"` on all the interactive items
    inside every message that is currently not the active one,
    so that they do no have tab stops.

TODO:
- [ ] Address the TODOs in the code
- [ ] Manage what's gonna be the initially active message,
    because initially they're all active, so
    tabbing to the messages list from the top selects
    the first rendered one as the active one.
    #4292
    could help with this.
    This is also not great for performance: changing `tabindex`
    on a bunch of messages makes them all re-render.
    And otherwise, we probably want to update which one is
    the active one as new messages arrive.
- [ ] The interactive items with `onClick` must be actual semantic
    `<button>`s.
    See #4210
    for reference.
WofWca added 26 commits November 1, 2024 16:31
Partially addresses #4127

FYI the `@mixin button-reset` is actually only used in one place.
In `FullscreenMedia` and `FullscreenAvatar`
Reactions dialog items, that is.
I have manually checked all the `<input`s and ensured
that we do not apply `outline` to text inputs
(althought whether we want that is debatable).
This is quite a significant change.
I tested a lot of placed where the affected code is used,
but still might have missed some regression.

And perhaps the behavior is still not ideal in some places,
but it's better to assess it in its final form after we add
[the roving tabindex functionality (arrow key accessibility)](#4224).
Either way I think this is an improvement.
Make it not close on keyboard "clicks".
As the new comment mentions, we currently also apply this mixin
to elements that are not buttons, so `cursor: pointer` is not
applicable there.
We apply `cursor: pointer;` to `<button>` elements in another file,
there is no need to add it here.
IMO it's still a bit hacky,
but at least now it's keyboard-accessible.
@WofWca WofWca merged commit 78fef8b into main Nov 1, 2024
7 checks passed
@WofWca WofWca deleted the wofwca/a11y-2 branch November 1, 2024 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants