Skip to content

Auto-fix violations of the @elastic/eui/require-aria-label-for-modals ESLint rule#227623

Merged
alexwizp merged 22 commits intoelastic:mainfrom
alexwizp:jul11-1
Jul 24, 2025
Merged

Auto-fix violations of the @elastic/eui/require-aria-label-for-modals ESLint rule#227623
alexwizp merged 22 commits intoelastic:mainfrom
alexwizp:jul11-1

Conversation

@alexwizp
Copy link
Copy Markdown
Contributor

@alexwizp alexwizp commented Jul 11, 2025

Caution

⚠️ Changes were made by GenAI. Please review carefully.

Note

Only EuiConfirmModal part

Summary

This PR applies the auto-fix for the newly introduced @elastic/eui/require-aria-label-for-modals Ensures that EUI modal components EuiConfirmModal have either an aria-label or aria-labelledby prop for accessibility. This helps screen reader users understand the purpose and content of modal dialogs.

Changes

  • For function components:
    1. Verify whether useGeneratedHtmlId is imported from the @elastic/eui package. If not, add the following import.
    2. Inside the render method, define a new constant: const confirmModalTitleId = useGeneratedHtmlId();
  • For class components:
    1. Verify whether htmlIdGenerator is imported from the @elastic/eui package. If not, add the following import.
    2. Inside the render method, define a new constant: const confirmModalTitleId = htmlIdGenerator()('confirmModalTitle');

In both cases, add the following props to the EuiConfirmModal component:

  • aria-labelledby={confirmModalTitleId}
  • titleProps={{ id: confirmModalTitleId }}

Related

@alexwizp alexwizp marked this pull request as ready for review July 14, 2025 08:18
@alexwizp alexwizp requested review from a team as code owners July 14, 2025 08:18
@alexwizp alexwizp requested a review from a team July 14, 2025 08:18
@alexwizp alexwizp requested review from a team as code owners July 14, 2025 08:18
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Jul 23, 2025

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #93 / alerting api integration security and spaces enabled - Group 2 Alerts alert deletion schedule alert deletion space_1_all at space1 should delete the correct of alerts - observability active and inactive alerts

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
alerting 91.4KB 91.6KB +142.0B
apm 2.6MB 2.6MB +335.0B
canvas 1.1MB 1.1MB +67.0B
console 193.9KB 194.0KB +67.0B
contentConnectors 470.1KB 470.4KB +297.0B
crossClusterReplication 137.6KB 138.0KB +425.0B
data 61.5KB 61.6KB +134.0B
datasetQuality 418.5KB 418.5KB +67.0B
dataViewFieldEditor 99.6KB 99.7KB +148.0B
dataViewManagement 120.1KB 120.3KB +233.0B
discover 1.1MB 1.1MB +67.0B
enterpriseSearch 1.1MB 1.1MB +634.0B
fleet 2.1MB 2.1MB +1.6KB
graph 370.9KB 371.0KB +87.0B
imageEmbeddable 111.4KB 111.4KB +67.0B
indexLifecycleManagement 161.9KB 162.0KB +153.0B
indexManagement 678.1KB 678.8KB +773.0B
infra 1.0MB 1.0MB +67.0B
lens 1.5MB 1.5MB +205.0B
licenseManagement 32.1KB 32.2KB +99.0B
maps 3.1MB 3.1MB +361.0B
ml 5.4MB 5.4MB +1.2KB
monitoring 630.7KB 630.8KB +172.0B
observability 1.3MB 1.3MB +207.0B
observabilityAIAssistantApp 175.9KB 176.0KB +81.0B
osquery 1.0MB 1.0MB +309.0B
remoteClusters 71.1KB 71.2KB +85.0B
reporting 166.3KB 166.4KB +85.0B
rollup 103.7KB 103.8KB +85.0B
savedObjectsManagement 75.2KB 75.2KB +68.0B
searchAssistant 102.4KB 102.5KB +81.0B
searchIndices 198.2KB 198.2KB +67.0B
searchInferenceEndpoints 96.7KB 96.8KB +68.0B
searchQueryRules 121.3KB 121.4KB +135.0B
searchSynonyms 52.1KB 52.3KB +135.0B
security 502.5KB 503.2KB +743.0B
securitySolution 9.8MB 9.8MB +1.5KB
serverlessSearch 323.0KB 323.2KB +149.0B
slo 975.7KB 976.1KB +402.0B
snapshotRestore 249.9KB 250.2KB +335.0B
spaces 209.1KB 209.3KB +215.0B
streamsApp 592.6KB 592.6KB +67.0B
synthetics 1.0MB 1.0MB +274.0B
transform 621.8KB 622.4KB +631.0B
triggersActionsUi 1.5MB 1.5MB +819.0B
unifiedSearch 339.5KB 339.6KB +140.0B
upgradeAssistant 203.7KB 203.8KB +67.0B
uptime 491.1KB 491.5KB +363.0B
visualizations 350.7KB 350.8KB +87.0B
workchatApp 126.2KB 126.2KB +68.0B
total +14.4KB

