fix(tooltip): avoid duplicate overlay semantics - #82
Merged
Conversation
Contributor
LCOV of commit
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates NakedTooltip semantics to prevent duplicate accessible announcements when the tooltip is open by excluding the overlay subtree from the semantics tree by default, keeping tooltip semantics on the trigger node.
Changes:
- Added
excludeOverlaySemanticsto control whether the overlay subtree participates in semantics. - Wrapped the tooltip overlay builder output with
ExcludeSemantics(when enabled) to avoid duplicate overlay labels. - Expanded the tooltip semantics test suite and updated widget documentation to describe the new behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/naked_ui/lib/src/naked_tooltip.dart | Adds excludeOverlaySemantics and applies ExcludeSemantics to overlay content. |
| packages/naked_ui/test/semantics/naked_tooltip_semantics_test.dart | Adds semantics traversal helpers and new tests asserting no duplicate labeled nodes by default, with an opt-in for custom overlay semantics. |
| docs/widget/tooltip.mdx | Documents the new parameter and the intended default semantics behavior. |
Comments suppressed due to low confidence (1)
docs/widget/tooltip.mdx:110
- This behaviour note implies the overlay is always semantics-excluded by default, which can leave tooltips inaccessible if
semanticLabelisn’t provided. If overlay semantics are only excluded whensemanticLabelis present, clarify that here as well so readers know which node will be announced.
- Only one tooltip is shown at a time when using nested tooltips
- Visual overlay content is semantics-excluded by default; use `semanticLabel` to describe it on the trigger
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
LCOV of commit
|
This was referenced Jul 28, 2026
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.
Description
Excludes
NakedTooltipvisual overlays from semantics by default, keepingsemanticLabelon one interactive trigger node. Custom overlays can opt intoindependent semantics with
excludeOverlaySemantics: false; visual andinteraction behavior is unchanged.
Validation:
fvm dart run melos ciand the focused tooltip semantics suite.Related Issues
Related to #81. Found while validating conceptadev/remix#80.
Checklist
Breaking Change