Skip to content

[EuiToolTip] Improve tooltip group transition - #9689

Merged
weronikaolejniczak merged 8 commits into
elastic:mainfrom
weronikaolejniczak:poc/tooltip-group-swap
Jun 15, 2026
Merged

weronikaolejniczak merged 8 commits into
elastic:mainfrom
weronikaolejniczak:poc/tooltip-group-swap

Conversation

@weronikaolejniczak

@weronikaolejniczak weronikaolejniczak commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adjacent EuiToolTip triggers show visually disjoint tooltips. They re-play entry fade-in animation on every hover (~150ms delay + ~90ms fade).

Most design systems solve this by skipping the entry animation within a certain window of time. The show and hide stays synchronous (no timer), preserving the screen-reader behavior from #9626.

Kapture 2026-05-11 at 15 10 35

The anchor now listens with non-bubbling onMouseEnter/onMouseLeave instead of onMouseOver/onMouseOut. This removes the old relatedTarget filtering that was supposed to fix a flicker where the tooltip could hide when the cursor moved between inner children of the trigger.

Inline animation: none must be on first popover render, not after positionToolTip, otherwise CSS keyframes fire briefly before override.

API Changes

N/A

Screenshots

Kapture 2026-06-03 at 15 34 37

Impact Assessment

Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.

  • 🔴 Breaking changes — What will break? How many usages in Kibana/Cloud UI are impacted?
  • 💅 Visual changes — May impact style overrides; could require visual testing. Explain and estimate impact.
  • 🧪 Test impact — May break functional or snapshot tests (e.g., HTML structure, class names, default values).
  • 🔧 Hard to integrate — If changes require substantial updates to Kibana, please stage the changes and link them here.

