Skip to content

One style kit per platform for the native screens - #94

Merged
gf5901 merged 3 commits into
mainfrom
feat/native-style-kit
Nov 16, 2026
Merged

gf5901 merged 3 commits into
mainfrom
feat/native-style-kit

Conversation

@gf5901

@gf5901 gf5901 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The native screens (pay confirmation, saving a contact, recovery phrase, backup check, viewing key, restore) each set their own fonts, sizes, corners and colours. #92 and #93 fixed the type, but every file still had its own text(), field(), row(), tab and chip code, so changing the look meant editing a dozen places on each platform.

This adds one kit per platform, named after the React Native components:

Piece iOS (ios/Kit.swift) Android (android/.../Kit.kt) RN
Text kinds Text(…).kit(.body) Kit.text(a, …, TextKind.BODY) T
Buttons KitButton(…, .primary / .secondary / .quiet, danger:, busy:) Kit.button(a, …, ButtonKind.…) Button
Link LinkButton Kit.link strong HeaderLink
Pill tabs PillTabs Kit.pillTabs Tabs variant="pill"
Testnet badge TestnetBadge Kit.testnetBadge TestnetBadge
Field .kitField() Kit.field TextField
Also DetailRow, Chip, WordChoice, KitToggle, KitPage, .kitCard() detail, chip, wordChoice, switch, bottomSheet

The screens on both platforms now use only the kit and set no fonts, sizes, radii or colours of their own. On Android, KitButton dims to 0.8 while pressed and fades to 0.45 when disabled, like the RN button. Before, Android showed neither. On iOS every kit control now fades when disabled (before, only the main buttons did), so the restore screen's chips, link and tabs fade while it restores. Pill tabs on both platforms count the track's inset as part of the 48-point target, as RN's hitSlop does.

Keeping it in step with RN. theme.ts gains the sizes the RN components and the native screens both wrote out as literals (size.dust, monoLarge, button, tab, badge, space.button, space.pillInset), and the RN components now use them. The kits copy size, radius and space under the same names. The plugin's theme gains faint (placeholders) and onAccent (the Testnet badge's words). The new mobile/src/native-kit.test.ts fails when:

  • a value in Kit.swift or Kit.kt differs from theme.ts, or the two kits stop having the same names;
  • app.json's native theme / themeLight differs from Night / Vellum in theme.ts;
  • a face the RN app uses is missing from either kit.

The native fallback colours were already checked against app.json by plugin/options.test.ts, so the chain is theme.ts → app.json → native fallbacks. wallet-native/README.md has a new section on how to change the look.

Small visible changes, all toward the RN look:

  • Android bottom sheets: top corners 20 → 28dp (radius.sheetTop).
  • Placeholders ("word 3", "uview1…") are faint, not muted.
  • Testnet badge words use onAccent, and its vertical padding is 2 (RN), not 3.
  • The screen-recording warning card: corner radius 12 → 14 (radius.field), body type.
  • Android sheet text loses 2dp of padding above and below each line, the same as iOS.

Rules the code keeps

See CONTRIBUTING.md. Tick each box, or
explain below why it doesn't apply.

  • The recovery phrase and keys stay in native code; no JS function takes
    or returns them.
  • Every read of the phrase still needs Face ID, Touch ID, a fingerprint
    or the device passcode.
  • Every send still goes through the native confirmation sheet, drawn from
    the engine's proposal, and ends in the biometric prompt.
  • One network per build: nothing lets a build reach the other network.
  • The wallet database still holds viewing keys only, and no Sapling
    parameters were added.
  • New data kept on the phone stays out of OS backups (or the design says
    otherwise).
  • Nothing here is a recovery phrase (even testnet), a key, a signing file,
    google-services.json or a deployment detail.

FLAG_SECURE, privacySensitive(), the capture watch and the confirmation sheet's content are unchanged; only how they are drawn moved.

Privacy and dependencies

  • This doesn't change what Wizard sends, to which server, or what it
    stores. If it does, say what below: the
    privacy policy has to change in step.
  • No new dependency, or it's explained below (why, who maintains it,
    cargo deny check passes, npm version pinned).
  • The spec or design guide is updated in this PR if behaviour or the look
    changed.

The design guide is not edited. The native screens now follow the tokens it already describes, and the README documents the kits.

Testing

  • biome check, tsc --noEmit and vitest for mobile (133 tests) and wallet-native (161 tests) pass. The new drift test was checked by changing Radius.field in Kit.kt to 12: it failed and named the value.
  • Kotlin: expo prebuild + ./gradlew --offline :wizard-wallet-native:compileDebugKotlin: BUILD SUCCESSFUL.
  • Swift: swiftc -typecheck against the iOS simulator SDK at the podspec's 16.4 target, for Kit.swift, the three screen files, WalletSettings.swift and the current UniFFI bindings (stubs for the rest of the module): no errors. No full xcodebuild.
  • Rust engine untouched; scripts/check.sh's Rust steps not run.
  • Not run on a phone or simulator. Phone checks needed on both platforms: restore (both tabs, suggestions, Paste/Scan, Advanced, date step), recovery phrase + backup check, viewing key, pay confirmation (private, public, request, shield), and the contact sheet, in Dark and Light.

🤖 Generated with Claude Code

gf5901 and others added 3 commits November 16, 2026 12:38
Kit.swift and Kit.kt hold the native screens' text kinds, buttons
(primary, secondary, quiet, danger), link, chip, word choice, pill tabs,
detail row, Testnet badge, field, switch and sheet ground, named after
the React Native components. The pay confirmation, contact, recovery
phrase, viewing key and restore screens on both platforms now use them
and set no fonts, sizes, radii or colours of their own.

theme.ts gains the sizes the kits and RN components shared as literals
(dust, monoLarge, button, tab, badge, space.button, space.pillInset),
and the RN components use them. The plugin's theme gains faint
(placeholders) and onAccent (the Testnet badge's words).
native-kit.test.ts fails when either kit or app.json stops matching
theme.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- iOS Face.mono is 13 and Face.monoLarge 16, the same as Size and TextKind.
- Every iOS kit control fades when disabled (in PressedFade), not only
  KitButton: chips, link, word choices and tabs while restoring.
- Pill tabs count the track's inset as part of each 48-point target, as
  React Native's hitSlop does; a tap on the chosen tab does nothing.
- Drop the unused Radius.card from both kits.
- The drift test checks each iOS face's full PostScript name.
- Android: build the older-funds note with its text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The raised pill stays inset (InsetDrawable); the track's inset is part
of each tab's target, as on iOS and in React Native.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gf5901
gf5901 merged commit 8e7cf49 into main Nov 16, 2026
4 checks passed
@gf5901
gf5901 deleted the feat/native-style-kit branch November 16, 2026 22:07
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