Skip to content

Conversation

@HashEngineering
Copy link
Collaborator

@HashEngineering HashEngineering commented Nov 7, 2025

Issue being fixed or feature implemented

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

Summary by CodeRabbit

  • New Features

    • Spend prioritization added to preset shortcuts (prioritize spend actions).
  • Improvements

    • Updated shortcut labels (added "Spend") and ordering for clarity.
    • Adjusted which shortcuts are shown based on account balance and passphrase verification:
      • QR scan now requires a verified passphrase.
      • Send is shown if balance exists or passphrase is verified.
      • Address/contact send options respect spend prioritization.

@HashEngineering HashEngineering self-assigned this Nov 7, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

Added a new UI string resource "Spend" and adjusted shortcut ordering and visibility: ShortcutOption was reordered and relabeled, getFilteredShortcuts gained a prioritizeSpend flag, and visibility conditions for SCAN_QR, SEND, SEND_TO_ADDRESS, and SEND_TO_CONTACT were updated.

Changes

Cohort / File(s) Change Summary
String Resource Addition
\common/src/main/res/values/strings.xml``
Added string resource spend_title = "Spend".
Shortcut Enum Update
\wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutOption.kt``
Reordered enum entries: moved EXPLORE after WHERE_TO_SPEND; changed WHERE_TO_SPEND text resource from R.string.explore_where_to_spend to R.string.spend_title.
Shortcut Filtering / Visibility
\wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutProvider.kt`, `wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutsViewModel.kt``
Added prioritizeSpend: Boolean = true parameter to getFilteredShortcuts and updated visibility logic: SCAN_QR now requires userHasBalance && isPassphraseVerified; SEND visible when userHasBalance

Sequence Diagram(s)

sequenceDiagram
    participant VM as ShortcutsViewModel
    participant Provider as ShortcutProvider
    note right of VM `#DDEEFF`: request preset shortcuts
    VM->>Provider: getFilteredShortcuts(isPassphraseVerified, userHasBalance, userHasContacts, prioritizeSpend=true)
    alt prioritizeSpend = true
        Provider->>Provider: evaluate visibility rules
        Provider->>VM: return shortcuts list
        note right of Provider `#F6F6E9`: decisions (high-level)\n- SCAN_QR: userHasBalance && isPassphraseVerified\n- SEND: userHasBalance || isPassphraseVerified\n- SEND_TO_ADDRESS: userHasBalance && !prioritizeSpend\n        note right of Provider `#F6F6E9`: SEND_TO_CONTACT also requires userHasContacts
    else prioritizeSpend = false
        Provider->>Provider: alternative visibility path
        Provider->>VM: return shortcuts list
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to the updated boolean logic in ShortcutProvider.kt (SCAN_QR, SEND, SEND_TO_ADDRESS, SEND_TO_CONTACT).
  • Verify prioritizeSpend default and its effect when invoked from ShortcutsViewModel.
  • Confirm ShortcutOption enum reorder doesn't affect ordinal-dependent behavior elsewhere.

Poem

🐇 I found a "Spend" on my trail tonight,
Hopped enums around to place it just right,
Visibility rules now skip and prance,
Prioritize spend — give wallets a chance! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: update shortcut defaults' directly reflects the main changes: new string resource for spend functionality and modifications to shortcut visibility logic and defaults across multiple files.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/update-shortcuts

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2020a71 and 5c06515.

