Skip to content

[ML] Fix missing accessible labels on scatterplot matrix form controls#264962

Merged
alexwizp merged 10 commits intomainfrom
copilot/ml-results-explorer-fix-switch-title
Apr 29, 2026
Merged

[ML] Fix missing accessible labels on scatterplot matrix form controls#264962
alexwizp merged 10 commits intomainfrom
copilot/ml-results-explorer-fix-switch-title

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

Closes: #264955

The "Random scoring" and "Dynamic size" switches in the Results Explorer scatterplot matrix announce as "Off, off, switch" to screen readers instead of including their descriptive titles, violating WCAG 4.1.2 (Name, Role, Value).

  • Set label to the descriptive title ('Random scoring' / 'Dynamic size') with showLabel={false} so the label is visually hidden but exposed to assistive technology. The switch role communicates on/off state via aria-checked.
  • Removed the OptionLabelWithIconTip component and moved tooltip icons into EuiFormRow's labelAppend prop, so all form row labels are plain text strings with proper accessibility association.
  • Removed now-unused TOGGLE_ON/TOGGLE_OFF constants and their translation entries.

Screen readers will now announce: "Random scoring, off, switch".

Fixes the "Random scoring" and "Dynamic size" switch buttons in the
ML Results Explorer to use descriptive labels (`showLabel={false}`)
so screen readers announce the title (e.g., "Random scoring, off, switch")
instead of just "Off, off, switch".

Removes unused TOGGLE_ON/TOGGLE_OFF constants and their translations.

Agent-Logs-Url: https://github.com/elastic/kibana/sessions/933567f0-653f-4427-98dc-724292467a02

Co-authored-by: alexwizp <20072247+alexwizp@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing title for switch button in results explorer [ML] Fix missing accessible labels on scatterplot matrix switch buttons Apr 22, 2026
Copilot AI requested a review from alexwizp April 22, 2026 10:05
Copy link
Copy Markdown
Contributor

@alexwizp alexwizp left a comment

Choose a reason for hiding this comment

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

@copilot You need to do:

  • remove OptionLabelWithIconTip
  • move icon with tooltip into EuiFormRow -> labelAppend prop.
  • remove label prop from EuiComboBox'es

@alexwizp
Copy link
Copy Markdown
Contributor

@copilot fix

…nd for tooltips

Address reviewer feedback:
- Remove OptionLabelWithIconTip component and interface
- Move tooltip icons into EuiFormRow labelAppend prop
- Use plain text strings for EuiFormRow labels for proper accessibility

Agent-Logs-Url: https://github.com/elastic/kibana/sessions/3c3e3474-81fc-4464-af07-d41e9a912d85

Co-authored-by: alexwizp <20072247+alexwizp@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 23, 2026

@copilot You need to do:

  • remove OptionLabelWithIconTip...

Done in 10ebffc. Removed OptionLabelWithIconTip component, moved tooltip icons to EuiFormRow labelAppend prop, and all form row labels are now plain text strings.

@copilot fix

