Skip to content

fix(tooltip): avoid duplicate overlay semantics - #82

Merged
leoafarias merged 2 commits into
mainfrom
fix/naked-tooltip-overlay-semantics
Jul 28, 2026
Merged

fix(tooltip): avoid duplicate overlay semantics#82
leoafarias merged 2 commits into
mainfrom
fix/naked-tooltip-overlay-semantics

Conversation

@leoafarias

Copy link
Copy Markdown
Member

Description

Excludes NakedTooltip visual overlays from semantics by default, keeping
semanticLabel on one interactive trigger node. Custom overlays can opt into
independent semantics with excludeOverlaySemantics: false; visual and
interaction behavior is unchanged.

Validation: fvm dart run melos ci and the focused tooltip semantics suite.

Related Issues

Related to #81. Found while validating conceptadev/remix#80.


Checklist

  • My PR includes unit or integration tests for all changed behavior.
  • I have updated the API and widget documentation.
  • I am prepared to follow up on review comments in a timely manner.

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

@github-actions

Copy link
Copy Markdown
Contributor

LCOV of commit 99d55c2 during Flutter CI #269

	(use "lcov --ignore-errors deprecated,deprecated ..." to suppress this warning)
Reading tracefile /tmp/__zgosalvez_github-actions-report-lcov/lcov.info.
Summary coverage rate:
  source files: 22
  lines.......: 89.6% (2947 of 3289 lines)
  functions...: no data found
  branches....: no data found
Message summary:
  1 warning message:
    deprecated: 1

Files changed coverage rate:
  	(use "lcov --ignore-errors deprecated,deprecated ..." to suppress this warning)
                                                                   |Lines       |Functions  |Branches    
  Filename                                                         |Rate     Num|Rate    Num|Rate     Num
  packages/naked_ui/lib/src/naked_tooltip.dart                     |83.9%    199|    -     0|    -      0

@leoafarias
leoafarias requested a review from Copilot July 28, 2026 18:42
@leoafarias
leoafarias marked this pull request as ready for review July 28, 2026 18:42

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

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 excludeOverlaySemantics to 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 semanticLabel isn’t provided. If overlay semantics are only excluded when semanticLabel is 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.

Comment thread packages/naked_ui/lib/src/naked_tooltip.dart
Comment thread docs/widget/tooltip.mdx
@github-actions

Copy link
Copy Markdown
Contributor

LCOV of commit a38a6ff during Flutter CI #270

	(use "lcov --ignore-errors deprecated,deprecated ..." to suppress this warning)
Reading tracefile /tmp/__zgosalvez_github-actions-report-lcov/lcov.info.
Summary coverage rate:
  source files: 22
  lines.......: 89.6% (2949 of 3291 lines)
  functions...: no data found
  branches....: no data found
Message summary:
  1 warning message:
    deprecated: 1

Files changed coverage rate:
  	(use "lcov --ignore-errors deprecated,deprecated ..." to suppress this warning)
                                                                   |Lines       |Functions  |Branches    
  Filename                                                         |Rate     Num|Rate    Num|Rate     Num
  packages/naked_ui/lib/src/naked_tooltip.dart                     |84.1%    201|    -     0|    -      0

@leoafarias
leoafarias merged commit 9787554 into main Jul 28, 2026
7 checks passed
@leoafarias
leoafarias deleted the fix/naked-tooltip-overlay-semantics branch July 28, 2026 19:08
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.

2 participants