Page load bundle

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

id before after diff
dataViewFieldEditor 23.1KB 23.2KB +67.0B
elasticAssistant 273.2KB 273.3KB +135.0B
fleet 170.7KB 170.8KB +81.0B
indexLifecycleManagement 26.5KB 26.7KB +170.0B
triggersActionsUi 105.6KB 105.6KB +52.0B
total +505.0B

History

@alexwizp
Copy link
Copy Markdown
Contributor Author

@elastic/kibana-security, @elastic/obs-ux-logs-team, @elastic/security-entity-analytics please review

Copy link
Copy Markdown
Contributor

@abhishekbhatia1710 abhishekbhatia1710 left a comment

Choose a reason for hiding this comment

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

LGTM from entity-analytics side

@alexwizp alexwizp merged commit f0dbc67 into elastic:main Jul 24, 2025
13 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.1

https://github.com/elastic/kibana/actions/runs/16491971648

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 24, 2025
… ESLint rule (elastic#227623)

> [!CAUTION]
> ⚠️ Changes were made by GenAI. Please review carefully.

> [!NOTE]
> Only `EuiConfirmModal` part

## Summary
This PR applies the auto-fix for the newly introduced
`@elastic/eui/require-aria-label-for-modals` Ensures that EUI modal
components `EuiConfirmModal` have either an `aria-label` or
`aria-labelledby` prop for accessibility. This helps screen reader users
understand the purpose and content of modal dialogs.

## Changes

- For **function components**:
1. Verify whether `useGeneratedHtmlId` is imported from the
`@elastic/eui` package. If not, add the following import.
2. Inside the render method, define a new constant: `const
confirmModalTitleId = useGeneratedHtmlId();`
- For **class components**:
1. Verify whether `htmlIdGenerator` is imported from the `@elastic/eui`
package. If not, add the following import.
2. Inside the render method, define a new constant: `const
confirmModalTitleId = htmlIdGenerator()('confirmModalTitle');`

In both cases, add the following props to the `EuiConfirmModal`
component:
- `aria-labelledby={confirmModalTitleId}`
- `titleProps={{ id: confirmModalTitleId }}`

## Related
- elastic/eui#8843

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit f0dbc67)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
`@elastic/eslint-plugin-eui`: `2.0.0` ⏩ `2.1.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Changes

This PR updates the `@elastic/eslint-plugin-eui` version to latest:
[`v2.1.0`](https://www.npmjs.com/package/@elastic/eslint-plugin-eui/v/2.1.0)

### `@elastic/eui/require-aria-label-for-modals` (fixed with GenAI:
elastic#227623)

Ensures that EUI modal components (`EuiModal`, `EuiFlyout`,
`EuiConfirmModal`) have either an `aria-label` or `aria-labelledby` prop
for accessibility. This helps screen reader users understand the purpose
and content of modal dialogs.

### `@elastic/eui/consistent-is-invalid-props` (auto-fix available)

Ensures that form control components within `EuiFormRow` components have
matching `isInvalid` prop values. This maintains consistent validation
state between parent form rows and their child form controls, leading to
a more predictable and accessible user experience.

### `@elastic/eui/sr_output_disabled_tooltip` (auto-fix available)

Ensures `disableScreenReaderOutput` is set when `EuiToolTip` content
matches `EuiButtonIcon`'s `aria-label`.

> [!NOTE]
> `@elastic/eui/sr_output_disabled_tooltip` will be renamed to
`@elastic/eui/sr-output-disabled-tooltip` for consistent rule naming.

## Package updates

### `@elastic/eslint-plugin-eui`

- Added new `sr_output_disabled_tooltip` rule.
([elastic#8848](elastic/eui#8848))
- Added new `consistent-is-invalid-props` rule.
([elastic#8843](elastic/eui#8843))
- Added new `require-aria-label-for-modals` rule.
([elastic#8811](elastic/eui#8811))
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 25, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @alexwizp

kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
… ESLint rule (elastic#227623)

> [!CAUTION]
> ⚠️ Changes were made by GenAI. Please review carefully.

> [!NOTE]
> Only `EuiConfirmModal` part

## Summary
This PR applies the auto-fix for the newly introduced
`@elastic/eui/require-aria-label-for-modals` Ensures that EUI modal
components `EuiConfirmModal` have either an `aria-label` or
`aria-labelledby` prop for accessibility. This helps screen reader users
understand the purpose and content of modal dialogs.

## Changes

- For **function components**:
1. Verify whether `useGeneratedHtmlId` is imported from the
`@elastic/eui` package. If not, add the following import.
2. Inside the render method, define a new constant: `const
confirmModalTitleId = useGeneratedHtmlId();`
- For **class components**:
1. Verify whether `htmlIdGenerator` is imported from the `@elastic/eui`
package. If not, add the following import.
2. Inside the render method, define a new constant: `const
confirmModalTitleId = htmlIdGenerator()('confirmModalTitle');`

In both cases, add the following props to the `EuiConfirmModal`
component:
- `aria-labelledby={confirmModalTitleId}`
- `titleProps={{ id: confirmModalTitleId }}`

## Related
- elastic/eui#8843

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @alexwizp

2 similar comments
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @alexwizp

@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @alexwizp

eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Jul 31, 2025
… ESLint rule (elastic#227623)

> [!CAUTION]
> ⚠️ Changes were made by GenAI. Please review carefully.

> [!NOTE]
> Only `EuiConfirmModal` part

## Summary
This PR applies the auto-fix for the newly introduced
`@elastic/eui/require-aria-label-for-modals` Ensures that EUI modal
components `EuiConfirmModal` have either an `aria-label` or
`aria-labelledby` prop for accessibility. This helps screen reader users
understand the purpose and content of modal dialogs.

## Changes

- For **function components**:
1. Verify whether `useGeneratedHtmlId` is imported from the
`@elastic/eui` package. If not, add the following import.
2. Inside the render method, define a new constant: `const
confirmModalTitleId = useGeneratedHtmlId();`
- For **class components**:
1. Verify whether `htmlIdGenerator` is imported from the `@elastic/eui`
package. If not, add the following import.
2. Inside the render method, define a new constant: `const
confirmModalTitleId = htmlIdGenerator()('confirmModalTitle');`

In both cases, add the following props to the `EuiConfirmModal`
component:
- `aria-labelledby={confirmModalTitleId}`
- `titleProps={{ id: confirmModalTitleId }}`

## Related
- elastic/eui#8843

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @alexwizp

1 similar comment
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @alexwizp

kibanamachine added a commit that referenced this pull request Aug 1, 2025
…modals ESLint rule (#227623) (#229259)

# Backport

This will backport the following commits from `main` to `9.1`:
- [Auto-fix violations of the @elastic/eui/require-aria-label-for-modals
ESLint rule (#227623)](#227623)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Alexey
Antonov","email":"alexwizp@gmail.com"},"sourceCommit":{"committedDate":"2025-07-24T08:36:00Z","message":"Auto-fix
violations of the @elastic/eui/require-aria-label-for-modals ESLint rule
(#227623)\n\n> [!CAUTION]\n> ⚠️ Changes were made by GenAI. Please
review carefully.\n\n> [!NOTE]\n> Only `EuiConfirmModal` part\n\n##
Summary\nThis PR applies the auto-fix for the newly
introduced\n`@elastic/eui/require-aria-label-for-modals` Ensures that
EUI modal\ncomponents `EuiConfirmModal` have either an `aria-label`
or\n`aria-labelledby` prop for accessibility. This helps screen reader
users\nunderstand the purpose and content of modal dialogs.\n\n##
Changes\n\n- For **function components**:\n1. Verify whether
`useGeneratedHtmlId` is imported from the\n`@elastic/eui` package. If
not, add the following import.\n2. Inside the render method, define a
new constant: `const\nconfirmModalTitleId = useGeneratedHtmlId();`\n-
For **class components**:\n1. Verify whether `htmlIdGenerator` is
imported from the `@elastic/eui`\npackage. If not, add the following
import.\n2. Inside the render method, define a new constant:
`const\nconfirmModalTitleId =
htmlIdGenerator()('confirmModalTitle');`\n\nIn both cases, add the
following props to the `EuiConfirmModal`\ncomponent:\n-
`aria-labelledby={confirmModalTitleId}`\n- `titleProps={{ id:
confirmModalTitleId }}`\n\n## Related\n-
elastic/eui#8843\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"f0dbc67c4c1d2ad236a0fb9f65815df2b5aeaae5","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Project:Accessibility","release_note:skip","Team:Fleet","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services","Team:obs-ux-management","v9.2.0"],"title":"Auto-fix
violations of the @elastic/eui/require-aria-label-for-modals ESLint
rule","number":227623,"url":"https://github.com/elastic/kibana/pull/227623","mergeCommit":{"message":"Auto-fix
violations of the @elastic/eui/require-aria-label-for-modals ESLint rule
(#227623)\n\n> [!CAUTION]\n> ⚠️ Changes were made by GenAI. Please
review carefully.\n\n> [!NOTE]\n> Only `EuiConfirmModal` part\n\n##
Summary\nThis PR applies the auto-fix for the newly
introduced\n`@elastic/eui/require-aria-label-for-modals` Ensures that
EUI modal\ncomponents `EuiConfirmModal` have either an `aria-label`
or\n`aria-labelledby` prop for accessibility. This helps screen reader
users\nunderstand the purpose and content of modal dialogs.\n\n##
Changes\n\n- For **function components**:\n1. Verify whether
`useGeneratedHtmlId` is imported from the\n`@elastic/eui` package. If
not, add the following import.\n2. Inside the render method, define a
new constant: `const\nconfirmModalTitleId = useGeneratedHtmlId();`\n-
For **class components**:\n1. Verify whether `htmlIdGenerator` is
imported from the `@elastic/eui`\npackage. If not, add the following
import.\n2. Inside the render method, define a new constant:
`const\nconfirmModalTitleId =
htmlIdGenerator()('confirmModalTitle');`\n\nIn both cases, add the
following props to the `EuiConfirmModal`\ncomponent:\n-
`aria-labelledby={confirmModalTitleId}`\n- `titleProps={{ id:
confirmModalTitleId }}`\n\n## Related\n-
elastic/eui#8843\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"f0dbc67c4c1d2ad236a0fb9f65815df2b5aeaae5"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227623","number":227623,"mergeCommit":{"message":"Auto-fix
violations of the @elastic/eui/require-aria-label-for-modals ESLint rule
(#227623)\n\n> [!CAUTION]\n> ⚠️ Changes were made by GenAI. Please
review carefully.\n\n> [!NOTE]\n> Only `EuiConfirmModal` part\n\n##
Summary\nThis PR applies the auto-fix for the newly
introduced\n`@elastic/eui/require-aria-label-for-modals` Ensures that
EUI modal\ncomponents `EuiConfirmModal` have either an `aria-label`
or\n`aria-labelledby` prop for accessibility. This helps screen reader
users\nunderstand the purpose and content of modal dialogs.\n\n##
Changes\n\n- For **function components**:\n1. Verify whether
`useGeneratedHtmlId` is imported from the\n`@elastic/eui` package. If
not, add the following import.\n2. Inside the render method, define a
new constant: `const\nconfirmModalTitleId = useGeneratedHtmlId();`\n-
For **class components**:\n1. Verify whether `htmlIdGenerator` is
imported from the `@elastic/eui`\npackage. If not, add the following
import.\n2. Inside the render method, define a new constant:
`const\nconfirmModalTitleId =
htmlIdGenerator()('confirmModalTitle');`\n\nIn both cases, add the
following props to the `EuiConfirmModal`\ncomponent:\n-
`aria-labelledby={confirmModalTitleId}`\n- `titleProps={{ id:
confirmModalTitleId }}`\n\n## Related\n-
elastic/eui#8843\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"f0dbc67c4c1d2ad236a0fb9f65815df2b5aeaae5"}}]}]
BACKPORT-->

---------

Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
@kibanamachine kibanamachine added v9.1.1 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Aug 1, 2025
delanni pushed a commit to delanni/kibana that referenced this pull request Aug 5, 2025
… ESLint rule (elastic#227623)

> [!CAUTION]
> ⚠️ Changes were made by GenAI. Please review carefully.

> [!NOTE]
> Only `EuiConfirmModal` part

## Summary
This PR applies the auto-fix for the newly introduced
`@elastic/eui/require-aria-label-for-modals` Ensures that EUI modal
components `EuiConfirmModal` have either an `aria-label` or
`aria-labelledby` prop for accessibility. This helps screen reader users
understand the purpose and content of modal dialogs.

## Changes

- For **function components**:
1. Verify whether `useGeneratedHtmlId` is imported from the
`@elastic/eui` package. If not, add the following import.
2. Inside the render method, define a new constant: `const
confirmModalTitleId = useGeneratedHtmlId();`
- For **class components**:
1. Verify whether `htmlIdGenerator` is imported from the `@elastic/eui`
package. If not, add the following import.
2. Inside the render method, define a new constant: `const
confirmModalTitleId = htmlIdGenerator()('confirmModalTitle');`

In both cases, add the following props to the `EuiConfirmModal`
component:
- `aria-labelledby={confirmModalTitleId}`
- `titleProps={{ id: confirmModalTitleId }}`

## Related
- elastic/eui#8843

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:project-deploy-observability Create an Observability project Project:Accessibility release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. Team:Fleet Team label for Observability Data Collection Fleet team Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. v9.1.1 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.