Skip to content

refactor(ui): consolidate bottom sheets on DashUIKit - #1073

Open
PastaPastaPasta wants to merge 4 commits into
developfrom
refactor/dashuikit-bottom-sheet-foundation
Open

refactor(ui): consolidate bottom sheets on DashUIKit#1073
PastaPastaPasta wants to merge 4 commits into
developfrom
refactor/dashuikit-bottom-sheet-foundation

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Aug 26, 2026

Copy link
Copy Markdown
Member

This pull request was created by Codex.

Issue being fixed or feature implemented

Dash Wallet has been carrying a local copy of DashUIKit's bottom-sheet and self-sizing implementations. That duplicate has drifted from the package implementation.

What was done?

  • Migrated all remaining callers of the wallet-level BottomSheet to the explicitly qualified DashUIKit.BottomSheet component.
  • Preserved each migrated caller's existing detents, back-navigation behavior, and natural/full-height presentation mode.
  • Kept marketplace name detail, set-price, and transfer as native detented sheets. These views already provide complete sheet layouts; wrapping them in DashUIKit.BottomSheet duplicated navigation chrome and reduced usable content space.
  • Removed the duplicate wallet-level BottomSheet.swift and SelfSizingSheet.swift sources and their target memberships.
  • Removed obsolete preference-based height publishing now that DashUIKit measures self-sizing content directly.

The package implementation now provides the shared grabber token, Dash font styling, window-aware self-sizing cap, direct geometry measurement, and hidden system drag indicator from one source of truth.

How Has This Been Tested?

  • Built the dashpay scheme successfully from exact head ab566189742eb386516e9fc4c2d9e940d577a749 with Xcode on an iPhone 17 Pro simulator running iOS 26.5.
  • Installed, launched, verified PID liveness, unlocked the preserved wallet fixture, and exercised standard, full-height, transaction, and marketplace sheet states.
  • Compared exact base be25f358d9f606103d4da956c1310d756d436070 and full head using separate worktrees, separate DerivedData, and two clones of the same shut-down simulator fixture.
  • Ran project parsing, git diff --check, simplification review, and the independent code-review quality gate with no findings.
  • The dashwallet scheme was also attempted during the initial migration; it currently stops on the pre-existing mainnet target-membership errors for TxDetailContactAvatar and TxDetailContactRow in TxDetailCells.swift, unrelated to this diff.

Full-resolution evidence, exact revision/device provenance, dimensions, and SHA-256 hashes: f75a40a1af51c7608ff2d0550517ff47f8d44f3e

Transaction filter

Before — exact base After — full head
Before transaction filter After transaction filter

Transaction detail

Before — exact base After — full head
Before transaction detail After transaction detail

Breaking Changes

None. This consolidates the duplicated bottom-sheet implementation onto the currently pinned DashUIKit API while preserving purpose-built native sheets.

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
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@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: ad155bb1-9dc8-4b19-9e03-e79e2cf2bdce

📥 Commits

Reviewing files that changed from the base of the PR and between 9dc3dcd and da64754.

📒 Files selected for processing (20)
  • DashWallet.xcodeproj/project.pbxproj
  • DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountView.swift
  • DashWallet/Sources/UI/CrowdNode/BalanceReminder/CrowdNodeBalanceReminderSheet.swift
  • DashWallet/Sources/UI/DashPay/Setup/CreateUsername/JoinDashPayInfoDialog.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Info/MerchantTypesDialog.swift
  • DashWallet/Sources/UI/Explore Dash/UsernameMarketplaceScreen.swift
  • DashWallet/Sources/UI/Explore Dash/Views/DashSpend/DashSpendConfirmationDialog.swift
  • DashWallet/Sources/UI/Explore Dash/Views/DashSpend/DashSpendLoginInfoView.swift
  • DashWallet/Sources/UI/Home/HomeViewController+Shortcuts.swift
  • DashWallet/Sources/UI/Home/Views/HomeView.swift
  • DashWallet/Sources/UI/Home/Views/Shortcuts/ShortcutSelectionView.swift
  • DashWallet/Sources/UI/Home/Views/Shortcuts/WalletSwitchDialog.swift
  • DashWallet/Sources/UI/Home/Views/TransactionFilterDialog.swift
  • DashWallet/Sources/UI/Swap/Buy/EnterAmount/BuyEnterAmountView.swift
  • DashWallet/Sources/UI/Swap/Convert/SwapConvertView.swift
  • DashWallet/Sources/UI/Swap/OrderPreview/Components/OrderPreviewFeeRow.swift
  • DashWallet/Sources/UI/Swap/OrderPreview/Components/SwapFeeInfoSheet.swift
  • DashWallet/Sources/UI/SwiftUI Components/BottomSheet.swift
  • DashWallet/Sources/UI/SwiftUI Components/SelfSizingSheet.swift
  • DashWallet/Sources/UI/Tx/Details/TxDetailViewController.swift
💤 Files with no reviewable changes (3)
  • DashWallet/Sources/UI/SwiftUI Components/BottomSheet.swift
  • DashWallet/Sources/UI/SwiftUI Components/SelfSizingSheet.swift
  • DashWallet.xcodeproj/project.pbxproj

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


📝 Walkthrough

Walkthrough

