Skip to content

feat(wallet): Switch Wallet home-screen shortcut - #795

Merged
QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
claude/switch-wallet-shortcut
Jul 11, 2026
Merged

QuantumExplorer merged 1 commit into
swift-sdk-integrationfrom
claude/switch-wallet-shortcut

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

What

A new Switch Wallet shortcut for the home screen's customizable shortcut bar.

Visibility

  • Appears in the shortcut customization picker only while the current network has more than one switchable wallet (WalletsViewModel.switchableWalletCount, the same manager-wallets ∩ persisted-mnemonics intersection the Wallets screen uses — now a shared helper).
  • If the user placed it on the bar and the device later drops back to a single wallet, the saved slot degrades to Receive without touching the saved configuration (same pattern as the testnet faucet degrading to Spend on mainnet) — it returns as soon as another wallet exists.

Tap behavior (confirmation in every path)

Other wallets Presentation
1 Confirmation alert directly: “Would you like to switch to "<Name>"? You can always switch back later.”
2–5 Bottom-sheet picker (WalletSwitchDialog, name/username/balance per row) → same confirmation alert
>5 Pushes the full Wallets screen (which has its own switch confirmation)

The switch itself runs through the existing WalletsViewModel.switchWallet → SwiftDashSDKWalletRuntime.switchWallet path; the home screen refreshes via the active-wallet-change notification.

Notes

  • Enum case appended last (ShortcutActionType.switchWallet) — raw values persist in DWGlobalOptions.shortcuts, so ordering is load-bearing.
  • Icon reuses the shortcut_switchNetwork circular-arrows glyph; a dedicated asset can replace it later.
  • ShortcutActionType.customizableActions became @MainActor (it now reads main-actor wallet state); its only consumer is the SwiftUI picker.
  • New strings: "Switch Wallet", "Switch", and the confirmation message.

Verification

  • Clean dashpay scheme build (iphonesimulator, ARCHS=arm64).
  • On-device flows pending a QA wallet unlock: worth checking the picker entry appears only with ≥2 wallets, the 1-other-wallet direct confirmation, and the 2–5 sheet.

🤖 Generated with Claude Code

New customizable shortcut that switches the active wallet. It is offered
in the shortcut picker only while the current network has more than one
switchable wallet, and a saved bar slot degrades to Receive if the
device drops back to a single wallet (mirroring the faucet→Spend
pattern; the saved config is untouched).

Tap behavior scales with how many OTHER wallets exist: one → the
confirmation alert directly ("Would you like to switch to …? You can
always switch back later."); two to five → a bottom-sheet picker
(WalletSwitchDialog) followed by the same confirmation; more than
five → the full Wallets screen. A confirmation is shown in every path.

Wallet listing/counting reuses WalletsViewModel (new shared
switchableWallets() intersection); the switch itself goes through the
existing WalletsViewModel.switchWallet runtime call. The shortcut icon
reuses the network-switch glyph.

Co-Authored-By: Claude Fable 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 10, 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: 327f3b8a-2608-4162-9fad-34552db57d12

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 claude/switch-wallet-shortcut

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 merged commit 62a7eb4 into swift-sdk-integration Jul 11, 2026
1 check passed
@QuantumExplorer
QuantumExplorer deleted the claude/switch-wallet-shortcut branch August 7, 2026 08:23
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