Skip to content

[a11y] Fix missing aria-label on EuiButtonIcon in developer examples#258367

Merged
alexwizp merged 3 commits intomainfrom
copilot/fix-eslint-issue-reporter
Mar 18, 2026
Merged

[a11y] Fix missing aria-label on EuiButtonIcon in developer examples#258367
alexwizp merged 3 commits intomainfrom
copilot/fix-eslint-issue-reporter

Conversation

Copy link
Contributor

Copilot AI commented Mar 18, 2026

EuiButtonIcon in developer_examples/public/app.tsx lacked an accessible label, violating @elastic/eui/no-unnamed-interactive-element. Icon-only buttons are invisible to screen readers without an explicit label.

Changes

  • examples/developer_examples/public/app.tsx: Added aria-label="Open in new tab" to the EuiButtonIcon and removed the orphaned children text (unused by icon-only buttons); converted to self-closing tag.
- <EuiButtonIcon
-   iconType="popout"
-   onClick={...}
- >
-   Open in new tab
- </EuiButtonIcon>
+ <EuiButtonIcon
+   iconType="popout"
+   aria-label="Open in new tab"
+   onClick={...}
+ />
Original prompt

This section details on the original issue you should resolve

<issue_title>[eslint-issue-reporter] @elastic_appex-sharedux — fix @elastic_eui_no-unnamed-interactive-element</issue_title>
<issue_description>> [!NOTE]

Reserved for AI coding agents—please don’t take it manually.

Summary

This issue groups 1 ESLint violation for rule @elastic/eui/no-unnamed-interactive-element across 1 file for team @elastic/appex-sharedux. Latest monitoring snapshot: index kibana-eslint-20260318-014121, versions: 9.4.0 (Mar 18).

Why this issue exists

This is a grouped ESLint backlog item generated from the latest monitoring snapshot. One issue per (team, rule) keeps the backlog stable and actionable.

What to fix

Implement fixes in full alignment with Constitution and Skill below. Expand those blocks and treat every paragraph as normative—scope, change boundaries, WCAG, i18n, and rule-specific guidance override any approach that would clear ESLint but contradict them.

Rule: @elastic/eui/no-unnamed-interactive-element

EuiButtonIcon must include an accessible label. Use one of: aria-label, aria-labelledby 

Places to fix

Requirement: Fix every location in the checklist below—do not merge or close this issue until all listed places are addressed (the list may be capped by the reporter; still treat each listed item as mandatory).

  • examples/developer_examples/public/app.tsx — line 92

Pull request

When you open a PR for this work, apply the label a11y:agent-pr (required).

Constitution

Constitution for Skills

Scope and precedence

  • This constitution applies to every skill and every skill-driven fix in this repo.
  • When a SKILL adds narrower rules, follow both documents.
  • If there is a conflict, use this precedence order:
    1. task-specific user or system instruction
    2. this constitution
    3. the individual SKILL
  • Skill-specific guidance may narrow the allowed change set, but it must not weaken this constitution.

Core principles

Standards compliance

  • All changes must meet WCAG 2.2 AA at minimum.
  • Prefer semantic HTML over ARIA where possible.
  • Use WAI-ARIA only when native semantics are insufficient.

Minimal changes

  • Apply the smallest change that fully resolves the accessibility issue.
  • Avoid unnecessary refactoring.
  • Preserve existing behavior, layout, and intent unless the accessibility fix requires a change.

Deterministic behavior

  • Apply deterministic fixes: the same code pattern should produce the same result.
  • Avoid subjective or stylistic changes unless they are directly tied to accessibility.

Accessibility rules

  • Prefer existing visible text for accessible names whenever possible.
  • Reuse nearby labels, headings, button text, or other visible copy before introducing hidden text such as aria-label.
  • Do not remove existing accessibility attributes such as title, alt, aria-label, or aria-labelledby unless they are being replaced with a stronger or more correct alternative.
  • Prefer relationships to visible content, such as aria-labelledby, when that produces a clearer and more maintainable result.

i18n rules

  • Any new or replacement user-facing string, or any new or replacement string exposed to assistive technology as an accessible name, must use i18n.translate('message.id', { defaultMessage: 'English fallback' }).
  • Do not introduce that copy as a raw string literal.
  • If the file already uses a shared i18n object such as i18nTexts.modalTitle, keep that pattern for new strings in that file.
  • Do not localize programmatic identifiers that are not user-visible, such as radio group name values.
  • Add an i18n import only when you introduce a new i18n.translate(...) call.
  • Place new imports at the top of the file and merge them with existing imports from the same package.
  • Reuse existing translation IDs when the same message already exists in the file.
  • Follow the local translation ID naming convention when one exists.
  • If no local naming convention exists, use <fileOrComponent>.<attributeName>, for example myTable.tableCaption or myButton.ariaLabel.
  • Keep defaultMessage short, user-facing, and consistent with the surrounding UI.
  • Do not create duplicate translation IDs with different defaultMessage values in the same file.

Example

<EuiButtonIcon
  aria-label={i18n.translate('myButton.ariaLabel', {
    defaultMessage: 'Refresh results',
  })}
/>

Change boundaries

  • Do not change unrelated components, logic, behavior, or layout.
  • Do not broaden the scope of a fix beyond the rule, component, or pattern described by the skill.
  • Do not remove or modify license headers.
  • Do not add comments to updated lines.
  • Do not delete existing comments unless the skill explicitly requires it.

Output constraints

  • Return...

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@elasticmachine
Copy link
Contributor

elasticmachine commented Mar 18, 2026

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!

Co-authored-by: alexwizp <20072247+alexwizp@users.noreply.github.com>
Copilot AI changed the title [WIP] [eslint-issue-reporter] Fix @elastic_eui_no-unnamed-interactive-element [a11y] Fix missing aria-label on EuiButtonIcon in developer examples Mar 18, 2026
Copilot AI requested a review from alexwizp March 18, 2026 14:08
@alexwizp alexwizp marked this pull request as ready for review March 18, 2026 14:11
@alexwizp alexwizp requested a review from a team as a code owner March 18, 2026 14:11
@alexwizp alexwizp added Project:Accessibility release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting v9.4.0 and removed 💝community labels Mar 18, 2026
@alexwizp
Copy link
Contributor

@elasticmachine run docs-build

@alexwizp
Copy link
Contributor

/ci

@alexwizp alexwizp merged commit 5530f09 into main Mar 18, 2026
17 checks passed
@alexwizp alexwizp deleted the copilot/fix-eslint-issue-reporter branch March 18, 2026 16:43
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @alexwizp @copilot

@alexwizp alexwizp added the a11y:agent-pr PR has been created by the agent label Mar 18, 2026
qn895 pushed a commit to qn895/kibana that referenced this pull request Mar 18, 2026
…lastic#258367)

`EuiButtonIcon` in `developer_examples/public/app.tsx` lacked an
accessible label, violating
`@elastic/eui/no-unnamed-interactive-element`. Icon-only buttons are
invisible to screen readers without an explicit label.

## Changes

- **`examples/developer_examples/public/app.tsx`**: Added
`aria-label="Open in new tab"` to the `EuiButtonIcon` and removed the
orphaned children text (unused by icon-only buttons); converted to
self-closing tag.

```diff
- <EuiButtonIcon
-   iconType="popout"
-   onClick={...}
- >
-   Open in new tab
- </EuiButtonIcon>
+ <EuiButtonIcon
+   iconType="popout"
+   aria-label="Open in new tab"
+   onClick={...}
+ />
```

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>


----

*This section details on the original issue you should resolve*

<issue_title>[`eslint-issue-reporter`] `@elastic_appex-sharedux` — fix
`@elastic_eui_no-unnamed-interactive-element`</issue_title>
<issue_description>> [!NOTE]
> Reserved for AI coding agents—please don’t take it manually.

## Summary
This issue groups **1** ESLint violation for rule
`@elastic/eui/no-unnamed-interactive-element` across **1** file for team
**@elastic/appex-sharedux**. Latest monitoring snapshot: index
`kibana-eslint-20260318-014121`, versions: 9.4.0 (Mar 18).

## Why this issue exists
This is a grouped ESLint backlog item generated from the latest
monitoring snapshot. One issue per (team, rule) keeps the backlog stable
and actionable.

## What to fix
Implement fixes **in full alignment** with
[Constitution](#a11y-constitution) and [Skill](#a11y-skill) below.
Expand those blocks and treat **every paragraph** as normative—scope,
change boundaries, WCAG, i18n, and rule-specific guidance override any
approach that would clear ESLint but contradict them.

Rule: `@elastic/eui/no-unnamed-interactive-element`
 ```text  
EuiButtonIcon must include an accessible label. Use one of: aria-label,
aria-labelledby
```

## Places to fix
**Requirement:** Fix **every** location in the checklist below—do not merge or close this issue until all listed places are addressed (the list may be capped by the reporter; still treat each listed item as mandatory).

- [ ] `examples/developer_examples/public/app.tsx` — line 92

## Pull request
When you open a PR for this work, apply the label **`a11y:agent-pr`** (required).

<details id="a11y-constitution">
<summary><strong>Constitution</strong></summary>

# Constitution for Skills

## Scope and precedence

- This constitution applies to every skill and every skill-driven fix in this repo.
- When a `SKILL` adds narrower rules, follow both documents.
- If there is a conflict, use this precedence order:
  1. task-specific user or system instruction
  2. this constitution
  3. the individual `SKILL`
- Skill-specific guidance may narrow the allowed change set, but it must not weaken this constitution.

## Core principles

### Standards compliance

- All changes must meet WCAG 2.2 AA at minimum.
- Prefer semantic HTML over ARIA where possible.
- Use WAI-ARIA only when native semantics are insufficient.

### Minimal changes

- Apply the smallest change that fully resolves the accessibility issue.
- Avoid unnecessary refactoring.
- Preserve existing behavior, layout, and intent unless the accessibility fix requires a change.

### Deterministic behavior

- Apply deterministic fixes: the same code pattern should produce the same result.
- Avoid subjective or stylistic changes unless they are directly tied to accessibility.

## Accessibility rules

- Prefer existing visible text for accessible names whenever possible.
- Reuse nearby labels, headings, button text, or other visible copy before introducing hidden text such as `aria-label`.
- Do not remove existing accessibility attributes such as `title`, `alt`, `aria-label`, or `aria-labelledby` unless they are being replaced with a stronger or more correct alternative.
- Prefer relationships to visible content, such as `aria-labelledby`, when that produces a clearer and more maintainable result.

## i18n rules

- Any new or replacement user-facing string, or any new or replacement string exposed to assistive technology as an accessible name, must use `i18n.translate('message.id', { defaultMessage: 'English fallback' })`.
- Do not introduce that copy as a raw string literal.
- If the file already uses a shared i18n object such as `i18nTexts.modalTitle`, keep that pattern for new strings in that file.
- Do not localize programmatic identifiers that are not user-visible, such as radio group `name` values.
- Add an `i18n` import only when you introduce a new `i18n.translate(...)` call.
- Place new imports at the top of the file and merge them with existing imports from the same package.
- Reuse existing translation IDs when the same message already exists in the file.
- Follow the local translation ID naming convention when one exists.
- If no local naming convention exists, use `<fileOrComponent>.<attributeName>`, for example `myTable.tableCaption` or `myButton.ariaLabel`.
- Keep `defaultMessage` short, user-facing, and consistent with the surrounding UI.
- Do not create duplicate translation IDs with different `defaultMessage` values in the same file.

### Example

```tsx
<EuiButtonIcon
  aria-label={i18n.translate('myButton.ariaLabel', {
    defaultMessage: 'Refresh results',
  })}
/>
```

## Change boundaries

- Do not change unrelated components, logic, behavior, or layout.
- Do not broaden the scope of a fix beyond the rule, component, or pattern described by the skill.
- Do not remove or modify license headers.
- Do not add comments to updated lines.
- Do not delete existing comments unless the skill explicitly requires it.

## Output constraints

- Return...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

- Fixes elastic#258366

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <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:skip This PR does not require backporting Project:Accessibility release_note:skip Skip the PR/issue when compiling release notes v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[eslint-issue-reporter] @elastic_appex-sharedux — fix @elastic_eui_no-unnamed-interactive-element

5 participants