📒 Files selected for processing (1)
  • wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutsViewModel.kt (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: HashEngineering
Repo: dashpay/dash-wallet PR: 1422
File: common/src/main/java/org/dash/wallet/common/util/Constants.kt:68-69
Timestamp: 2025-08-25T15:00:20.777Z
Learning: HashEngineering prefers to keep HTTP logging enabled in release mode (using log.info instead of gating with BuildConfig.DEBUG) to debug production errors, even though this may leak URLs in production logs. This is a deliberate trade-off for debugging purposes in the Dash wallet project.
Learnt from: HashEngineering
Repo: dashpay/dash-wallet PR: 1410
File: wallet/src/de/schildbach/wallet/data/InvitationLinkData.kt:79-84
Timestamp: 2025-07-12T07:12:04.769Z
Learning: HashEngineering prefers to handle defensive validation improvements for URI parsing in follow-up PRs rather than including them in the current PR when the main focus is on replacing Firebase with AppsFlyer.
Learnt from: HashEngineering
Repo: dashpay/dash-wallet PR: 1423
File: wallet/src/de/schildbach/wallet/ui/EditProfileActivity.kt:418-446
Timestamp: 2025-08-25T14:48:39.247Z
Learning: HashEngineering prefers to refactor and reuse topup code for balance validation logic improvements in DashPay activities like EditProfileActivity, rather than implementing individual fixes in the current PR.
Learnt from: HashEngineering
Repo: dashpay/dash-wallet PR: 1425
File: wallet/src/de/schildbach/wallet/ui/more/SettingsScreen.kt:122-151
Timestamp: 2025-09-05T06:47:44.508Z
Learning: HashEngineering prefers to defer UI edge case fixes like the CoinJoin finishing state display issue (showing "Finishing ...%" when mode is OFF but status is FINISHING) to later PRs when the main focus is on redesigning the settings screen.
Learnt from: HashEngineering
Repo: dashpay/dash-wallet PR: 1422
File: wallet/src/de/schildbach/wallet/data/PaymentIntent.java:476-481
Timestamp: 2025-08-25T15:04:18.461Z
Learning: HashEngineering prefers to keep payeeUsername and payeeUserId in PaymentIntent.toString() logs unredacted for debugging purposes, prioritizing troubleshooting capability over PII protection concerns in the Dash wallet project.
Learnt from: HashEngineering
Repo: dashpay/dash-wallet PR: 1425
File: common/src/main/java/org/dash/wallet/common/ui/components/DashButton.kt:94-101
Timestamp: 2025-09-05T06:00:25.088Z
Learning: HashEngineering prefers to fix the DashButton alpha dimming issue (using explicit disabled colors instead of overall alpha) in a follow-up PR rather than including it in the current settings screen redesign PR.
📚 Learning: 2025-05-06T12:52:47.218Z
Learnt from: Syn-McJ
Repo: dashpay/dash-wallet PR: 1385
File: wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutProvider.kt:0-0
Timestamp: 2025-05-06T12:52:47.218Z
Learning: In the ShortcutProvider class, custom shortcuts being empty on fresh installs is intentional. The app uses getFilteredShortcuts() method to provide default shortcuts until the user explicitly customizes them.

Applied to files:

  • wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutsViewModel.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (1)
wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutsViewModel.kt (1)

166-167: LGTM! Explicit parameter clarifies preset shortcut behavior.

The addition of prioritizeSpend = true clearly documents that preset shortcuts should prioritize spend-related options, aligning well with the PR's objective to update shortcut defaults.


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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0354fe1 and 2020a71.

📒 Files selected for processing (3)
  • common/src/main/res/values/strings.xml (1 hunks)
  • wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutOption.kt (2 hunks)
  • wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutProvider.kt (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: HashEngineering
Repo: dashpay/dash-wallet PR: 1422
File: common/src/main/java/org/dash/wallet/common/util/Constants.kt:68-69
Timestamp: 2025-08-25T15:00:20.777Z
Learning: HashEngineering prefers to keep HTTP logging enabled in release mode (using log.info instead of gating with BuildConfig.DEBUG) to debug production errors, even though this may leak URLs in production logs. This is a deliberate trade-off for debugging purposes in the Dash wallet project.
Learnt from: HashEngineering
Repo: dashpay/dash-wallet PR: 1410
File: wallet/src/de/schildbach/wallet/data/InvitationLinkData.kt:79-84
Timestamp: 2025-07-12T07:12:04.769Z
Learning: HashEngineering prefers to handle defensive validation improvements for URI parsing in follow-up PRs rather than including them in the current PR when the main focus is on replacing Firebase with AppsFlyer.
Learnt from: HashEngineering
Repo: dashpay/dash-wallet PR: 1423
File: wallet/src/de/schildbach/wallet/ui/EditProfileActivity.kt:418-446
Timestamp: 2025-08-25T14:48:39.247Z
Learning: HashEngineering prefers to refactor and reuse topup code for balance validation logic improvements in DashPay activities like EditProfileActivity, rather than implementing individual fixes in the current PR.
Learnt from: HashEngineering
Repo: dashpay/dash-wallet PR: 1425
File: wallet/src/de/schildbach/wallet/ui/more/SettingsScreen.kt:122-151
Timestamp: 2025-09-05T06:47:44.508Z
Learning: HashEngineering prefers to defer UI edge case fixes like the CoinJoin finishing state display issue (showing "Finishing ...%" when mode is OFF but status is FINISHING) to later PRs when the main focus is on redesigning the settings screen.
Learnt from: HashEngineering
Repo: dashpay/dash-wallet PR: 1422
File: wallet/src/de/schildbach/wallet/data/PaymentIntent.java:476-481
Timestamp: 2025-08-25T15:04:18.461Z
Learning: HashEngineering prefers to keep payeeUsername and payeeUserId in PaymentIntent.toString() logs unredacted for debugging purposes, prioritizing troubleshooting capability over PII protection concerns in the Dash wallet project.
Learnt from: HashEngineering
Repo: dashpay/dash-wallet PR: 1425
File: common/src/main/java/org/dash/wallet/common/ui/components/DashButton.kt:94-101
Timestamp: 2025-09-05T06:00:25.088Z
Learning: HashEngineering prefers to fix the DashButton alpha dimming issue (using explicit disabled colors instead of overall alpha) in a follow-up PR rather than including it in the current settings screen redesign PR.
📚 Learning: 2025-05-06T12:52:47.218Z
Learnt from: Syn-McJ
Repo: dashpay/dash-wallet PR: 1385
File: wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutProvider.kt:0-0
Timestamp: 2025-05-06T12:52:47.218Z
Learning: In the ShortcutProvider class, custom shortcuts being empty on fresh installs is intentional. The app uses getFilteredShortcuts() method to provide default shortcuts until the user explicitly customizes them.

Applied to files:

  • wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutProvider.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (6)
common/src/main/res/values/strings.xml (1)

16-16: LGTM!

The new string resource is well-named and appropriately placed. The value "Spend" is concise and clearly communicates the action to users.

wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutOption.kt (1)

65-74: LGTM! Reordering correctly preserves stable IDs.

The changes appropriately prioritize spend functionality by:

  • Updating WHERE_TO_SPEND to use the clearer "Spend" label
  • Reordering EXPLORE after WHERE_TO_SPEND while preserving its ID

The stable ID preservation ensures existing user customizations remain intact.

wallet/src/de/schildbach/wallet/ui/main/shortcuts/ShortcutProvider.kt (4)

73-94: Helpful documentation!

The documentation clearly describes the default shortcut behavior across different user states and accurately matches the implementation logic.


106-106: LGTM! Stricter security requirement for SCAN_QR.

The updated logic now requires both balance and passphrase verification for the SCAN_QR shortcut, which is a sensible security measure since scanning QR codes for payment should only be available when the wallet is properly secured.


107-107: LGTM! Appropriate SEND shortcut visibility logic.

The OR condition makes sense: SEND is shown when users either have balance to send or have verified their passphrase (indicating wallet security readiness). This aligns with the documented behavior.


109-110: LGTM! Well-designed prioritization logic.

The !prioritizeSpend condition effectively implements a toggle between simplified (spend-focused) and granular (multiple send options) interfaces. When enabled by default, it reduces complexity by hiding SEND_TO_ADDRESS and SEND_TO_CONTACT in favor of the WHERE_TO_SPEND shortcut.

Copy link

@abaranouski abaranouski left a comment

Choose a reason for hiding this comment

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

verified

@HashEngineering HashEngineering merged commit 56c8d22 into master Nov 13, 2025
2 of 3 checks passed
@HashEngineering HashEngineering deleted the feat/update-shortcuts branch November 13, 2025 16:00
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.

3 participants