Skip to content

refactor(ui): standardize dismiss-safe sheets on DashUIKit - #1074

Merged
romchornyi merged 2 commits into
developfrom
refactor/dashuikit-sheet-content
Aug 28, 2026
Merged

romchornyi merged 2 commits into
developfrom
refactor/dashuikit-sheet-content

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

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.BottomSheet component.

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?

  • Wrapped CSV export, ZenLedger, extended public key, balance info, transfer timing, and the internal-transfer endpoint picker in DashUIKit.BottomSheet.
  • Wrapped DashPay enable confirmation/success and contested-username confirmation sheets.
  • Moved DashSpend purchase confirmation onto DashUIKit.BottomSheet.selfSizing.
  • Removed duplicate grabbers, close controls, titles, backgrounds, and system drag indicators now owned by DashUIKit.
  • Preserved native activity/share sheets and existing detents, callbacks, and acknowledgement semantics.

How Has This Been Tested?

  • xcodebuild -list -workspace DashWallet.xcworkspace
  • Full dashpay Debug build for iPhone 17 Pro / iOS 26.5 Simulator at exact head bb34895b65769d5849b97aea56adb39dcf3c6982
  • Installed, launched, and verified the process remained alive (org.dashfoundation.dash)
  • Runtime navigation through CSV export, extended public key, ZenLedger, balance info, transfer timing, and endpoint-picker flows
  • git diff --check
  • Code simplification and independent four-pass review gates: approved with no findings

The separate dashwallet scheme retains unrelated baseline target-membership failures for TxDetailContactAvatar and TxDetailContactRow; 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

Before (ab5661897) After (bb34895b6)
Before balance info After balance info

CSV export

Before (ab5661897) After (bb34895b6)
Before CSV export After CSV export

Extended public key

Before (ab5661897) After (bb34895b6)
Before extended public key After extended public key

ZenLedger

Before (ab5661897) After (bb34895b6)
Before ZenLedger After ZenLedger

Transfer timing

Before (ab5661897) After (bb34895b6)
Before transfer timing After transfer timing

Transfer endpoint picker

Before (ab5661897) After (bb34895b6)
Before endpoint picker After endpoint picker

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests (UI composition only; validated by exact-revision simulator runs)
  • I have made corresponding changes to the documentation (exact-revision visual evidence)

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

This pull request was created by Codex.

Summary by CodeRabbit

  • Style

    • Standardized bottom sheets across contacts, payments, DashSpend, home, and tools screens.
    • Hidden drag indicators and removed redundant grabbers, close buttons, and in-content titles.
    • Improved sheet titles, spacing, sizing, and corner-radius presentation.
  • Bug Fixes

    • Improved sheet behavior and appearance across supported iOS versions.
    • Preserved existing export, transfer, confirmation, and navigation actions.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e34f6bef-f157-4b63-89bd-7dd2db6988b7

📥 Commits

Reviewing files that changed from the base of the PR and between ab56618 and bb34895.

📒 Files selected for processing (12)
  • DashWallet/Sources/UI/DashPay/Contacts/SwiftUI/ContactsScreen.swift
  • DashWallet/Sources/UI/DashPay/Setup/CreateUsername/CreateUsernameViewController.swift
  • DashWallet/Sources/UI/Explore Dash/Views/DashSpend/DashSpendConfirmationDialog.swift
  • DashWallet/Sources/UI/Explore Dash/Views/DashSpend/DashSpendPayScreen.swift
  • DashWallet/Sources/UI/Home/Views/HomeView.swift
  • DashWallet/Sources/UI/Menu/Tools/CSVExportSheet.swift
  • DashWallet/Sources/UI/Menu/Tools/ExtendedKeys/ExtendedPublicKeySheet.swift
  • DashWallet/Sources/UI/Menu/Tools/ToolsMenuScreen.swift
  • DashWallet/Sources/UI/Menu/Tools/ZenLedger/ZenLedgerInfoSheet.swift
  • DashWallet/Sources/UI/Payments/InternalTransfer/InternalTransferScreen.swift
  • DashWallet/Sources/UI/Payments/InternalTransfer/TransferTimingSheet.swift
  • DashWallet/Sources/UI/Payments/Landing/PaymentsLandingHostingController.swift
