kibana icon indicating copy to clipboard operation
kibana copied to clipboard

fix: Rules > Detection (SEIM) Rules][SCREEN READER]: Snooze notifications modal is not trapping VoiceOver + Safari properly

Open alexwizp opened this issue 1 year ago • 5 comments

Closes: https://github.com/elastic/security-team/issues/8716

Description

The Detection Rules table has a Snooze notifications modal that is not trapping focus consistently in Safari + VoiceOver. The focus is being "bounced" to the <main> container when I traverse using Ctrl + Opt + RIGHT_ARROW or quick arrow navigation methods. These are the default VO navigation methods. This is not affecting Chrome + JAWS or Firefox + NVDA. Screenshot and MOV attached below.

Steps to recreate

  1. Open Detection Rules (SIEM)
  2. Enable VoiceOver (only use Safari for this test)
  3. Tab to the first Snooze Notification bell icon and press Ctrl + Opt + Enter to open it
  4. Navigate through the modal by pressing Ctrl + Opt + Right_Arrow
  5. Verify when your focus should be on the "days" dropdown, it pops out to the main container, escaping the modal

What was done?

  1. Focus trap logic has been implemented to ensure that focus returns to the correct location after executing onRuleChanged.

Screen:

https://github.com/elastic/kibana/assets/20072247/1c8951df-828d-4c7d-8b2c-2ea5a4d5e400

alexwizp avatar May 06 '24 12:05 alexwizp

/ci

alexwizp avatar May 06 '24 12:05 alexwizp

Pinging @elastic/response-ops (Team:ResponseOps)

elasticmachine avatar May 06 '24 13:05 elasticmachine

Pinging @elastic/security-solution (Team: SecuritySolution)

elasticmachine avatar May 06 '24 13:05 elasticmachine

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

elasticmachine avatar May 06 '24 13:05 elasticmachine

:green_heart: Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
triggersActionsUi 1.6MB 1.6MB +1.0KB

History

  • :green_heart: Build #210425 succeeded 9a6aa261f3898ce380a816f384bb4b2691ad792a
  • :green_heart: Build #209589 succeeded 0db0393cebd7e551a2f81a6654c614ed2b8e1727
  • :green_heart: Build #209556 succeeded ec76542c246e0870c0e0d21b56da4cf60694e66d
  • :green_heart: Build #209359 succeeded bf5ca83056a7f43bdf925686ddb4aeb1c2577c08
  • :green_heart: Build #209124 succeeded 5ce7a319e88ebaeac6f5b2a226c7241f647240d2
  • :green_heart: Build #208902 succeeded 99342586625ec6a3ad8d68aa4151f45ace5366ca

To update your PR or re-run it, just comment with: @elasticmachine merge upstream

kibana-ci avatar May 19 '24 21:05 kibana-ci

Also, I noticed that if I set a schedule with the mouse the button will be focused and show a tooltip. Is this a behavior we want to do for users who do not navigate with the keyboard? @mdefazio Any opinion on this?

https://github.com/elastic/kibana/assets/7871006/2059ab2b-df0a-4aca-a85c-751fea3c0966

cnasikas avatar May 20 '24 09:05 cnasikas

@cnasikas Please correct me if I'm wrong. If I understand the business logic correctly, the Notify column can have one of three states (buttons): scheduledSnoozeButton, unsnoozedButton, and indefiniteSnoozeButton.

After calling onRuleChanged, the state changes, and the button where the EuiPopover was originally opened gets re-rendered to reflect the new state. This is what causes the problem, as the browser loses the current element and returns the focus to document.body.

How does that solution work? : As I mentioned at the beginning, in the UI we can have only one of the three buttons at a time. This means that if I set a single reference to all three buttons, this reference will ultimately point to the currently rendered element. Then, after calling onRuleChanged, we should wait a bit for the state to be rendered (requestAnimationFrame helps with that) and simply return focus to new rendered item.

Regarding the Tooltip question, its behavior has indeed changed. The button remains in focus, and this is a condition to show that tooltip. I don't know is we need somehow fix that or not.

alexwizp avatar May 20 '24 10:05 alexwizp

Thank you @alexwizp for your detailed answer and your patience with me.

This means that if I set a single reference to all three buttons, this reference will ultimately point to the currently rendered element

This was not clear to me. Thanks for clarifying!

Regarding the Tooltip question, its behavior has indeed changed. The button remains in focus, and this is a condition to show that tooltip. I don't know is we need somehow fix that or not.

I am ok with the change. Let's wait for @mdefazio to hear his opinion on this before merging. Other than that LGTM!

cnasikas avatar May 20 '24 11:05 cnasikas

@cnasikas Thanks for the ping. I don't think showing the tooltip/keeping focus on the button is bad here. And since this is our default button behavior anyway, let's wait on doing anything extra here.

mdefazio avatar May 20 '24 11:05 mdefazio