Fixed in 10ebffc.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ci-stats.kibana.dev
    • Triggering command: /home/REDACTED/.nvm/versions/node/v22.22.0/bin/node /home/REDACTED/.nvm/versions/node/v22.22.0/bin/node scripts/yarn_install_scripts.js run ldd 0.8.2 (dns block)
    • Triggering command: /home/REDACTED/.nvm/versions/node/v22.22.0/bin/node /home/REDACTED/.nvm/versions/node/v22.22.0/bin/node scripts/kbn bootstrap (dns block)
    • Triggering command: /home/REDACTED/.nvm/versions/node/v22.22.0/bin/node node scripts/check_changes.ts yp-bin/ldd /lib/ld-linux.so.2 s/li�� /home/REDACTED/.cache/ms-playwright/firefox-1511/firefox/libmozwayland.so (dns block)
  • clients3.google.com
    • Triggering command: /home/REDACTED/work/kibana/kibana/node_modules/@moonrepo/core-linux-x64-gnu/moon /home/REDACTED/work/kibana/kibana/node_modules/@moonrepo/core-linux-x64-gnu/moon run :build-webpack ldd 0.8.2 (dns block)
  • detectportal.firefox.com
    • Triggering command: /home/REDACTED/work/kibana/kibana/node_modules/@moonrepo/core-linux-x64-gnu/moon /home/REDACTED/work/kibana/kibana/node_modules/@moonrepo/core-linux-x64-gnu/moon run :build-webpack ldd 0.8.2 (dns block)
  • google.com
    • Triggering command: /home/REDACTED/work/kibana/kibana/node_modules/@moonrepo/core-linux-x64-gnu/moon /home/REDACTED/work/kibana/kibana/node_modules/@moonrepo/core-linux-x64-gnu/moon run :build-webpack ldd 0.8.2 (dns block)
  • googlechromelabs.github.io
    • Triggering command: /home/REDACTED/.nvm/versions/node/v22.22.0/bin/node /home/REDACTED/.nvm/versions/node/v22.22.0/bin/node install.js ndor/bin/git ldd b/li�� nibrowser-gtk/sys/lib/libjxl.so.0.8 (dns block)
  • iojs.org
    • Triggering command: /usr/bin/curl curl -q --fail --compressed -L -s REDACTED -o - (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [ML] Fix missing accessible labels on scatterplot matrix switch buttons [ML] Fix missing accessible labels on scatterplot matrix form controls Apr 23, 2026
Copilot AI requested a review from alexwizp April 23, 2026 08:23
@alexwizp alexwizp marked this pull request as ready for review April 24, 2026 10:33
@alexwizp alexwizp requested a review from a team as a code owner April 24, 2026 10:33
@elastic elastic deleted a comment from infra-vault-gh-plugin-prod Bot Apr 24, 2026
@alexwizp alexwizp added Project:Accessibility release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels v9.4.0 a11y:agent-pr PR has been created by the agent v9.5.0 and removed 💝community labels Apr 24, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

@alexwizp alexwizp left a comment

Choose a reason for hiding this comment

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

LGTM tested locally

Image

@alexwizp
Copy link
Copy Markdown
Contributor

/ci

@alexwizp
Copy link
Copy Markdown
Contributor

/ci

@alexwizp
Copy link
Copy Markdown
Contributor

/ci

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 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
ml 5.8MB 5.8MB -152.0B

History

cc @alexwizp @Copilot

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/ml-ui (:ml)

@peteharverson peteharverson self-requested a review April 27, 2026 08:28
@alexwizp
Copy link
Copy Markdown
Contributor

/ci

Copy link
Copy Markdown
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

Thanks for picking this one up @alexwizp ! The a11y fix for the screenreader works great, but left a comment around the positioning of the EuiIconTip.

label={i18n.translate('xpack.ml.splom.fieldSelectionLabel', {
defaultMessage: 'Fields',
})}
labelAppend={
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you see if you can get the EuiIconTip positioned directly next to the form input label as it was previously? Otherwise with the right align positioning, the help tooltip is less discoverable and seems out of context.

Before:

Image

With this change:

Image

This is probably achievable with a CSS override to target the label / label append wrapper div / span and change its justify-content.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@peteharverson Yes, I understand your concern. On the other hand, I’m not sure that overriding styles is a good idea. The current solution is fully in line with EUI recommendations.

Let me explain why we initially decided to move that out from the main label. The value of the main label is used as an aria attribute for EuiSwitch, and as a result, the tooltip was included in the announcement when the switch changed.

However, if you feel strongly about keeping the previous design, I think we can adjust the aria attributes a bit to make it work. But again, for now, the correct approach is to use the appendLabel

@alexwizp
Copy link
Copy Markdown
Contributor

@peteharverson code was updated

image

@alexwizp alexwizp requested a review from peteharverson April 28, 2026 14:41
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 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
ml 5.8MB 5.8MB -144.0B

History

cc @alexwizp @Copilot

Copy link
Copy Markdown
Contributor

@peteharverson peteharverson 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 LGTM. Thanks for making those changes @alexwizp !

@alexwizp alexwizp merged commit 622954a into main Apr 29, 2026
16 checks passed
@alexwizp alexwizp deleted the copilot/ml-results-explorer-fix-switch-title branch April 29, 2026 16:55
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.3, 9.4

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 Some backports could not be created

Status Branch Result
9.3 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.3:
- Add aria-labelledby to Console Config settings controls (#265207)
- [ES|QL controls] Add MV_INTERSECTS to multi-select control callout (#264353)
9.4

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 264962

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Apr 29, 2026
…ontrols (#264962) (#266474)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[ML] Fix missing accessible labels on scatterplot matrix form
controls (#264962)](#264962)

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

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

<!--BACKPORT
[{"author":{"name":"Copilot","email":"198982749+Copilot@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-04-29T16:55:14Z","message":"[ML]
Fix missing accessible labels on scatterplot matrix form controls
(#264962)\n\nCloses:
https://github.com/elastic/kibana/issues/264955\n\nThe \"Random
scoring\" and \"Dynamic size\" switches in the Results
Explorer\nscatterplot matrix announce as \"Off, off, switch\" to screen
readers\ninstead of including their descriptive titles, violating WCAG
4.1.2\n(Name, Role, Value).\n\n- Set `label` to the descriptive title
(`'Random scoring'` / `'Dynamic\nsize'`) with `showLabel={false}` so the
label is visually hidden but\nexposed to assistive technology. The
switch role communicates on/off\nstate via `aria-checked`.\n- Removed
the `OptionLabelWithIconTip` component and moved tooltip icons\ninto
`EuiFormRow`'s `labelAppend` prop, so all form row labels are
plain\ntext strings with proper accessibility association.\n- Removed
now-unused `TOGGLE_ON`/`TOGGLE_OFF` constants and their\ntranslation
entries.\n\nScreen readers will now announce: **\"Random scoring, off,
switch\"**.\n\n---------\n\nCo-authored-by: copilot-swe-agent[bot]
<198982749+Copilot@users.noreply.github.com>\nCo-authored-by: alexwizp
<20072247+alexwizp@users.noreply.github.com>\nCo-authored-by: Alexey
Antonov
<alexwizp@gmail.com>","sha":"622954a75aac673d5f0aa51f04ef3d5651c02bb3","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Project:Accessibility",":ml","release_note:skip","backport:version","v9.4.0","a11y:agent-pr","v9.5.0","v9.3.4"],"title":"[ML]
Fix missing accessible labels on scatterplot matrix form
controls","number":264962,"url":"https://github.com/elastic/kibana/pull/264962","mergeCommit":{"message":"[ML]
Fix missing accessible labels on scatterplot matrix form controls
(#264962)\n\nCloses:
https://github.com/elastic/kibana/issues/264955\n\nThe \"Random
scoring\" and \"Dynamic size\" switches in the Results
Explorer\nscatterplot matrix announce as \"Off, off, switch\" to screen
readers\ninstead of including their descriptive titles, violating WCAG
4.1.2\n(Name, Role, Value).\n\n- Set `label` to the descriptive title
(`'Random scoring'` / `'Dynamic\nsize'`) with `showLabel={false}` so the
label is visually hidden but\nexposed to assistive technology. The
switch role communicates on/off\nstate via `aria-checked`.\n- Removed
the `OptionLabelWithIconTip` component and moved tooltip icons\ninto
`EuiFormRow`'s `labelAppend` prop, so all form row labels are
plain\ntext strings with proper accessibility association.\n- Removed
now-unused `TOGGLE_ON`/`TOGGLE_OFF` constants and their\ntranslation
entries.\n\nScreen readers will now announce: **\"Random scoring, off,
switch\"**.\n\n---------\n\nCo-authored-by: copilot-swe-agent[bot]
<198982749+Copilot@users.noreply.github.com>\nCo-authored-by: alexwizp
<20072247+alexwizp@users.noreply.github.com>\nCo-authored-by: Alexey
Antonov
<alexwizp@gmail.com>","sha":"622954a75aac673d5f0aa51f04ef3d5651c02bb3"}},"sourceBranch":"main","suggestedTargetBranches":["9.4","9.3"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/264962","number":264962,"mergeCommit":{"message":"[ML]
Fix missing accessible labels on scatterplot matrix form controls
(#264962)\n\nCloses:
https://github.com/elastic/kibana/issues/264955\n\nThe \"Random
scoring\" and \"Dynamic size\" switches in the Results
Explorer\nscatterplot matrix announce as \"Off, off, switch\" to screen
readers\ninstead of including their descriptive titles, violating WCAG
4.1.2\n(Name, Role, Value).\n\n- Set `label` to the descriptive title
(`'Random scoring'` / `'Dynamic\nsize'`) with `showLabel={false}` so the
label is visually hidden but\nexposed to assistive technology. The
switch role communicates on/off\nstate via `aria-checked`.\n- Removed
the `OptionLabelWithIconTip` component and moved tooltip icons\ninto
`EuiFormRow`'s `labelAppend` prop, so all form row labels are
plain\ntext strings with proper accessibility association.\n- Removed
now-unused `TOGGLE_ON`/`TOGGLE_OFF` constants and their\ntranslation
entries.\n\nScreen readers will now announce: **\"Random scoring, off,
switch\"**.\n\n---------\n\nCo-authored-by: copilot-swe-agent[bot]
<198982749+Copilot@users.noreply.github.com>\nCo-authored-by: alexwizp
<20072247+alexwizp@users.noreply.github.com>\nCo-authored-by: Alexey
Antonov
<alexwizp@gmail.com>","sha":"622954a75aac673d5f0aa51f04ef3d5651c02bb3"}},{"branch":"9.3","label":"v9.3.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: alexwizp <20072247+alexwizp@users.noreply.github.com>
Co-authored-by: Alexey Antonov <alexwizp@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y:agent-pr PR has been created by the agent backport:version Backport to applied version labels :ml Project:Accessibility release_note:skip Skip the PR/issue when compiling release notes v9.3.4 v9.4.0 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ML] Results explorer: Switch button missing title from announcement

5 participants