fix: use DefinitionTooltip for similarity score tags - #8
Merged
Merged
Conversation
zvonimirfras
force-pushed
the
fix/similarity-score-tooltip
branch
from
September 1, 2026 20:09
74871d9 to
c55ac29
Compare
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
force-pushed
the
fix/similarity-score-tooltip
branch
from
September 1, 2026 20:17
c55ac29 to
e903810
Compare
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.
Problem
Carbon's
Tooltipcomponent works by cloning its child and injectingaria-describedbyand mouse/focus event listeners.Tagrenders 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 inSimilarityScoreDisplaywith<DefinitionTooltip openOnHover>, which is Carbon's component designed specifically for annotating non-interactive content. Thecontentprop was renamed todefinitionto match theDefinitionTooltipAPI.Removed the now-unused
Tooltipimport.Testing
tsc --noEmit)Closes #5