Skip to content

feat(ui): migrate SwiftUI views to DashUIKit color tokens for dark mode - #849

Merged
QuantumExplorer merged 4 commits into
swift-sdk-integrationfrom
fix/ui-colors-dark-mode
Jul 18, 2026
Merged

QuantumExplorer merged 4 commits into
swift-sdk-integrationfrom
fix/ui-colors-dark-mode

Conversation

@romchornyi

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

The app follows the system appearance (it is not pinned to light mode), but many SwiftUI views used non-adaptive colors: hardcoded literals (Color.white, Color.black, Color(red:…)) and app-local Color+DWStyle tokens where only 26 of 125 colorsets carry a dark variant. In dark mode this produced broken visuals — invisible drag handles, a white-on-white selected tab pill, black shadows/scrims, and fixed-white cards under light text.

What was done?

Migrated color usage across the SwiftUI view tree to DashUIKit's Color.dash.* tokens (asset-backed with proper light/dark variants):

  • App tokens → Color.dash.* by name (primaryText, secondaryBackground, gray300, blueAlpha10, …).
  • SwiftUI system semantics .foregroundColor(.secondary/.primary) → Color.dash.secondaryText/primaryText.
  • Purpose-built tokens for the known bugs: drag handles → grabberFill, modal/screen scrims → backgroundOverlay, black-opacity shadows → shadow, white-on-colored content → whiteText.
  • Dark-mode-specific cases resolved with @Environment(\.colorScheme) + the best-fitting token (e.g. the payments hero selected-tab pill: white in light, whiteAlpha20 in dark, mirroring DashUIKit SegmentedControl); the "Customize shortcut bar" banner moved to secondaryBackground.
  • import DashUIKit added where newly needed.

Out of scope, deliberately unchanged: legacy ObjC/UIKit views, UIColor.system* (already appearance-adaptive), and ContactAvatarView's algorithmic hue-generated colors.

Three commits: shared components, remaining feature views, and the dark-mode tab/banner fix.

How Has This Been Tested?

Full dashpay build green (xcodebuild ... -scheme dashpay -sdk iphonesimulator ARCHS=arm64 build). Ran on device in dark mode and fixed the reported white-on-white active tab pill; a further dark-mode spot-check across all screens is recommended before merge.

Breaking Changes

None. Visual-only; no behavior changes.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Move the shared component library (Button, Dialogs, MenuItem, SegmentedControl,
NavigationBar, Toast, Icons, steppers, intros, …) off the app-local Color+DWStyle
tokens and hardcoded literals onto Color.dash.* — DashUIKit's asset-backed tokens
with proper light/dark variants. Replaces drag-handle literals with Color.dash.grabberFill,
modal scrims with Color.dash.backgroundOverlay, and white-on-colored content with
Color.dash.whiteText. Adds `import DashUIKit` where newly needed. First batch of the
dark-mode color sweep.
Sweep the feature views (Payments, Home, DashPay, Explore/DashSpend, Swap,
Coinbase, Buy&Sell, CrowdNode, Menu, Auth, Tx, shared Views) off the app-local
Color+DWStyle tokens, hardcoded literals, and SwiftUI system semantics onto
DashUIKit's Color.dash.* — asset-backed tokens with proper light/dark variants.

- app tokens → Color.dash.* by name (primaryText, secondaryBackground, gray300, …)
- .foregroundColor(.secondary/.primary) → Color.dash.secondaryText/primaryText
- white-on-colored content → Color.dash.whiteText; drag handles → grabberFill;
  modal/screen scrims → backgroundOverlay; black-opacity shadows → shadow
- UIKit-context UIColor.system* left as-is (already appearance-adaptive); legacy
  ObjC/UIKit views out of scope; algorithmic avatar colors left as-is
- adds `import DashUIKit` where newly needed

Full `dashpay` build verified green prior to the final trivial token swaps.
The payments hero tab selector filled its selected pill with pure white and
labeled it with primaryText, so in dark mode the (light) label sat on white and
vanished. Make the selected fill adaptive — white in light, translucent white
(whiteAlpha20) in dark — via @Environment(\.colorScheme), mirroring DashUIKit's
SegmentedControl, and move the inactive label to Color.dash.secondaryText.

Likewise the "Customize shortcut bar" banner used a fixed white background under
adaptive primaryText; switch it to Color.dash.secondaryBackground so the card
surface inverts with the text.
@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 236d33d8-d8c8-42ed-bc4c-c5bbe4df5b0f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ui-colors-dark-mode

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@QuantumExplorer QuantumExplorer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The namespace migration is broadly mechanical and the diff is clean, but two token choices still defeat the dark-mode goal and should be corrected before merge. I left inline details below.

Non-blocking cleanup: this patch also adds import DashUIKit to ten files with no other changes, and the new PaymentsLandingScreen comment says it mirrors a DashUIKit SegmentedControl even though the pinned package has no such component (the matching implementation is app-local).

Verification: reviewed the full 126-file diff at 013ce4af; git diff --check passes. The only configured PR checks are title validation and CodeRabbit (skipped), so there is no independent build result attached to the PR.

private var separatorView: some View {
Rectangle()
.fill(Color.black.opacity(0.3))
.fill(Color.dash.black.opacity(0.3))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dark-mode regression: DashUIKit’s Black asset is a single fixed near-black value, so this separator still disappears against the dark background. Please use an adaptive semantic color (for example Color.dash.primaryText.opacity(0.3)) or a dedicated divider token so it remains visible in both appearances.

HStack {
Image(systemName: "magnifyingglass")
.foregroundColor(.gray)
.foregroundColor(Color.dash.gray500)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dark-mode regression: DashUIKit’s Gray500 asset is fixed #525C66 and has no dark appearance, so this icon becomes very low-contrast on the dark surface. The same replacement appears in MerchantFiltersView.swift:292 and MasternodesScreen.swift:176; please use an adaptive semantic token such as tertiaryText/secondaryText for all three.

@QuantumExplorer
QuantumExplorer merged commit 1d786d4 into swift-sdk-integration Jul 18, 2026
1 check passed
@QuantumExplorer
QuantumExplorer deleted the fix/ui-colors-dark-mode branch August 7, 2026 08:22
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.

3 participants