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

fix: [Obs Alert Rules > Rule Detail][KEYBOARD]: N Alerts and N Active Now elems must both be keyboard focsuable #186529

Merged
merged 25 commits into from
Jul 25, 2024

Conversation

alexwizp
Copy link
Contributor

@alexwizp alexwizp commented Jun 20, 2024

Closes: https://github.com/elastic/observability-dev/issues/3371

Description

The Obs Alert Rule Detail view has a card that is clickable with a focusable element inside it. This is a confusing paradigm and prevents keyboard users from filtering by all alerts because it's not focusable. It would be better to make the two alert number widgets the focusable elements. Screenshot attached below.

PR is based on the following comment posted by @1Copenut in https://github.com/elastic/observability-dev/issues/3371#issuecomment-2129446431_

@alexwizp Agreed, panels should not be focusable. The highlighted panel is clickable, and that was unexpected. I could click the entire panel, and click the "1 Active now" text to filter by all alerts or active alerts in the table below.

It would be better to have the "All alerts" text be clickable and focusable, and keep the "1 Active now" clickable and focusable. That way the two text blocks have the interactive behavior, while the panel (card) is just a container.

Steps to recreate

  1. Open the Obs Alerts table
  2. Click the "Manage Rules" link
  3. Create a new rule and verify it appears in the Rules table
  4. Click on the rule name to load the Rule Detail view
  5. Verify the 1 Active Now

What was done?:

  1. The click event was REMOVED from the panel and has been moved to All alerts.
  2. aria-describedby attributes were added for AllAlertCounts and ActiveAlertCounts
  3. h3 attributes were replaced to EuiTitle in AllAlertCounts and ActiveAlertCounts

@alexwizp
Copy link
Contributor Author

/ci

@alexwizp
Copy link
Contributor Author

/ci

@alexwizp
Copy link
Contributor Author

/ci

@alexwizp
Copy link
Contributor Author

/ci

@alexwizp alexwizp added Project:Accessibility v8.15.0 release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Jun 21, 2024
@alexwizp alexwizp marked this pull request as ready for review June 21, 2024 08:32
@alexwizp alexwizp requested review from a team as code owners June 21, 2024 08:32
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-accessibility (Project:Accessibility)

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Jun 21, 2024
@maryam-saeidi
Copy link
Member

The Obs Alert Rule Detail view has a card that is clickable with a focusable element inside it. This is a confusing paradigm and prevents keyboard users from filtering by all alerts because it's not focusable. It would be better to make the two alert number widgets the focusable elements
image

This implementation was based on the original design by @maciejforcone.
This PR removes the ability to click the panel and instead adds the click functionality to the 1 Alerts, so I tag our designer, @maciejforcone, here to get his feedback.

@maciejforcone
Copy link

This implementation was based on the original design by @maciejforcone. This PR removes the ability to click the panel and instead adds the click functionality to the 1 Alerts, so I tag our designer, @maciejforcone, here to get his feedback.

I think the problem here is that this was a widget to place in other observability areas, like service details, host details, etc, in compact format, almost like button size. In rule it's a bit different story.
So for consistency, let's stick with clickability of text only, and no shadowbox (for entire section), so that user is not missing anything.

Copy link
Member

@maryam-saeidi maryam-saeidi left a comment

Choose a reason for hiding this comment

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

Code LGTM, I've just added a nit. Thanks for fixing this!

I am going to test locally now.

event: MouseEvent<HTMLAnchorElement | HTMLDivElement>,
status?: AlertStatus
) => void;
}

export const AlertCounts = ({ activeAlertCount, recoveredAlertCount, onActiveClick }: Props) => {
/** @internal **/
const AlertItem = ({
Copy link
Member

@maryam-saeidi maryam-saeidi Jun 21, 2024

Choose a reason for hiding this comment

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

nit: What about moving this logic to a separate file and then using it directly in AllAlertCounts and ActiveAlertCounts?

In that case, we can also move onAllClick and onActiveClick to the respective components.
In the current implementation, we have some parts of the allAlerts/activeAlerts logic here and some parts of it in the children components.

So, in the end, the component here will look something like:

<EuiFlexGroup gutterSize="l" responsive={false}>
    <AllAlertCounts count={activeAlertCount + recoveredAlertCount} onClick={onAllClick} data-test-subj="allAlerts" />
    <ActiveAlertCounts activeAlertCount={activeAlertCount} onClick={onActiveClick} data-test-subj="activeAlerts" />
</EuiFlexGroup>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@maryam-saeidi, could you please review the latest changes? I'm unsure if we need both AllAlertCounts and ActiveAlertCounts. I've decided to retain only AlertItem to remove duplication.

Copy link
Member

@maryam-saeidi maryam-saeidi left a comment

Choose a reason for hiding this comment

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

Tested locally and worked as expected!

@alexwizp
Copy link
Contributor Author

alexwizp commented Jul 8, 2024

@elastic/response-ops please review

@alexwizp alexwizp added v8.16.0 and removed v8.15.0 labels Jul 8, 2024
@alexwizp
Copy link
Contributor Author

@elastic/response-ops please review

@alexwizp
Copy link
Contributor Author

@elastic/response-ops please review

@alexwizp
Copy link
Contributor Author

@elastic/response-ops please review

@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 19, 2024

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
triggersActionsUi 803 802 -1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 120.4KB 120.3KB -135.0B

History

@kibana-ci
Copy link
Collaborator

kibana-ci commented Jul 24, 2024

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #100 / Screenshots - serverless observability UI response ops docs observability cases Observability case settings case settings screenshots

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
triggersActionsUi 803 802 -1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 120.4KB 120.3KB -135.0B

History

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

Copy link
Contributor

@adcoelho adcoelho left a comment

Choose a reason for hiding this comment

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

Tested and works as expected 👍

@alexwizp alexwizp merged commit 631baa3 into elastic:main Jul 25, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project Project:Accessibility release_note:skip Skip the PR/issue when compiling release notes v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants