feat: crowdnode messaging regarding withdrawals#1497
Conversation
📝 WalkthroughWalkthroughThe PR migrates ChangesCrowdNode Withdrawal Reminder and Explore Compose Migration
Sequence Diagram(s)sequenceDiagram
participant MainViewModel
participant MainActivity
participant CrowdNodeWithdrawalReminderDialog
participant StakingActivity
MainViewModel->>MainViewModel: combine(blockchainSyncState, signUpStatus, balance)
Note over MainViewModel: synced + account exists + balance > 0 + not shown yet
MainViewModel->>MainActivity: showCrowdNodeWithdrawalReminder (SingleLiveEvent)
alt Lock screen is active
MainActivity->>MainActivity: pendingCrowdNodeWithdrawalReminder = true
MainActivity->>MainActivity: onLockScreenDeactivated() fires
end
MainActivity->>CrowdNodeWithdrawalReminderDialog: presentCrowdNodeWithdrawalReminder() → show()
CrowdNodeWithdrawalReminderDialog-->>MainActivity: onWithdraw callback
MainActivity->>StakingActivity: createIntent(goToWithdraw=true) → startActivity
StakingActivity->>StakingActivity: maybeNavigateToWithdrawal()
StakingActivity->>StakingActivity: navigate to transferFragment (WITHDRAW_ARG=true)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
wallet/src/de/schildbach/wallet/ui/explore/ExploreScreen.kt (1)
165-216:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAvoid exact
Doubleequality for APY branch selection.Using
apy == 0.0can render the “APY row” for tiny values that still format to0.0, causing inconsistent UI state. Prefer a positive-threshold check for the APY variant.Suggested fix
- if (apy == 0.0) { + if (apy <= 0.0) { MenuItem( title = stringResource(R.string.staking_title), subtitle = stringResource(R.string.explore_staking_subtitle), icon = R.drawable.ic_deposit, action = onClick ) } else {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@wallet/src/de/schildbach/wallet/ui/explore/ExploreScreen.kt` around lines 165 - 216, Replace the exact equality check for APY in the conditional statement from `apy == 0.0` with a threshold-based comparison such as `apy <= 0.0` to handle all negligible APY values consistently. This prevents tiny positive APY values from matching the exact zero condition while still formatting as "0.0" in the display, which would cause the MenuItem composable to be shown instead of the custom Row layout with the inline APY pill, creating inconsistent UI behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@wallet/src/de/schildbach/wallet/ui/explore/ExploreScreen.kt`:
- Around line 165-216: Replace the exact equality check for APY in the
conditional statement from `apy == 0.0` with a threshold-based comparison such
as `apy <= 0.0` to handle all negligible APY values consistently. This prevents
tiny positive APY values from matching the exact zero condition while still
formatting as "0.0" in the display, which would cause the MenuItem composable to
be shown instead of the custom Row layout with the inline APY pill, creating
inconsistent UI behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f13929cc-a227-456b-b4c2-3c620e93a072
📒 Files selected for processing (2)
wallet/src/de/schildbach/wallet/ui/explore/ExploreScreen.ktwallet/src/de/schildbach/wallet/ui/staking/CrowdNodeWithdrawalReminderDialog.kt
🚧 Files skipped from review as they are similar to previous changes (1)
- wallet/src/de/schildbach/wallet/ui/staking/CrowdNodeWithdrawalReminderDialog.kt
Issue being fixed or feature implemented
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist:
Summary by CodeRabbit
New Features
UI Improvements
Bug Fixes & Improvements