💤 Files with no reviewable changes (3)
  • DashWallet/Sources/UI/Menu/Tools/ExtendedKeys/ExtendedPublicKeySheet.swift
  • DashWallet/Sources/UI/Menu/Tools/ZenLedger/ZenLedgerInfoSheet.swift
  • DashWallet/Sources/UI/Menu/Tools/CSVExportSheet.swift

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR standardizes sheet presentation across DashPay, DashSpend, tools, balance information, and payment flows by using DashUIKit.BottomSheet, centralizing titles and sizing, hiding drag indicators, and removing embedded sheet header controls.

Changes

Bottom sheet migration

Layer / File(s) Summary
DashPay and balance sheet wrappers
DashWallet/Sources/UI/DashPay/Contacts/SwiftUI/ContactsScreen.swift, DashWallet/Sources/UI/DashPay/Setup/CreateUsername/CreateUsernameViewController.swift, DashWallet/Sources/UI/Home/Views/HomeView.swift
DashPay, contested-name, and balance-information sheets now use BottomSheet wrappers. Presentation settings and sheet titles move to the wrapper.
DashSpend self-sizing sheets
DashWallet/Sources/UI/Explore Dash/Views/DashSpend/DashSpendConfirmationDialog.swift, DashWallet/Sources/UI/Explore Dash/Views/DashSpend/DashSpendPayScreen.swift
Confirmation sheets now use BottomSheet.selfSizing instead of platform-conditional presentation modifiers.
Tools sheet wiring and content cleanup
DashWallet/Sources/UI/Menu/Tools/CSVExportSheet.swift, DashWallet/Sources/UI/Menu/Tools/ExtendedKeys/ExtendedPublicKeySheet.swift, DashWallet/Sources/UI/Menu/Tools/ZenLedger/ZenLedgerInfoSheet.swift, DashWallet/Sources/UI/Menu/Tools/ToolsMenuScreen.swift
Embedded grabbers, close buttons, color-scheme dependencies, and secondary backgrounds are removed. Sheet content is wrapped through centralized BottomSheet properties.
Payment sheet wrappers and titles
DashWallet/Sources/UI/Payments/InternalTransfer/InternalTransferScreen.swift, DashWallet/Sources/UI/Payments/InternalTransfer/TransferTimingSheet.swift, DashWallet/Sources/UI/Payments/Landing/PaymentsLandingHostingController.swift
Payment sheets now use BottomSheet wrappers with centralized titles, adjusted spacing, and hidden drag indicators.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to bb348

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: llbartekll, romchornyi, jeanpierreroma

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 9 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: standardizing dismiss-safe wallet sheets on the shared DashUIKit.BottomSheet component.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/dashuikit-sheet-content

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.

@PastaPastaPasta
PastaPastaPasta force-pushed the refactor/dashuikit-sheet-content branch from b5273c4 to bb34895 Compare August 27, 2026 00:11
@PastaPastaPasta

Copy link
Copy Markdown
Member Author

@coderabbitai review\n\n---\n🤖 Posted autonomously by Codex on behalf of pasta.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

@PastaPastaPasta I will review pull request #1074.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@romchornyi romchornyi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 romchornyi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All three findings from my earlier review are addressed in b8cf2aa96, which I pushed to this branch:

  • Contested-name sheet — BottomSheet(fillsHeight: true) applies edgesIgnoringSafeArea(.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 to DashSpendConfirmationDialog.sheetFallbackHeight (582) so both presenters read one value.
  • TransferTimingSheet — the same 82pt came out of a fixed .medium() detent with fixedSize text, so the CTA could clip. The text now scrolls; "I got it" is the only thing that writes shieldedBalanceTimingShownKey, 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

Base automatically changed from refactor/dashuikit-bottom-sheet-foundation to develop August 28, 2026 13:25
@romchornyi
romchornyi merged commit 465f453 into develop Aug 28, 2026
2 checks passed
@romchornyi
romchornyi deleted the refactor/dashuikit-sheet-content branch August 28, 2026 13:26
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