Removed the local BottomSheet and SelfSizingSheet implementations. Updated wallet sheets to use DashUIKit.BottomSheet and simplified DashSpend self-sizing measurement.

Changes

BottomSheet migration

Layer / File(s) Summary
Remove local sheet sources
DashWallet.xcodeproj/project.pbxproj, DashWallet/Sources/UI/SwiftUI Components/BottomSheet.swift, DashWallet/Sources/UI/SwiftUI Components/SelfSizingSheet.swift
Removes the local sheet implementations and their Xcode project entries.
Migrate sheet references
DashWallet/Sources/UI/Coinbase/..., DashWallet/Sources/UI/DashPay/..., DashWallet/Sources/UI/Explore Dash/..., DashWallet/Sources/UI/Home/..., DashWallet/Sources/UI/Swap/..., DashWallet/Sources/UI/Tx/...
Updates sheet construction to use DashUIKit.BottomSheet, with required imports and preserved presentation settings.
Simplify self-sizing measurement
DashWallet/Sources/UI/Explore Dash/Views/DashSpend/DashSpendConfirmationDialog.swift, DashWallet/Sources/UI/CrowdNode/BalanceReminder/CrowdNodeBalanceReminderSheet.swift
Removes height-preference publication and updates the related preview comment.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to da647

This PR consolidates bottom-sheet behavior onto the shared DashUIKit implementation while preserving existing presentation and navigation behavior; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: jeanpierreroma, quantumexplorer

🚥 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 17 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 summarizes the main change: consolidating bottom-sheet implementations on DashUIKit.
  • 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-bottom-sheet-foundation

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

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 the changes in #1073.

⚠️ Action not completed

No files to review.

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.

No correctness bugs found — the migration is mechanically complete and semantically equivalent against the pinned DashUIKit revision (5b373b1), which is what I checked against rather than master.

What I verified:

  • Every BottomSheet( at HEAD is DashUIKit.BottomSheet(; no reference to the deleted BottomSheetHeightPreferenceKey or a local selfSizingSheet survives.
  • All 14 files that now reference DashUIKit.BottomSheet or .selfSizingSheet(...) carry import DashUIKit, and the four newly-added imports introduce no member ambiguity — DashUIKit namespaces its tokens under Font.dash / Color.dash and exports none of TextIntro, FeatureTopText, ButtonsGroup, IconName.
  • pbxproj has no dangling refs to the removed identifiers, and both targets that lost the files link the DashUIKit product.
  • The one real code deletion — dropping the BottomSheetHeightPreferenceKey publication from DashSpendConfirmationDialog — is safe. The production presenter goes through .selfSizingSheet(fallback: 500), which already bound to DashUIKit's implementation before this PR, and that one measures its wrapped content directly via a GeometryReader background instead of reading the preference. The retained .fixedSize(horizontal: false, vertical: true) keeps the measurement decoupled from the offered detent, so there is no detent↔measurement feedback loop.
  • Chrome metrics are unchanged: DashUIKit's NavigationBar is equivalent to the app's (minHeight: 64) and the grabber frame is still 18pt, so the hardcoded 134 + rows * N detent math in TransactionFilterDialog.height / WalletSwitchDialog.height stays correct. .dashFont(.calloutMedium) adds only ~1pt of vertical metrics over .font(.calloutMedium), absorbed by the 64pt bar.

Three things worth acting on, all inline except the first:

The branch pin. Package.resolved isn't touched by this PR, so I can't comment inline. DashUIKit is pinned by branch (requirement = { branch = master }) with resolved revision 5b373b1. After this PR every bottom sheet in the app depends on that moving branch — and master has already diverged from the pin in ways that change sheet behaviour: BottomSheet now unconditionally applies .interactiveDismissDisabled(!isDismissalEnabled), and selfSizingSheet applies .presentationBackground(background) even when cornerRadius is nil (the pinned revision applies it only alongside a corner radius). Anyone who resolves packages to latest gets different rendering and different dismissal semantics on ~15 screens, with nothing in the PR to signal it. Worth bumping the pin deliberately here, or moving to a tag.


🤖 Reviewed with Claude Code

var body: some View {
let showsTxDetailRoute = txDetailRoute != nil
let dialog = BottomSheet(
let dialog = 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.

Flagging here as representative of all ~15 migrated sheets: the grabber changes colour app-wide.

The deleted local BottomSheet drew it with Color.dash.gray300Alpha50#B0B5BD at 50% alpha, with no dark-mode variant. DashUIKit.BottomSheet uses Color.dash.grabberFill#B0B6BC at 100% alpha in light mode, white at 30% in dark.

So in light mode the grabber becomes twice as opaque on every bottom sheet in the app, and dark mode gains a variant it didn't have. This looks intentional (it aligns everything with DashSpendConfirmationDialog, which already used grabberFill), but the PR body says "Breaking Changes: None" and "preserved each migrated caller's existing … behavior", and there is no UI CI here — only Validate PR title and CodeRabbit ran. Two sheets are screenshotted; the change lands on all of them. Worth naming in the description and confirming with design.

.ignoresSafeArea()
.sheet(isPresented: $isPresented) {
// let sheet = BottomSheet(showBackButton: .constant(false)) {
// let sheet = 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.

Nit: this eight-line commented-out block was updated to the new name rather than deleted. Keeping dead code in sync with live code is pure carrying cost — it should go.

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.

2 participants