Skip to content

feat: hardware wallets settings screen#612

Draft
jvsena42 wants to merge 7 commits into
feat/hw-wallet-activityfrom
feat/hw-wallet-settings
Draft

feat: hardware wallets settings screen#612
jvsena42 wants to merge 7 commits into
feat/hw-wallet-activityfrom
feat/hw-wallet-settings

Conversation

@jvsena42

@jvsena42 jvsena42 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Part of #589

This PR adds a Hardware Wallets settings screen for viewing and managing paired devices, reachable from Settings ▸ General ▸ Payments.

Description

  • Adds a "Hardware Wallets" row to Settings ▸ General ▸ Payments whose value shows the paired-device count and opens the new screen.
  • Adds the Hardware Wallets settings screen: a list of paired devices (connection badge that turns green when connected, device name, ₿ balance) each with a per-row delete, plus an "Add Hardware Wallet" button that opens the existing hardware intro flow.
  • Tapping a device's name opens a Rename Hardware Wallet sheet (NAME field pre-filled + Save); the custom name persists per device, is shared across an xpub group, and flows back into the device's display name everywhere (settings list, Home tile, detail screen).
  • The trailing trash icon removes the device after the shared "funds are safe" confirmation, which stops its watchers, deletes its stored activity, and forgets every paired entry, so its row and the settings count update.
  • Shows an intro-style empty state (the same staggered device hero, accent headline, and copy as the hardware intro sheet) when no devices are paired.

This is the iOS port of synonymdev/bitkit-android#1032. iOS already had the watch-only data layer and shared components (HwWalletManager, the connection badge, the device illustrations, and the hardware intro sheet), so this PR is mainly the settings row, the new list screen, and the rename sheet, laid out to match the Figma frames. Renaming adds a persisted customLabel to the stored device that takes priority when resolving the display name.

Linked Issues/Tasks

Screenshot / Video

QA Notes

OBS: Only tested with emulator

Manual Tests

  • 1. Settings → General → Payments: "Hardware Wallets" row shows with the device icon and the paired-device count.
  • 2. Settings → Hardware Wallets (paired): each device shows a connection badge (green when connected), white name, ₿ balance and a trash icon.
  • 3a. Hardware Wallets → tap a device's name → Rename sheet opens with the current name pre-filled → edit → Save: the row name updates.
    • 3b. Home tile and Hardware Wallet detail show the new name; relaunch the app: the name persists.
    • 3c. Rename → clear the field: Save is disabled (empty name not allowed).
  • 4a. Hardware Wallets → tap a device's trash → confirm dialog (funds-safe copy) → Cancel: device stays listed.
    • 4b. tap trash → Remove: the device is removed and the Settings "Hardware Wallets" count decrements.
  • 5. No paired devices → Hardware Wallets: intro-style empty state (device hero + accent headline) and the Add button are shown.
  • 6. Hardware Wallets → tap Add Hardware Wallet: the hardware intro sheet opens.
  • 7. regression: Home hardware tile still shows the green/gray connection glyph (shared icon unchanged).

Automated Checks

  • Build passes: xcodebuild -workspace Bitkit.xcodeproj/project.xcworkspace -scheme Bitkit -configuration Debug -destination 'platform=iOS Simulator,id=<iPhone 16>' ONLY_ACTIVE_ARCH=YES build (concrete simulator UDID + ONLY_ACTIVE_ARCH=YES because the Rust xcframeworks are arm64-only).
  • node scripts/validate-translations.js: 0 errors (run with glob resolved locally, since this checkout has no package.json).
  • SwiftFormat: clean on changed files.
  • Unit tests added: BitkitTests/HwWalletNameTests now asserts the customLabel override in resolveHwWalletName (custom name wins; empty falls back to label; nil falls back to the prefixed model) — 9 tests pass.
  • No tests added for the screen itself: it is SwiftUI view orchestration over the already-tested HwWalletManager.removeDevice and TrezorManager.forgetDevice; existing BitkitTests/HwWalletManagerTests still cover removal.
  • CI: standard build and test checks run by the PR bot.

@jvsena42 jvsena42 self-assigned this Jun 29, 2026
@jvsena42 jvsena42 added this to the 2.4.0 milestone Jun 29, 2026
@jvsena42 jvsena42 mentioned this pull request Jun 29, 2026
6 tasks
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