-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Fixes Spaces Menu Keyboard and Screen Reader Navigation #134454
Fixes Spaces Menu Keyboard and Screen Reader Navigation #134454
Conversation
dff1718
to
f30a63b
Compare
a96db6a
to
6072c77
Compare
dfc5b47
to
0f00360
Compare
Awaiting #136405 to accommodate keyboard event args. |
Thanks for the ping! Seeing as the space selection menu uses an |
Thanks for checking this out @MichaelMarcialis! We're actually using EuiSelectable now. This PR is for refactoring from the context menu to use the selectable component. I am using the EUI Header example as reference, which does highlight the active space...so that perhaps is the confirmation I needed. |
Ah, great! The |
@MichaelMarcialis Is a checkmark necessary or highly preferred in this case? I've been following the style of the EUI Header example, which utilizes EuiSelectable without checkmarks, but with highlighting, to demonstrate the same purpose (spaces navigation in an application header). EDIT: I've added the checkmark, as item highlighting does not persist with keyboard navigation. |
…ard and mouse event details (shift, ctrl, middle click).
…messages of the Spaces selectable.
…tests for nav control popover. Eliminated tab selection of popover panel itself. Tested screen reader extensively with Chrome on Mac. Note: Safari screen reader and tabbing behavior is not consistent and differs significantly from Chrome.
…ions (shift, ctrl, etc.) is not yet working - event argument in selectable onChange is null for keyboard events.
Pinging @elastic/kibana-security (Team:Security) |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ML edit LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thanks for this. Tested locally and working as expected.
Couple minor comments.
...ugins/security/public/management/roles/edit_role/spaces_popover_list/spaces_popover_list.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/spaces/public/nav_control/nav_control_popover.tsx
Outdated
Show resolved
Hide resolved
...ugins/security/public/management/roles/edit_role/spaces_popover_list/spaces_popover_list.tsx
Show resolved
Hide resolved
…review feedback suggestions.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
…able. Resolved flaky test for spaces nav.
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! Looks good to me!
* Refactor of spaces pop-over using EuiSelectable. * Updated to use Eui type instead of interface. * Reorganization of code, began to add EuiSelectableOnChangeEvent usage. * Repathed import after rebase * Integrates the EuiSelectableOnChangeEvent argument to intercept keyboard and mouse event details (shift, ctrl, middle click). * Resolves missing property error in nav popover test. * Handles reintroduction of translated strings into empty and no match messages of the Spaces selectable. * Refactor of spaces_popover_list to use EuiSelectable, resolves keyboard navigation. * Updated tests for spaces popover list and created more comprehensive tests for nav control popover. Eliminated tab selection of popover panel itself. Tested screen reader extensively with Chrome on Mac. Note: Safari screen reader and tabbing behavior is not consistent and differs significantly from Chrome. * Adjuted focus behavior in popover. Rebased to use EUI 60.1.2 * Fixed typo in roles spaces popover list. Keyboard navigation with options (shift, ctrl, etc.) is not yet working - event argument in selectable onChange is null for keyboard events. * Updated comments. * Fixes issue with keyboard operation of manage spaces button of spaces_menu. Fixes naming of translated string resources in spaces_popover_list. * Fixes name of existing string reference in spaces_menu. * Fixes CSS selector calls in spaces functional test. * Fixes space selection in functional tests. * Fixes popover close issue on Manage spaces button click. Implements check for re-selecting active space. Implements popover close when opening a space in a new window. * Updated jest snapshot for spaces nav test. * Fixes ML functional tests to accommodate new behavior when selecting already active space. * Added active space highlight feedback. Removed state from spaces menu class. * Rebased, added check mark for active space, resolved activeOption keyboard nav break from EUI update * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * Fixes initial active space highlight which was caused by initial empty spaces state in nav_control_popover and loading render logic. Removes isLoading from spaces_menu - no longer necessary, SpacesDescription is now used during loading. * Added debug output of actual URL in route expects. * Added loading message to spaces navigation. * Updated jest snapshot. * Addressed flaky test behavior related to space menu nav. Implemented review feedback suggestions. * Adds sleep to functional test UI interactions. * Replaced use of any with ExclusiveUnion for search props of EuiSelectable. Resolved flaky test for spaces nav. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 31c2c0f)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…37859) * Refactor of spaces pop-over using EuiSelectable. * Updated to use Eui type instead of interface. * Reorganization of code, began to add EuiSelectableOnChangeEvent usage. * Repathed import after rebase * Integrates the EuiSelectableOnChangeEvent argument to intercept keyboard and mouse event details (shift, ctrl, middle click). * Resolves missing property error in nav popover test. * Handles reintroduction of translated strings into empty and no match messages of the Spaces selectable. * Refactor of spaces_popover_list to use EuiSelectable, resolves keyboard navigation. * Updated tests for spaces popover list and created more comprehensive tests for nav control popover. Eliminated tab selection of popover panel itself. Tested screen reader extensively with Chrome on Mac. Note: Safari screen reader and tabbing behavior is not consistent and differs significantly from Chrome. * Adjuted focus behavior in popover. Rebased to use EUI 60.1.2 * Fixed typo in roles spaces popover list. Keyboard navigation with options (shift, ctrl, etc.) is not yet working - event argument in selectable onChange is null for keyboard events. * Updated comments. * Fixes issue with keyboard operation of manage spaces button of spaces_menu. Fixes naming of translated string resources in spaces_popover_list. * Fixes name of existing string reference in spaces_menu. * Fixes CSS selector calls in spaces functional test. * Fixes space selection in functional tests. * Fixes popover close issue on Manage spaces button click. Implements check for re-selecting active space. Implements popover close when opening a space in a new window. * Updated jest snapshot for spaces nav test. * Fixes ML functional tests to accommodate new behavior when selecting already active space. * Added active space highlight feedback. Removed state from spaces menu class. * Rebased, added check mark for active space, resolved activeOption keyboard nav break from EUI update * [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' * Fixes initial active space highlight which was caused by initial empty spaces state in nav_control_popover and loading render logic. Removes isLoading from spaces_menu - no longer necessary, SpacesDescription is now used during loading. * Added debug output of actual URL in route expects. * Added loading message to spaces navigation. * Updated jest snapshot. * Addressed flaky test behavior related to space menu nav. Implemented review feedback suggestions. * Adds sleep to functional test UI interactions. * Replaced use of any with ExclusiveUnion for search props of EuiSelectable. Resolved flaky test for spaces nav. Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 31c2c0f) Co-authored-by: Jeramy Soucy <jeramy.soucy@elastic.co>
Fixes #130898
Summary
Refactor of the Spaces popover implementation using the EuiSelectable component. This component handles all of the focus, tabbing, and search behaviors innately - resolving previous navigation issues, and keeping a consistent UX in Kibana.
A relevant demonstration of the component can be found here.
Minor Behavior Change
When the user selects the already active space in the menu without any options (shift, ctrl/cmd, middle click), they will not be redirected to the home screen and instead remain on the current screen. The previous implementation would perform a full page redirect to the home screen, even if the user selected the space that is already active.
Testing Non-Searchable Mode:
Testing Searchable Mode:
Testing The Screen Reader:
Note: in my testing I found Safari to exhibit undesirable screen-reader and tabbing behavior both with the new Spaces navigation implementation and the above linked EUI demonstration.