-
-
Notifications
You must be signed in to change notification settings - Fork 173
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: arrow-key navigation for chat list #4224
Conversation
42ec374
to
ec7dd25
Compare
Review by testing |
17803a1
to
b8dccfe
Compare
Rebased and adjusted comments. |
b8dccfe
to
2beb3ea
Compare
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 this should be an improvement.
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.
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.
2beb3ea
to
a563bda
Compare
Rebased |
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.
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.
@r10s could check the functional aspect of this MR? I want to start adding this everywhere in the app, namely in the accounts list, contact list, for various tabs (e.g. QR reader, emoji picker), in the gallery, and, most importantly, in the messages list. In separate MRs, of course. I want a green light so that I don't waste the efforts in case the entire approach is wrong. @nicodh and @maxphilippov could you also check if this is good code-wise? |
a563bda
to
2ce97e9
Compare
Rebased |
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.
This should allow us to more easily `setActiveElement` by its ID, without having a reference to `HTMLElement`, e.g. we can more easily set the initial chat list item. This issue was mentioned in #4224: > The initially "active" element is just the first chat item, > and not the currently selected chat.
2ce97e9
to
2d9214c
Compare
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.
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.
2d9214c
to
eaf80b5
Compare
Implements the "roving tabindex" approach: https://developer.mozilla.org/en-US/docs/Web/Accessibility/Keyboard-navigable_JavaScript_widgets#technique_1_roving_tabindex. Supersedes #4211. This improves things, but the UX as a whole is not great yet: - The tab order is such that the chat list does not immediately follow the search field, so you have to tab through the other navbar items before you get to the chat list. Same for going back from the chat list to the search bar. - The initially "active" element is just the first chat item, and not the currently selected chat. - Since the chat list is "virtualized", the currently active element might get removed from DOM when the user scrolls, thus we lose track of the item that was last selected. Related: #2784
eaf80b5
to
17c8184
Compare
This should allow us to more easily `setActiveElement` by its ID, without having a reference to `HTMLElement`, e.g. we can more easily set the initial chat list item. This issue was mentioned in #4224: > The initially "active" element is just the first chat item, > and not the currently selected chat.
This should allow us to more easily `setActiveElement` by its ID, without having a reference to `HTMLElement`, e.g. we can more easily set the initial chat list item. This issue was mentioned in #4224: > The initially "active" element is just the first chat item, > and not the currently selected chat.
This should allow us to more easily `setActiveElement` by its ID, without having a reference to `HTMLElement`, e.g. we can more easily set the initial chat list item. This issue was mentioned in #4224: > The initially "active" element is just the first chat item, > and not the currently selected chat.
roving-tabindex.mp4
Implements the "roving tabindex" approach:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/Keyboard-navigable_JavaScript_widgets#technique_1_roving_tabindex.
Supersedes #4211.
This improves things, but the UX as a whole is not great yet:
immediately follow the search field,
so you have to tab through the other navbar items
before you get to the chat list.
Same for going back from the chat list to the search bar.
This can be addressed by HTML semantics: move navbars inside the "chat list" and "chat" sections #4225
and not the currently selected chat.
I can fix it, in a separate MR. I left a TODO.
might get removed from DOM when the user scrolls,
thus we lose track of the item that was last selected.
This is pretty hard to fix. Our virtualization library does not have nice API for this, but luckily IMO this drawback is not that impactful.
Related: #2784
TODO:
If it looks and behaves good in general, I'll proceed with fixing the abovementioned issues, and adding this to other places, such as contact lists and the account list, in separate MRs perhaps.