Repository navigation
feat(remix): add containerEffects to focusable parts - #331
Open
leoafarias wants to merge 3 commits into
Open
leoafarias wants to merge 3 commits into
leoafarias wants to merge 3 commits into
Conversation
Add containerEffects to the Tab, Toggle, ToggleGroup item, SelectMenuItem, MenuItem, and MenuTrigger specs, and triggerEffects to Accordion and Disclosure, whose containerEffects already covers the whole panel. Each widget renders through RemixBoxAdapter or RemixFlexBoxAdapter, so an outline paints outside the box without taking layout space.
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. |
… accordion triggers RemixSidebar drew destinations with Mix RowBox, so the containerEffects slot that SidebarDestinationStyler (a ToggleStyler) gained never painted: a preset that moves its toggle focus ring there lost the sidebar destination ring. Both destination row layouts (settled and collapsing or expanding) now render through RemixFlexBoxAdapter. RemixAccordion painted triggerEffects only on its default trigger, while RemixDisclosure also wraps a custom triggerBuilder widget. A custom RemixAccordion.builder widget is now wrapped in triggerEffects too, without applying the trigger box, so a preset ring shows around a custom trigger.
leoafarias
added a commit
that referenced
this pull request
Oct 27, 2026
# Conflicts: # packages/remix/CHANGELOG.md # packages/remix/lib/src/components/accordion/accordion_widget.dart # packages/remix/lib/src/components/sidebar/sidebar.dart
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
Adds the
containerEffectsslot to the parts that take focus but could not draw an outside ring:TabStyler,ToggleStyler,ToggleGroupItemStyler,SelectMenuItemStyler,MenuItemStyler, andMenuTriggerStyler.AccordionStylerandDisclosureStylergettriggerEffects, because theircontainerEffectsalready covers the whole panel and a focus ring there would wrap the revealed content. Tooltip is not focusable and is not included.Each part now renders through
RemixBoxAdapter/RemixFlexBoxAdapter, so an outline, inset shadow, or gradient paints outside the box without taking layout space; a focus ring no longer resizes the part or shifts its neighbors, which a border does. With no effects set, the parts render exactly as before. Each spec routes the new field throughRemixBoxEffectsSpec.lerpNullableso rings animate.Side effect (fix): each part's content now keeps its state when a style adds or removes a decoration such as a focus ring; previously that rebuilt the content from scratch (a custom tab child or disclosure trigger ran
initStateagain on focus and blur).Notes, documented on the component pages:
clipBehavior(every shipped preset sets one) crops an outside ring on its end items; use a negativeoutlineOffset. Fortal select and menu content and accordion/disclosure panels also clip outside rings.builderthat returns a different widget (RemixTab.builder,RemixMenuTrigger.builder) replaces the styled container and its effects. A customRemixAccordion.builderorRemixDisclosure.triggerBuilderwidget is wrapped intriggerEffects.Presets are unchanged; they adopt the slots after the next Remix beta.
Validation
remix_box_effects_slots_test.dart: for every part, a ring paints on focus (pixel check) with identical layout before and after; accordion and disclosure rings hug the trigger; a group clip crops an outside ring and keeps a negative-offset ring; each spec's slot fades in and out throughlerpNullable. Each test fails with the source reverted.mainacross 295 states (idle, hover, focus, press, mid-animation, disabled, selected, open overlays, expanded panels) in unstyled, Vanilla, Vanilla at 1.6x text, Fortal, and Fortal RTL: pixels, semantics, sizes, positions, decoration, clip, padding, and alignment identical.FlexBox/RowBoxto the adapters (not weakened); props-length and diagnostics assertions bumped.melos run test:flutter(every package),ci:checks,docs:check,generate:check,open-code:registry:buildandopen-code:apps:check(no registry or app drift), rootdart format,dart analyze(no new issues).Follow-up coverage.
RemixSidebardestinations are styled withSidebarDestinationStyler, which isToggleStyler-based, but they were drawn with MixRowBox. A preset that moved its toggle focus ring tocontainerEffectstherefore lost the sidebar ring.RemixFlexBoxAdapterand paintcontainerEffects.RemixAccordionnow wraps a custombuilderwidget intriggerEffects, asRemixDisclosurealready does fortriggerBuilder, so a preset ring shows around a custom trigger. Thetriggerbox is still not applied to a custom accordion trigger.remix_box_effects_slots_test.dartcover the sidebar destination ring (expanded, collapsed, and mid-animation, with unchanged layout) and the accordion and disclosure custom-trigger rings. The sidebar and accordion tests fail with the source reverted.Merge note after #349
When rebasing onto the naked_ui 1.3.0 stack containing #349, update the SelectMenuItem case in
packages/remix/test/rendering/remix_box_effects_slots_test.dartto measureBetarather thanAlphabefore ArrowDown. #349 focuses Alpha on open, so it is no longer an idle baseline; ArrowDown then focuses Beta. Keep the pixel and full-layout assertions. Integration #339 contains this one-line adjustment and all 27 effects tests pass.Related Issues
Follow-up from the HeroUI preset (ADR 0002 focus effects gap); unblocks the Vanilla, Fortal, and HeroUI adoption PRs.
Checklist
///).Breaking Change
All new fields are optional. Tests that read these parts' container spec off Mix
FlexBox/RowBoxmust read it from the adapter instead (an internal type).