Skip to content

Show wallet shield for xpub-only wallets#824

Merged
praveenperera merged 1 commit into
masterfrom
xpub-show-shield
Jul 3, 2026
Merged

Show wallet shield for xpub-only wallets#824
praveenperera merged 1 commit into
masterfrom
xpub-show-shield

Conversation

@praveenperera

Copy link
Copy Markdown
Contributor

No description provided.

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.
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: df953e5d-6b9f-4739-950b-b9d252acf633

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 xpub-show-shield

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.

@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown

Greptile Summary

This PR extends the wallet shield icon display to xpubOnly wallets in addition to cold wallets, updating four UI locations on both iOS and Android (selected wallet loading screen, selected wallet title, and the send flow account section). A new label_wallet_address_type string resource is also added for Android.

  • Shield icon display: All three locations that previously showed the shield only for .cold/COLD wallet types now also show it for .xpubOnly/XPUB_ONLY, using a consistent equality check in place of Swift pattern matching.
  • String resource: label_wallet_address_type is added to strings.xml; it appears consumed in the generated FFI bindings (cove_core).

Confidence Score: 5/5

Safe 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

Filename Overview
android/app/src/main/java/org/bitcoinppl/cove/flows/SelectedWalletFlow/SelectedWalletScreen.kt Renames isColdWallet to showsShieldIcon and extends it to include XPUB_ONLY; accesses manager.walletMetadata twice in the condition expression
android/app/src/main/java/org/bitcoinppl/cove/flows/SelectedWalletFlow/SelectedWalletContainer.kt Adds showsShieldIcon from non-nullable metadata; straightforward and correct
android/app/src/main/res/values/strings.xml Adds label_wallet_address_type string resource; used in generated FFI bindings
ios/Cove/Flows/SelectedWalletFlow/SelectedWalletContainer.swift Changes pattern match to equality comparison; adds xpubOnly to shield icon condition in loading screen title
ios/Cove/Flows/SelectedWalletFlow/SelectedWalletContentViews.swift Same pattern as SelectedWalletContainer.swift — changes pattern match to equality check for cold/xpubOnly
ios/Cove/Flows/SendFlow/Common/SendFlowAccountSection.swift Extends shield icon to xpubOnly in the send flow account header; consistent with wallet type semantics

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]
Loading
%%{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]
Loading

Reviews (1): Last reviewed commit: "Show wallet shield for xpub-only wallets" | Re-trigger Greptile

Comment on lines +194 to 197
val showsShieldIcon =
manager.walletMetadata?.walletType == WalletType.COLD ||
manager.walletMetadata?.walletType == WalletType.XPUB_ONLY
val isWatchOnly = manager.walletMetadata?.walletType == WalletType.WATCH_ONLY

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 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.

Suggested change
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!

@praveenperera praveenperera merged commit df8cfaa into master Jul 3, 2026
10 checks passed
@praveenperera praveenperera deleted the xpub-show-shield branch July 3, 2026 20:44
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