Repository navigation
feat: redesign about me (dashpay user screen -> dialog) - #1503
Conversation
* feat: add ComposeBottomSheet.kt * feat: add new DashPayUserBottomSheet and connect to Contacts and SearchUserFragment.kt * fix: avatar was defaulting to letter image * feat: add coil compose to wallet module * fix: use NavBarClose and fix background color * fix: add filter to bottom sheet * fix: update icons, adjust filter * fix: update the received request card * fix: text and refactor * fix: icons in activity for sent/accept * fix: replace DashPayUserActivity with DashPayUserBottomSheet in other places * fix: defer finish() after showing DashPayUserBottomSheet, drop dead code Calling Activity.finish() immediately after DashPayUserBottomSheet.show() raced with launchWhenResumed in the sheet's show path, risking an IllegalStateException or a silently dropped fragment commit. Post the finish() so the fragment transaction lands first. Also remove now-unused DashPayUserActivity/Intent imports and commented-out startActivity calls left behind by the bottom-sheet migration. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix: more minor fixes * fix: expand if necessary, add scrolling * fix: don't finish() while DashPayUserBottomSheet is hosted by the activity The bottom sheet is shown on TransactionResultActivity's own FragmentManager, so finishing the activity right after show() tore the sheet down with it - clicking the contact icon just closed the payment window and revealed the main screen. Icon click: drop the finish() entirely; dismissing the sheet returns to the transaction result screen. Close button with contact data: defer finish() until the sheet is dismissed via FragmentLifecycleCallbacks, mirroring the old finish() + DashPayUserActivity flow. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix: coderabbit fixes * fix: master-engineer findings * fix: remove duplicate Grapper.kt causing conflicting Grabber overloads Grapper.kt was a byte-for-byte duplicate of Grabber.kt declaring the same Grabber composable, causing conflicting overloads and overload resolution ambiguity errors in the common module build. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix: compile issues after merging to master --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
* feat: group transactions on DashPayUserBottomSheet * fix: support scrolling * fix: onDispose fix
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughIntroduces ChangesDashPay User Bottom Sheet Feature
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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.
Actionable comments posted: 9
🧹 Nitpick comments (1)
wallet/src/de/schildbach/wallet/ui/dashpay/user/DashPayUserBottomSheetViewModel.kt (1)
112-130: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep raw notifications inside the single
UIState.
rawNotificationscreates a second state source beside_uiState, which makes the ViewModel harder to reason about and drifts from the repo pattern already used here. Folding the raw list intoDashPayUserBottomSheetUIStatekeeps filtering and rendering derived from one source of truth. As per coding guidelines,**/*ViewModel.kt: “ViewModels should use a singleUIStatedata class rather than multiple separate flows”.🤖 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/dashpay/user/DashPayUserBottomSheetViewModel.kt` around lines 112 - 130, The ViewModel currently keeps notification data in a separate `rawNotifications` flow, which violates the single-source-of-truth pattern. Move the raw list into `DashPayUserBottomSheetUIState` and update `DashPayUserBottomSheetViewModel` so filtering derives from `_uiState` only, with `applyFilter` operating on the state-held list instead of a second flow. Adjust the `init` pipeline and any state updates to read/write through `UIState` exclusively, keeping `notifications` as the derived displayed list.Source: Coding guidelines
🤖 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.
Inline comments:
In
`@common/src/main/java/org/dash/wallet/common/ui/avatar/ProfilePictureZoomTransformation.kt`:
- Around line 37-43: The crop logic in
ProfilePictureZoomTransformation.transform should reject malformed zoom
rectangles before sizing the crop. Add a guard around the zoomedRect-derived
calculations so that when zoomedRect.right <= zoomedRect.left or
zoomedRect.bottom <= zoomedRect.top, the method returns the original input
instead of letting the cropWidth/cropHeight coercion produce a 1px sliver. Keep
the existing x/y/cropWidth/cropHeight flow for valid rectangles and place the
new check near the zoomedRect handling in transform.
In `@wallet/src/de/schildbach/wallet/ui/compose_views/ProfileAvatarCompose.kt`:
- Line 63: Remove the username and avatar URL from the composable logging in
ProfileAvatarCompose so user identifiers and profile-picture URLs are not
written to logcat. Update the Log.d call in the compose path to either omit
these values entirely or wrap the logging behind a non-production/build-debug
guard, and make the same change for the related logging around the other
affected lines in this composable.
- Around line 80-85: The avatar request in ProfileAvatarCompose’s image builder
is forcing full-size decoding via Size.ORIGINAL, which can waste memory and
bandwidth for bounded UI rendering. Update the ImageRequest.Builder setup in the
avatar-loading path to use Coil’s target size or another explicit maximum
instead of Size.ORIGINAL so the image is downsampled before decode, while
keeping the existing transformations and crossfade behavior.
In `@wallet/src/de/schildbach/wallet/ui/dashpay/user/DashPayUserBottomSheet.kt`:
- Line 179: The Ignore action in DashPayUserBottomSheet is currently a no-op, so
either wire it to the real ignore flow used by the mirrored activity or
remove/disable the button until implemented. Update the onIgnoreClick handler in
DashPayUserBottomSheet (and any related request-received card wiring such as
contact_request_ignore) so the UI does not expose an inert primary action.
- Around line 266-274: The DashPay contact-change result is being emitted too
early in DashPayUserBottomSheet, because `sendContactRequest()` only queues work
and does not confirm success. Move the `notifyContactChange()` trigger out of
the `CreditCheckOutcome.Proceed` path and into the success handling for
`sendContactRequestState`, so the fragment result is sent only after the contact
operation has actually succeeded; keep the `viewModel.sendContactRequest()` call
where it starts the operation, and use the existing
`viewModel.resetCreditCheck()` flow accordingly.
- Around line 842-846: The displayed amount logic in DashPayUserBottomSheet
should not read from tx.outputs.firstOrNull(), since that can show change or a
single recipient amount for sent rows. Update the amount computation in the same
area as the isSentTransaction()/received classification to use the wallet-net
value basis already used for sent/received detection, or precompute the correct
display amount before passing it into the composable.
In
`@wallet/src/de/schildbach/wallet/ui/dashpay/user/DashPayUserBottomSheetViewModel.kt`:
- Around line 141-158: The applyFilter function in
DashPayUserBottomSheetViewModel currently lets NotificationItemContact always
pass through the else branch, so Sent and Received do not affect contact rows.
Update applyFilter to classify contact items using the same sent/received
direction logic already used for contact-row presentation, and filter them out
when they don’t match the selected NotificationFilter. Keep the existing
behavior for NotificationItemPayment and ALL, and make sure the Contact row
handling follows the same rules as the existing title/icon direction logic.
In
`@wallet/src/de/schildbach/wallet/ui/dashpay/widget/ContactRequestPaneCompose.kt`:
- Around line 82-90: The ContactRequestPaneCompose UI is mapping INVITE_RECEIVED
and ACCEPTING_INVITE to the same send/pay action as FRIENDS, so incoming
requests never show an accept flow. Update the when branch in
ContactRequestPaneCompose so incoming request states use a distinct accept CTA
(with the correct label and onClick handler) instead of DashButton wired to
onPayClick, while keeping the FRIENDS branch on the existing pay action.
In
`@wallet/src/de/schildbach/wallet/ui/transactions/TransactionResultActivity.kt`:
- Around line 296-300: Persist the deferred-finish flow in
TransactionResultActivity so it survives rotation: store a pending-finish flag
in saved instance state and restore it in onCreate/onRestoreInstanceState, then
reattach the FragmentLifecycleCallbacks through finishWhenUserSheetDismissed()
whenever a DashPayUserBottomSheet is still expected to control exit. Make sure
the recreated activity recognizes the pending state before showing/restoring the
sheet, so dismissing the restored bottom sheet still finishes the flow instead
of leaving the user on TransactionResultActivity.
---
Nitpick comments:
In
`@wallet/src/de/schildbach/wallet/ui/dashpay/user/DashPayUserBottomSheetViewModel.kt`:
- Around line 112-130: The ViewModel currently keeps notification data in a
separate `rawNotifications` flow, which violates the single-source-of-truth
pattern. Move the raw list into `DashPayUserBottomSheetUIState` and update
`DashPayUserBottomSheetViewModel` so filtering derives from `_uiState` only,
with `applyFilter` operating on the state-held list instead of a second flow.
Adjust the `init` pipeline and any state updates to read/write through `UIState`
exclusively, keeping `notifications` as the derived displayed list.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8278be2d-ef9f-4de1-8951-1142528f8507
📒 Files selected for processing (22)
.claude/agents/DEVELOPMENT-PATTERNS.mdcommon/src/main/java/org/dash/wallet/common/ui/avatar/ProfilePictureZoomTransformation.ktcommon/src/main/java/org/dash/wallet/common/ui/components/DashButton.ktcommon/src/main/java/org/dash/wallet/common/ui/components/Grabber.ktwallet/build.gradlewallet/res/drawable/ic_notification_contact_received.xmlwallet/res/drawable/ic_notification_contact_sent.xmlwallet/res/values/strings-dashpay.xmlwallet/src/de/schildbach/wallet/data/NotificationItemPayment.ktwallet/src/de/schildbach/wallet/ui/SearchUserFragment.ktwallet/src/de/schildbach/wallet/ui/compose_views/ProfileAvatarCompose.ktwallet/src/de/schildbach/wallet/ui/dashpay/ContactsFragment.ktwallet/src/de/schildbach/wallet/ui/dashpay/NotificationsFragment.ktwallet/src/de/schildbach/wallet/ui/dashpay/user/DashPayUserBottomSheet.ktwallet/src/de/schildbach/wallet/ui/dashpay/user/DashPayUserBottomSheetViewModel.ktwallet/src/de/schildbach/wallet/ui/dashpay/widget/ContactRequestPaneCompose.ktwallet/src/de/schildbach/wallet/ui/invite/InviteDetailsFragment.ktwallet/src/de/schildbach/wallet/ui/main/WalletTransactionsFragment.ktwallet/src/de/schildbach/wallet/ui/transactions/ChangeTaxCategoryExplainerDialogFragment.ktwallet/src/de/schildbach/wallet/ui/transactions/TransactionDetailsDialogFragment.ktwallet/src/de/schildbach/wallet/ui/transactions/TransactionResultActivity.ktwallet/src/de/schildbach/wallet/ui/transactions/TransactionResultViewBinder.kt
* fix: address about-me review findings in DashPay user bottom sheet - ProfilePictureZoomTransformation: reject malformed zoom rects up front instead of producing a 1px sliver - ProfileAvatarCompose: gate username/URL logging behind BuildConfig.DEBUG; drop Size.ORIGINAL so Coil downsamples to the avatar bounds - DashPayUserBottomSheet: disable the unimplemented Ignore button; notify the host only after the contact op succeeds; show wallet-net tx amount instead of the first output - DashPayUserBottomSheetViewModel: apply Sent/Received filter to contact rows using the same direction logic as the row UI - TransactionResultActivity: persist the deferred-finish flag so dismissing the restored bottom sheet still exits after rotation Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * fix: ContactsFragment was blank if pressing back from SearchUserFragment --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Issue being fixed or feature implemented
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes