Skip to content

fix(theme): stop using onPrimary as a surface or on flipping fills - #2533

Draft
BullishNode wants to merge 1 commit into
mainfrom
fix/dark-mode-onprimary
Draft

fix(theme): stop using onPrimary as a surface or on flipping fills#2533
BullishNode wants to merge 1 commit into
mainfrom
fix/dark-mode-onprimary

Conversation

@BullishNode

Copy link
Copy Markdown
Contributor

⚠️ Requires emulator/device review before merge — this PR had no visual verification (no widget tests exist for these screens); correctness was argued from token values in both palettes and independently re-verified. Test in dark mode: accelerate tile on buy success/order details, both buttons on the express-withdrawal screen, DCA wallet selection input (light mode too — it was invisible there), SINPE success screen, and loading bars across the app (they flashed white in dark mode).

Problem

onPrimary is white in BOTH themes by design (text on the red primary). Using it as a background produced white surfaces in dark mode; pairing it with the theme-flipping secondary fill produced white-on-white buttons — e.g. the invisible "Accelerate Transaction" tile (#2519) and "Confirm express" button (#2520).

Changes — full audit of all 131 onPrimary usages

  • 27 background/fill uses → surface (pixel-identical in light mode, where both are white; 13 of these were FadingLinearProgress tracks)
  • 4 foregrounds on secondary fills → onSecondary (matches the 62 existing correct call sites)
  • Accelerate tile keeps an explicit surface fill (themed tileColor would paint a mismatched radius-2 shape) with foregrounds on onSurface
  • "Wait for free withdrawal" gains an outline so it reads on the light scaffold
  • Beyond-brief fix: DCA lightning-address field was invisible in light mode (inverse mistake)
  • Deliberately deferred: bb_segmented_button thumb (white thumb + primary-red label needs a paired design change, not a token swap — follow-up issue candidate)

Validation

analyze clean; the audit table (file:line → classification → action for all 131) is available on request; reviewer independently re-inspected ~50 sites and ran exhaustive pattern hunts — no missed cases found.

Closes #2519
Closes #2520

onPrimary is white in both themes by design (text on the red primary).
Using it as a background produced white surfaces in dark mode, and
pairing it with the theme-flipping secondary fill produced
white-on-white buttons.

Audited all 131 onPrimary usages:
- 27 background/fill uses swapped to surface. Pixel-identical in light
  mode (both are white there); dark mode gets the proper dark surface.
  13 of these were FadingLinearProgress tracks that flashed as bright
  white bars across dark screens.
- 4 foregrounds on secondary fills swapped to onSecondary, including
  the buy accelerate screen's invisible Confirm express button.
- The accelerate transaction tile keeps an explicit surface fill (the
  themed tileColor would paint a mismatched radius-2 shape under the
  tile's radius-4 border) and its foregrounds move to onSurface.
- The Wait for free withdrawal button gains an outline so it reads on
  the light scaffold as well.
- Also fixes the DCA lightning-address field, which was invisible in
  light mode from the inverse mistake.

The segmented-button thumb (bb_segmented_button.dart) is deliberately
untouched: its white thumb carries a primary-red label and needs a
paired design change, not a token swap.

Closes #2519
Closes #2520
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