Skip to content

fix: use DefinitionTooltip for similarity score tags - #8

Merged
zvonimirfras merged 1 commit into
IBM:mainfrom
zvonimirfras:fix/similarity-score-tooltip
Sep 1, 2026
Merged

zvonimirfras merged 1 commit into
IBM:mainfrom
zvonimirfras:fix/similarity-score-tooltip

Conversation

@zvonimirfras

Copy link
Copy Markdown
Member

Problem

Carbon's Tooltip component works by cloning its child and injecting aria-describedby and mouse/focus event listeners. Tag renders as a plain <span> and doesn't forward those props to the DOM node, so the tooltip trigger was never wired up — resulting in an empty tooltip bubble with no hover behavior (as shown in the issue screenshot).

Fix

Replace all three <Tooltip> usages in SimilarityScoreDisplay with <DefinitionTooltip openOnHover>, which is Carbon's component designed specifically for annotating non-interactive content. The content prop was renamed to definition to match the DefinitionTooltip API.

Removed the now-unused Tooltip import.

Testing

  • TypeScript compiles clean (tsc --noEmit)
  • All 22 existing tests pass

Closes #5

@zvonimirfras
zvonimirfras force-pushed the fix/similarity-score-tooltip branch from 74871d9 to c55ac29 Compare September 1, 2026 20:09
Carbon's Tooltip requires an interactive child that forwards refs and
event handlers. Tag is a plain span and doesn't forward those props,
so the tooltip trigger was never wired up — resulting in an empty tooltip.

Replace all three Tooltip usages in SimilarityScoreDisplay with
DefinitionTooltip (openOnHover), which is designed for annotating
non-interactive content.

Closes IBM#5

Signed-off-by: Zvonimir Fras <zvonimir@zvonimirfras.com>
@zvonimirfras
zvonimirfras force-pushed the fix/similarity-score-tooltip branch from c55ac29 to e903810 Compare September 1, 2026 20:17
@zvonimirfras
zvonimirfras merged commit ebfa593 into IBM:main Sep 1, 2026
4 checks passed
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.

Tooltip is empty for similarity score tag component in in sessions page

1 participant