Repository navigation
[ESLint][EuiToolTip] Add ESLint rules for tooltip best practices - #9635
Merged
weronikaolejniczak merged 8 commits intoMay 13, 2026
Merged
weronikaolejniczak merged 8 commits into
weronikaolejniczak merged 8 commits into
Conversation
weronikaolejniczak
force-pushed
the
feat/tooltip-eslint-rules
branch
2 times, most recently
from
May 6, 2026 15:02
0ee7d72 to
2803da0
Compare
weronikaolejniczak
marked this pull request as ready for review
May 6, 2026 15:04
weronikaolejniczak
force-pushed
the
feat/tooltip-eslint-rules
branch
from
May 12, 2026 18:23
2803da0 to
1c75768
Compare
acstll
self-requested a review
May 13, 2026 07:50
acstll
approved these changes
May 13, 2026
acstll
left a comment
Contributor
There was a problem hiding this comment.
🟢 Code looks good, i couldn't find anything myself! "Forwarding" 2 comments related to tests that Claude spotted. I don't think they're blocking, but worth considering.
Contributor
Author
weronikaolejniczak
enabled auto-merge (squash)
May 13, 2026 11:53
Collaborator
💚 Build SucceededHistory
|
Collaborator
💚 Build Succeeded
History
|
alexwizp
added a commit
to elastic/kibana
that referenced
this pull request
May 28, 2026
## Summary Updates the `accessibility` agent skill (`.agents/skills/accessibility/`) with the two new accessibility ESLint rules shipped in [`elastic/eui#9635`](elastic/eui#9635) - **`@elastic/eui/tooltip-button-icon-wrap`** — every `EuiButtonIcon` must be wrapped in `EuiToolTip` (no native `title` prop). Auto-fixable. - **`@elastic/eui/tooltip-no-interactive-content`** — no focusable elements inside `EuiToolTip` / `EuiIconTip` `content` or `title` props. Not auto-fixable. Both rules ship as `warn` in `@elastic/eslint-plugin-eui`'s recommended config, so the agent skill should describe the canonical fix patterns and the manual-review cases the rule cannot resolve automatically. ## Changes - **`references/components/tooltip_icon.md`** — rewritten to cover the full canonical pattern for the `EuiToolTip` + `EuiButtonIcon` pair: wrap every `EuiButtonIcon` with `EuiToolTip`, drop the native `title` prop, keep `aria-label`, and add `disableScreenReaderOutput` when `content` and `aria-label` match. Examples expanded with the new WRONG/RIGHT cases (no-wrap, native `title`). - **`references/components/tooltip_content.md`** *(new)* — canonical guide for the `tooltip-no-interactive-content` rule. Lists allowed content (plain strings, non-interactive JSX, display-only `EuiBadge` / `EuiBetaBadge` / `EuiCard`) and the focusable blocklist (native `a`/`button`/`input`/`select`/`textarea` + interactive EUI components). Documents the canonical fix (switch to `EuiPopover`) and the manual-review cases the rule deliberately skips: variable `content` / `title` and conditionally-interactive badges/cards that gain `onClick` / `href`. Examples cover nesting in fragments, `cond && …`, ternaries, and the `title=` prop (not just `content=`). - **`references/components/index.md`** — added `tooltip_content.md` row; updated `tooltip_icon.md` topic to reflect the broader scope. - **`references/eslint.md`** — added rows (alphabetically placed) for `@elastic/eui/tooltip-button-icon-wrap` → `tooltip_icon.md` and `@elastic/eui/tooltip-no-interactive-content` → `tooltip_content.md`, each with the manual-review notes the rule cannot resolve automatically. ## Why The skill is the source of truth coding agents (and humans browsing it) consult when fixing `@elastic/eui/*` lint violations. Without this update the two new rules would land with no canonical-usage reference, and agents would have to re-derive the pattern (and the silently-skipped edge cases) from rule messages alone. ## Test plan - Docs-only change in the `accessibility` agent skill; no runtime or build impact. - Verified the rules are present and configured as `warn` in `node_modules/@elastic/eslint-plugin-eui/lib/cjs/index.js`. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]>
dej611
pushed a commit
to dej611/kibana
that referenced
this pull request
May 29, 2026
…71423) ## Summary Updates the `accessibility` agent skill (`.agents/skills/accessibility/`) with the two new accessibility ESLint rules shipped in [`elastic/eui#9635`](elastic/eui#9635) - **`@elastic/eui/tooltip-button-icon-wrap`** — every `EuiButtonIcon` must be wrapped in `EuiToolTip` (no native `title` prop). Auto-fixable. - **`@elastic/eui/tooltip-no-interactive-content`** — no focusable elements inside `EuiToolTip` / `EuiIconTip` `content` or `title` props. Not auto-fixable. Both rules ship as `warn` in `@elastic/eslint-plugin-eui`'s recommended config, so the agent skill should describe the canonical fix patterns and the manual-review cases the rule cannot resolve automatically. ## Changes - **`references/components/tooltip_icon.md`** — rewritten to cover the full canonical pattern for the `EuiToolTip` + `EuiButtonIcon` pair: wrap every `EuiButtonIcon` with `EuiToolTip`, drop the native `title` prop, keep `aria-label`, and add `disableScreenReaderOutput` when `content` and `aria-label` match. Examples expanded with the new WRONG/RIGHT cases (no-wrap, native `title`). - **`references/components/tooltip_content.md`** *(new)* — canonical guide for the `tooltip-no-interactive-content` rule. Lists allowed content (plain strings, non-interactive JSX, display-only `EuiBadge` / `EuiBetaBadge` / `EuiCard`) and the focusable blocklist (native `a`/`button`/`input`/`select`/`textarea` + interactive EUI components). Documents the canonical fix (switch to `EuiPopover`) and the manual-review cases the rule deliberately skips: variable `content` / `title` and conditionally-interactive badges/cards that gain `onClick` / `href`. Examples cover nesting in fragments, `cond && …`, ternaries, and the `title=` prop (not just `content=`). - **`references/components/index.md`** — added `tooltip_content.md` row; updated `tooltip_icon.md` topic to reflect the broader scope. - **`references/eslint.md`** — added rows (alphabetically placed) for `@elastic/eui/tooltip-button-icon-wrap` → `tooltip_icon.md` and `@elastic/eui/tooltip-no-interactive-content` → `tooltip_content.md`, each with the manual-review notes the rule cannot resolve automatically. ## Why The skill is the source of truth coding agents (and humans browsing it) consult when fixing `@elastic/eui/*` lint violations. Without this update the two new rules would land with no canonical-usage reference, and agents would have to re-derive the pattern (and the silently-skipped edge cases) from rule messages alone. ## Test plan - Docs-only change in the `accessibility` agent skill; no runtime or build impact. - Verified the rules are present and configured as `warn` in `node_modules/@elastic/eslint-plugin-eui/lib/cjs/index.js`. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
If that's the case, should we capture this in our documentation? At minimum, ensure all of the examples that we show demonstrate this. |
patrykkopycinski
pushed a commit
to patrykkopycinski/kibana
that referenced
this pull request
Aug 5, 2026
…71423) ## Summary Updates the `accessibility` agent skill (`.agents/skills/accessibility/`) with the two new accessibility ESLint rules shipped in [`elastic/eui#9635`](elastic/eui#9635) - **`@elastic/eui/tooltip-button-icon-wrap`** — every `EuiButtonIcon` must be wrapped in `EuiToolTip` (no native `title` prop). Auto-fixable. - **`@elastic/eui/tooltip-no-interactive-content`** — no focusable elements inside `EuiToolTip` / `EuiIconTip` `content` or `title` props. Not auto-fixable. Both rules ship as `warn` in `@elastic/eslint-plugin-eui`'s recommended config, so the agent skill should describe the canonical fix patterns and the manual-review cases the rule cannot resolve automatically. ## Changes - **`references/components/tooltip_icon.md`** — rewritten to cover the full canonical pattern for the `EuiToolTip` + `EuiButtonIcon` pair: wrap every `EuiButtonIcon` with `EuiToolTip`, drop the native `title` prop, keep `aria-label`, and add `disableScreenReaderOutput` when `content` and `aria-label` match. Examples expanded with the new WRONG/RIGHT cases (no-wrap, native `title`). - **`references/components/tooltip_content.md`** *(new)* — canonical guide for the `tooltip-no-interactive-content` rule. Lists allowed content (plain strings, non-interactive JSX, display-only `EuiBadge` / `EuiBetaBadge` / `EuiCard`) and the focusable blocklist (native `a`/`button`/`input`/`select`/`textarea` + interactive EUI components). Documents the canonical fix (switch to `EuiPopover`) and the manual-review cases the rule deliberately skips: variable `content` / `title` and conditionally-interactive badges/cards that gain `onClick` / `href`. Examples cover nesting in fragments, `cond && …`, ternaries, and the `title=` prop (not just `content=`). - **`references/components/index.md`** — added `tooltip_content.md` row; updated `tooltip_icon.md` topic to reflect the broader scope. - **`references/eslint.md`** — added rows (alphabetically placed) for `@elastic/eui/tooltip-button-icon-wrap` → `tooltip_icon.md` and `@elastic/eui/tooltip-no-interactive-content` → `tooltip_content.md`, each with the manual-review notes the rule cannot resolve automatically. ## Why The skill is the source of truth coding agents (and humans browsing it) consult when fixing `@elastic/eui/*` lint violations. Without this update the two new rules would land with no canonical-usage reference, and agents would have to re-derive the pattern (and the silently-skipped edge cases) from rule messages alone. ## Test plan - Docs-only change in the `accessibility` agent skill; no runtime or build impact. - Verified the rules are present and configured as `warn` in `node_modules/@elastic/eslint-plugin-eui/lib/cjs/index.js`. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tooltip_button_icon_wrap- we want allEuiButtonIconwrapped withEuiToolTiptooltip_no_interactive_content- it's against WCAG specification for tooltip content to be interactivewarn,EuiButtonIconwrap has an auto-fix, "no interactive content" one doesn'tEuiButtonIconwithEuiToolTipAPI Changes
N/A
Screenshots
N/A
Impact Assessment
Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.
Impact level: 🟢 None
Release Readiness
Documentation: {link to docs page(s)}Figma: {link to Figma or issue}Migration guide: {steps or link, for breaking/visual changes or deprecations}Adoption plan (new features): {link to issue/doc or outline who will integrate this and where}QA instructions for reviewer
yarn workspace @elastic/eslint-plugin-eui testChecklist before marking Ready for Review
QA: Tested light/dark modes, high contrast, mobile, Chrome/Safari/Edge/Firefox, keyboard-only, screen readerQA: Tested in CodeSandbox and KibanaQA: Tested docs changesCypress, and VRTBreaking changes: Addedbreaking changelabel (if applicable)Reviewer checklist