Show wallet shield for xpub-only wallets#824
Conversation
Wallet screens currently show a shield only for cold wallets. XPUB-only wallets should be treated as read-only and display the same protection icon in both Android and iOS selected-wallet and send flows to align indicator behavior.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis PR extends the wallet shield icon display to
Confidence Score: 5/5Safe to merge — the changes are cosmetic icon additions with no logic side-effects on the send/receive flow. All six files make the same targeted, low-risk change: include xpubOnly alongside cold when deciding whether to show the Bitcoin shield icon. Wallet type semantics are consistent across iOS and Android, the new string resource is additive, and no routing, balance, or signing logic is touched. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Wallet Loaded] --> B{walletType?}
B --> |COLD| C[Show Shield Icon]
B --> |XPUB_ONLY| C
B --> |HOT| D[No Shield Icon]
B --> |WATCH_ONLY| D
C --> E[Selected Wallet Screen Title]
C --> F[Selected Wallet Loading Screen]
C --> G[Send Flow Account Section]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Wallet Loaded] --> B{walletType?}
B --> |COLD| C[Show Shield Icon]
B --> |XPUB_ONLY| C
B --> |HOT| D[No Shield Icon]
B --> |WATCH_ONLY| D
C --> E[Selected Wallet Screen Title]
C --> F[Selected Wallet Loading Screen]
C --> G[Send Flow Account Section]
Reviews (1): Last reviewed commit: "Show wallet shield for xpub-only wallets" | Re-trigger Greptile |
| val showsShieldIcon = | ||
| manager.walletMetadata?.walletType == WalletType.COLD || | ||
| manager.walletMetadata?.walletType == WalletType.XPUB_ONLY | ||
| val isWatchOnly = manager.walletMetadata?.walletType == WalletType.WATCH_ONLY |
There was a problem hiding this comment.
The
showsShieldIcon computation dereferences manager.walletMetadata twice in the same expression. While walletMetadata is a state field and not a heavy computation, storing the type once in a local before composing the boolean keeps the intent clearer and matches the style used for isWatchOnly on the next line.
| val showsShieldIcon = | |
| manager.walletMetadata?.walletType == WalletType.COLD || | |
| manager.walletMetadata?.walletType == WalletType.XPUB_ONLY | |
| val isWatchOnly = manager.walletMetadata?.walletType == WalletType.WATCH_ONLY | |
| val walletType = manager.walletMetadata?.walletType | |
| val showsShieldIcon = | |
| walletType == WalletType.COLD || | |
| walletType == WalletType.XPUB_ONLY | |
| val isWatchOnly = walletType == WalletType.WATCH_ONLY |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
No description provided.