Impact level: 🟢 None

  • VRTs are unaffected (it's an animation change),
  • there's no impact for consumers.

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

Behavior

  • There's only ever one tooltip at a time (potential regression to the tooltip manager original intent)
  • When triggers are next to each other, hovering over them skips animation
  • When triggers are further from each other, hovering over them plays the full animation
  • There is no flickering
  • Turn reduced motion setting on and make sure tooltip displays correctly

Screen readers

  • VO + Chrome announces tooltips reliably (potential regression)
  • VO + Safari announces tooltips reliably (potential regression)
  • NVDA announces tooltips reliably (potential regression)
  • JAWS announces tooltips reliably (potential regression)

Checklist before marking Ready for Review

Reviewer checklist

  • Approved Impact Assessment — Acceptable to merge given the consumer impact.
  • Approved Release Readiness — Docs, Figma, and migration info are sufficient to ship.

@weronikaolejniczak weronikaolejniczak changed the title [PoC] Improve tooltip group transition [EuiToolTip] Improve tooltip group transition Jun 1, 2026
@weronikaolejniczak weronikaolejniczak self-assigned this Jun 1, 2026
@weronikaolejniczak weronikaolejniczak added the ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR label Jun 3, 2026
@weronikaolejniczak
weronikaolejniczak force-pushed the poc/tooltip-group-swap branch 4 times, most recently from d041f27 to 5b26281 Compare June 3, 2026 12:42
deregisterToolTip = (hideCallback: Function) => {
this.toolTipsToHide.delete(hideCallback);
if (this.toolTipsToHide.delete(hideCallback))
this.lastHiddenAt = Date.now();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I considered using performance.now() but found in the codebase we use Date.now() for such cases.

@weronikaolejniczak weronikaolejniczak Jun 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also considered a timeout in a provider but it's a larger architectural change, so I decided against it. This has no chance to leak, makes sense for cross-component logic and doesn't reintroduce the asynchronous problem that was causing screen readers to not announce tooltips reliably.

@weronikaolejniczak
weronikaolejniczak force-pushed the poc/tooltip-group-swap branch 2 times, most recently from 7c835b6 to e752ba3 Compare June 3, 2026 13:03
@weronikaolejniczak weronikaolejniczak removed the ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR label Jun 3, 2026
@weronikaolejniczak
weronikaolejniczak marked this pull request as ready for review June 3, 2026 13:35
@weronikaolejniczak
weronikaolejniczak requested a review from a team as a code owner June 3, 2026 13:35
Copilot AI review requested due to automatic review settings June 3, 2026 13:35

Copilot AI left a comment

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.

Pull request overview

Improves EuiToolTip behavior when moving the pointer across adjacent tooltip triggers by conditionally skipping the entry animation, aiming to make “tooltip groups” feel like one continuous tooltip while preserving the synchronous show/hide behavior introduced in #9626.

Changes:

  • Adds “skip entry animation” signaling to toolTipManager (including a short time window after a tooltip closes).
  • Updates EuiToolTip to use non-bubbling onMouseEnter/onMouseLeave and to apply inline animation: none on initial render when skipping.
  • Adds a Storybook story for grouped tooltip QA and updates tests/changelog.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/eui/src/components/tool_tip/tool_tip.tsx Applies skipAnimation on show and swaps mouse event handling to mouseenter/leave
packages/eui/src/components/tool_tip/tool_tip.stories.tsx Adds a grouped tooltip story for interactive QA
packages/eui/src/components/tool_tip/tool_tip_manager.ts Tracks recent hide timestamp + returns { skipAnimation } from registerTooltip
packages/eui/src/components/tool_tip/tool_tip_manager.test.ts Switches to singleton reset() between tests
packages/eui/src/components/tool_tip/tool_tip_anchor.tsx Updates anchor wrapper to use onMouseEnter/onMouseLeave
packages/eui/src/components/selectable/selectable_list/selectable_list_item.test.tsx Resets the singleton between tests to avoid cross-test animation differences
packages/eui/changelogs/upcoming/9689.md Adds an entry describing the UX improvement + flicker fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tkajtoch

tkajtoch commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Kibana test PR: elastic/kibana#272534

@weronikaolejniczak

Copy link
Copy Markdown
Contributor Author

I checked all failures on elastic/kibana#272534 and they are all related to the title replacement and will be resolved on: elastic/kibana#272154

@mgadewoll
mgadewoll self-requested a review June 5, 2026 08:14

@mgadewoll mgadewoll left a comment

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.

This updates looks solid, nice work! I left a couple small comments.
I manually tested the tooltips based on the QA guidance, they generally work as expected.

There is one thing I noticed, which seems to not be a regression in this PR but rather from before:
When using the screen reader navigation (arrowUp/Down, not TAB key) in NVDA and JAWS and then pressing Enter to focus the element, the tooltip is not announced. That used to be the case before the tooltip refactor. In JAWS the tooltip is not shown anymore.

NVDA

before after
Screen.Recording.2026-06-05.at.13.28.25.mov
Screen.Recording.2026-06-05.at.13.29.04.mov

JAWS

before after
Screen.Recording.2026-06-05.at.13.38.17.mov
Screen.Recording.2026-06-05.at.13.37.38.mov

@weronikaolejniczak

Copy link
Copy Markdown
Contributor Author

@mgadewoll so I looked into it and you're right, this is the result of the :focus-visible gate. The browse mode/virtual cursor is treated like non-keyboard focus. Really nice find 🙏🏻

Probably the best solution here would be always linking aria-describedby regardless of isVisible (?) but I'd need to think it through and actually test it out with several combos. So I'll handle that separately.

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
5 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euibasictable (4 differences)

StoryBeforeAfterDiff
empty table desktop
marked row desktop
playground desktop
scrollable desktop

euiinmemorytable (1 difference)

StoryBeforeAfterDiff
kitchen sink desktop

@mgadewoll mgadewoll left a comment

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.

I left a couple small additional comments but overall the implementation looks good to me and works as expected. Nice work! Approving already to not be a blocker.

@weronikaolejniczak
weronikaolejniczak enabled auto-merge (squash) June 15, 2026 10:40
@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @weronikaolejniczak

@weronikaolejniczak
weronikaolejniczak merged commit 3c48a7d into elastic:main Jun 15, 2026
1 check passed
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
6 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euipopover (1 difference)

StoryBeforeAfterDiff
playground desktop

euibasictable (4 differences)

StoryBeforeAfterDiff
empty table desktop
marked row desktop
playground desktop
scrollable desktop

euiinmemorytable (1 difference)

StoryBeforeAfterDiff
kitchen sink desktop

@elasticmachine

elasticmachine commented Jun 15, 2026 •

Copy link
Copy Markdown
Collaborator

💔 Build Failed

Failed CI Steps

History

cc @weronikaolejniczak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants