-
Notifications
You must be signed in to change notification settings - Fork 171
feat: update shortcut defaults #1440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdded a new UI string resource "Spend" and adjusted shortcut ordering and visibility: Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-05-06T12:52:47.218ZApplied to files:
⏰ 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)
🔇 Additional comments (1)
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 |
There was a problem hiding this 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
📒 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
!prioritizeSpendcondition 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.
abaranouski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verified
Issue being fixed or feature implemented
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist:
Summary by CodeRabbit
New Features
Improvements