Repository navigation
fix(naked_ui): honor reduced motion in dialogs, tooltips, disclosures, and toasts - #330
Open
leoafarias wants to merge 2 commits into
Open
leoafarias wants to merge 2 commits into
leoafarias wants to merge 2 commits into
Conversation
showNakedDialog, showNakedAlertDialog, and NakedTooltip now show and hide at once when MediaQuery.disableAnimations is set or the platform reports AccessibilityFeatures.reduceMotion, which iOS Reduce Motion sets without setting disableAnimations. A dialog reads the setting when it opens and when it is dismissed; a tooltip follows changes while mounted.
NakedDisclosure and NakedToastScope read only MediaQuery.disableAnimations, so iOS Reduce Motion, which sets only the platform reduceMotion flag, still animated them. Both now use the same definition as dialogs and tooltips. The disclosure observes platform accessibility changes like the tooltip; a toast reads the setting again when it exits. A dialog that opened without motion now also closes without it, so a reduced-motion request at push survives a MediaQuery override between the caller and the route. showNakedDialog wraps the page in a semantics container so a modal NakedDialog no longer hides the dismissible barrier's node when it opens without a transition. Tooltip docs note that a tooltip not yet shown may show once without motion after the setting is turned off.
4 of 5 tasks
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 27, 2026
This branch has not been deployed
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
showNakedDialog,showNakedAlertDialog,NakedTooltip,NakedDisclosure, andNakedToastScopedid not honor the user's reduced-motion preference: dialogs and tooltips ignored it, and disclosures and toasts read onlyMediaQuery.disableAnimations. iOS Reduce Motion sets onlyAccessibilityFeatures.reduceMotion, notdisableAnimations, andMediaQuerydoes not notify on it, so those widgets kept animating on iOS. Remix delegates to all five.Each now skips its transitions when either
MediaQuery.disableAnimationsor the platformreduceMotionflag is set. Layout and semantics do not change.showNakedDialogpushes a privateRawDialogRoutesubclass whose duration is zero while reduced, soshowNakedAlertDialogandshowRemixDialog/showRemixAlertDialoginherit it. The setting is read from the caller at open and from the dialog's subtree at dismissal (TransitionRoutefixes its durations at install); a dialog that opened without motion also closes without it.didChangeDependenciesanddidChangeAccessibilityFeaturesand feeds zero durations toRawTooltipthrough the existing animation-style sync, including the deprecated 1.1.0 path.didChangeAccessibilityFeatureslike the tooltip, so a running transition completes when the setting turns on.NakedDialogshown without a transition hid the dismissible barrier's "Dismiss" node from screen readers (Flutter'sBlockSemanticsbehaves differently when the page is visible on the first frame).showNakedDialognow wraps the page in a semantics container; this adds one container node to every naked dialog's semantics tree.Reviewable decision (D8): reduced motion is
MediaQuery.disableAnimationsOR the platformreduceMotionflag, read through one internal helper (reducedMotionOf, not exported). Remix'sRemixReducedMotionBuilder(#327) uses the same definition.Limitations: a dialog or tooltip transition already in flight when the setting changes finishes at its old pace (a disclosure completes at once); a tooltip not yet shown when the setting turns off may show once without motion (
RawTooltipcreates its controller lazily), documented. The Remix wrappers inherit this with the next naked_ui release; remix'snaked_uifloor is raised in the release PR.Validation
MediaQuery.disableAnimations, the platformdisableAnimationsflag, and the platformreduceMotionflag: default animates; instant open/close, enter/exit, show/hide; a request arriving while open or visible; withdrawal; unchanged layout; barrier semantics under reduced motion; observer lifecycle and rebuild counts. 31 fail onmain; removing each review fix on its own fails exactly its tests.dart analyze(no new issues), rootdart format,melos run ci:checks(includesdocs:check).Related Issues
Supersedes the closed #258 for naked_ui. Companion: #327 (Remix components).
Checklist
///).Breaking Change