Skip to content

fix(fortal): fade state fills in from a clear of their own colour - #680

Open
chrishiguto wants to merge 6 commits into
fortal-refresh/wb-fix-1-combobox-semanticsfrom
fortal-refresh/wb-fix-2-clear-fills
Open

chrishiguto wants to merge 6 commits into
fortal-refresh/wb-fix-1-combobox-semanticsfrom
fortal-refresh/wb-fix-2-clear-fills

Conversation

@chrishiguto

@chrishiguto chrishiguto commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Why

Highlight fills flashed a dark gray for one to three frames: menu rows, toggle group items, multi select and select options, outline and ghost buttons, number field steppers and more. Each rest colour was transparent black (Color(0x00000000)). Colours interpolate without premultiplying alpha, so halfway to gray3 the fill is a half-transparent mid gray, which reads as RGB 190 over white where the settled fill is 248.

Scope

  • fortalClear(fill) in theme/control_styles.dart: the fill's own colour with alpha 0, one cached token per fill so equal styles stay equal. From it only the alpha changes.
  • Every Fortal rest or clear that a state fill animates from now uses it: menu and context menu rows, button and icon button (outline, ghost, disabled), copy button, toggle, toggle group, select trigger and items, multi select options, number field steppers, password toggle, pagination, tag input tags and remove buttons, data table rows, sort arrow and clear button, calendar navigation and selected day, range calendar ends and middles. The private _transparent fill constants are gone; the toggle keeps one for its ghost border, which no state animates.
  • test/fortal/state_colour_lerp_test.dart sweeps every Fortal recipe in every variant, in light and dark under all eight accents. For rest to hover, press, focus, selected and disabled, the selected rest to its hover and press, and selecting under the pointer, it interpolates each colour the resolved spec carries and checks that, over the page, panel and surface colours, no channel leaves the range of its two ends. It also fails when a family in specs/fortal_catalog.json has no recipe in the sweep and no stated reason (families that only compose other recipes or paint themselves are listed), so a new recipe cannot be missed.

Tradeoffs

  • A clear rest exists once per fill, so a control whose states fill with two colours (a toggle's hover gray and its on tint) is exact for its hover and leaves the range by at most about 3 of 255 steps for the other. The sweep allows 4.
  • Six recipes pair an opaque fill with a translucent one, so neither end is clear and no rest colour fixes them: the soft checkbox and switch on check, the soft and quiet surfaces when selected, and the card radio's hover while selected. They still darken (34 to 56 steps) and are listed in the test with the reason. Fixing them needs an opaque equivalent of each translucent fill, which changes its look on other backgrounds; logged as a follow-up.
  • Tests that asserted Colors.transparent now assert a colour with no alpha.

Blast Radius

  • Additions: fortalClear. Nothing is removed or renamed.
  • Default looks are unchanged: every changed colour has alpha 0 at rest. Only the in-between frames of those transitions change.
  • Registry templates and the demo and dashboard mirrors regenerate for the changed items and theme.

Verification

  • The sweep fails on the old recipes: 93 distinct recipe, transition and path findings, 40 to 60 steps out of range. Mutation: putting transparent black back on the menu row fails all 24 sweep cases.
  • On the release web build, the toggle group's selection no longer has a frame darker than both its neighbours (before: up to 66 levels).
  • cd registry_source && flutter test, demo and dashboard suites, check_consumer_apps: pass at the stack tip.

This branch has not been deployed

No deployments
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.

1 participant