Repository navigation
refactor(ui): standardize dismiss-safe sheets on DashUIKit - #1074
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
💤 Files with no reviewable changes (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe PR standardizes sheet presentation across DashPay, DashSpend, tools, balance information, and payment flows by using ChangesBottom sheet migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This PR standardizes several wallet sheets on the shared bottom-sheet component while preserving existing callbacks, detents, and native share flows; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
b5273c4 to
bb34895
Compare
|
@coderabbitai review\n\n---\n🤖 Posted autonomously by Codex on behalf of pasta. |
|
✅ Action performedReview finished.
|
romchornyi
left a comment
There was a problem hiding this comment.
Reviewed on top of #1073 (this branch is stacked on refactor/dashuikit-bottom-sheet-foundation), against the pinned DashUIKit revision 5b373b1 rather than master.
The wrapping itself is mechanically clean: no wrapped view is used outside the touched call sites, the removed @Environment properties leave no dangling references, and presentationMode-based dismissal still resolves correctly through the BottomSheet's NavigationView for both .sheet(item:) and .sheet(isPresented:).
The problem is that wrapping adds 82pt of chrome (18pt grabber + 64pt NavigationBar) and three call sites weren't re-tuned for it. Two of those are inline below and should be fixed before merge; the third is a layout risk I could only assess by reading the layout.
One non-finding, so it doesn't get re-raised: the TransferTimingSheet X never cleared setReceiptWatchingObscured before this PR either — that leak is pre-existing, not introduced here. Chrome height is also a wash for the fixed-height sheets, since the old NavBarClose was 64pt too, so .height(640) for the extended public key and .height(400) for the endpoint picker still fit.
🤖 Reviewed with Claude Code
| confirmContestedSubmission(temporaryUsername: temporaryUsername) | ||
| }, | ||
| onCancel: { showContestedConfirmation = false }) | ||
| DashUIKit.BottomSheet( |
There was a problem hiding this comment.
This sheet loses keyboard avoidance, and it is the one sheet here that has a text field.
BottomSheet defaults to fillsHeight: true, which applies edgesIgnoringSafeArea(.bottom). That ignores the .keyboard safe-area region as well as the home indicator, so nothing moves when the keyboard comes up. Before this PR ContestedNameConfirmationSheet was presented bare and got SwiftUI's default keyboard avoidance.
The layout makes that bite: TemporaryUsernameField is inside the ScrollView, but all three DashButtons — Submit both usernames, Continue without a temporary username, Cancel — sit outside it. Focus the field and the buttons are behind the keyboard with no way to scroll to them, and TextInput has no Done toolbar. The user can still get out via interactive scroll-to-dismiss, so it is not a dead end, but it is a real regression in the middle of username creation.
Either pass fillsHeight: false here and size the sheet accordingly, or move the buttons inside the scrollable region, or add a keyboard-dismiss affordance.
| DashUIKit.BottomSheet.selfSizing( | ||
| title: NSLocalizedString("Confirm", comment: "DashSpend"), | ||
| showBackButton: .constant(false), | ||
| fallback: 500, |
There was a problem hiding this comment.
fallback: 500 is now stale. It was measured against the bare DashSpendConfirmationDialog; the view selfSizing measures now includes the 82pt of chrome this PR adds (18pt grabber + 64pt NavigationBar).
fallback is the detent used before the first measurement, so the gift-card confirmation sheet presents at 500pt and then jumps to roughly 582pt once the real height arrives — exactly the flash fallback exists to prevent.
The same stale value is duplicated at DashSpendConfirmationDialog.swift:149 (outside this diff), so both need updating together.
| self?.viewModel.setReceiptWatchingObscured(false) | ||
| } | ||
| })) | ||
| rootView: DashUIKit.BottomSheet(showBackButton: .constant(false)) { |
There was a problem hiding this comment.
TransferTimingSheet gains the same 82pt of chrome inside an unchanged .medium() detent, and the content has nothing to give it back: the text uses fixedSize and the only flexible element is a Spacer(minLength: 8).
On a short device or with a long translation the "I got it" CTA should clip — and that button is the only thing that writes shieldedBalanceTimingShownKey, so if it can't be tapped the sheet re-shows on every visit.
I assessed this from the layout rather than on a device, so please check it on the smallest supported screen with a long locale before merging — or give the sheet an explicit detent that accounts for the chrome.
Wrapping these views in `DashUIKit.BottomSheet` adds 82pt of chrome — an 18pt grabber and a 64pt navigation bar — and three call sites were not adjusted for it. - `TransferTimingSheet` is presented in a fixed `.medium()` detent with `fixedSize` text and a single `Spacer(minLength: 8)`, so the chrome came straight out of the CTA. Make the text scroll instead: "I got it" is the only thing that records `shieldedBalanceTimingShownKey`, so clipping it would re-show the sheet forever. - `fallback:` is the detent used before `selfSizingSheet` measures, and 500 was sized for the bare dialog. Move it to `DashSpendConfirmationDialog.sheetFallbackHeight` (582) so both presenters read one value and can't drift apart again. - `BottomSheet(fillsHeight: true)` applies `edgesIgnoringSafeArea(.bottom)`, which swallows the keyboard region as well as the home indicator, so the contested-name sheet no longer moves for the keyboard — and its three action buttons sit outside the ScrollView, unreachable while typing. Add interactive scroll-to-dismiss and a Done keyboard toolbar. The last one treats the symptom; the durable fix is for `BottomSheet` to ignore only the container region (`.ignoresSafeArea(.container, edges: .bottom)`), which has to happen in DashUIKit.
romchornyi
left a comment
There was a problem hiding this comment.
All three findings from my earlier review are addressed in b8cf2aa96, which I pushed to this branch:
- Contested-name sheet —
BottomSheet(fillsHeight: true)appliesedgesIgnoringSafeArea(.bottom), which swallows the keyboard region, and the three action buttons sit outside the ScrollView. Added interactive scroll-to-dismiss and a Done keyboard toolbar so they stay reachable. fallback: 500— was sized for the bare dialog and is now short by the 82pt of chrome this PR adds. Moved toDashSpendConfirmationDialog.sheetFallbackHeight(582) so both presenters read one value.TransferTimingSheet— the same 82pt came out of a fixed.medium()detent withfixedSizetext, so the CTA could clip. The text now scrolls; "I got it" is the only thing that writesshieldedBalanceTimingShownKey, so clipping it would have re-shown the sheet forever.
Verified on an iPhone 17 Pro / iOS 26.5 simulator against a develop baseline built from a separate clean checkout.
The keyboard fix treats the symptom. The durable fix is for BottomSheet to ignore only the container region (.ignoresSafeArea(.container, edges: .bottom)) rather than everything including .keyboard — that belongs in DashUIKit and would fix every sheet with a text field at once.
Unrelated to this PR, found while testing and filed here so it isn't lost: after logging in to a physical-merchant gift-card flow, the merchant details sheet re-presents itself over the Enter Amount screen. POIDetailsViewController.performAfterDismissingDetailsSheetIfNeeded clears didPresentDetailsSheet before pushing the auth screen; the later popViewController(animated: false) then lets viewDidAppear re-present the sheet just before the amount screen is pushed, and isModalInPresentation = true means it cannot be swiped away. That file is byte-identical to develop, so this is pre-existing.
🤖 Reviewed with Claude Code
Issue being fixed or feature implemented
Follow-up to #1073. Several dismiss-safe sheets still drew their own grabber/close chrome or relied on bare system sheets, so the wallet did not consistently use the shared
DashUIKit.BottomSheetcomponent.This is intentionally stacked on
refactor/dashuikit-bottom-sheet-foundation. Protected signing, proving, and broadcast flows remain deferred until DashUIKit exposes dynamic dismissal control.What was done?
DashUIKit.BottomSheet.DashUIKit.BottomSheet.selfSizing.How Has This Been Tested?
xcodebuild -list -workspace DashWallet.xcworkspacedashpayDebug build for iPhone 17 Pro / iOS 26.5 Simulator at exact headbb34895b65769d5849b97aea56adb39dcf3c6982org.dashfoundation.dash)git diff --checkThe separate
dashwalletscheme retains unrelated baseline target-membership failures forTxDetailContactAvatarandTxDetailContactRow; this PR does not touch those files or target entries.Before / after screenshots
Exact-revision provenance, SHA-256 hashes, and full-resolution originals: visual evidence tree
Balance info
ab5661897)bb34895b6)CSV export
ab5661897)bb34895b6)Extended public key
ab5661897)bb34895b6)ZenLedger
ab5661897)bb34895b6)Transfer timing
ab5661897)bb34895b6)Transfer endpoint picker
ab5661897)bb34895b6)Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
This pull request was created by Codex.
Summary by CodeRabbit
Style
Bug Fixes