Skip to content

fix(ui): add Coinbase transfer amount screen and converter UI components#785

Open
romchornyi wants to merge 13 commits into
masterfrom
fix/coinbase-receive-summary
Open

fix(ui): add Coinbase transfer amount screen and converter UI components#785
romchornyi wants to merge 13 commits into
masterfrom
fix/coinbase-receive-summary

Conversation

@romchornyi

@romchornyi romchornyi commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

Addresses the issue where there is no summary "You will receive.." for Coinbase operations. This feature adds a dedicated transfer amount screen for Coinbase with proper amount input, validation, and receive summary display. Additionally, integrates new converter card component from DashUIKit for better exchange rate visualization across the app.

What was done?

Coinbase Transfer Amount Screen

  • TransferAmountView & ViewModel: New SwiftUI screen for custom Coinbase transfer amount input with validation
  • TransferAmountHostingController: UIKit integration layer for seamless navigation
  • Storyboard Updates: Wired new hosting controller into Coinbase flow
  • Legacy Removal: Removed deprecated UIKit TransferAmountViewController
  • State Management: Improved lifecycle handling and state persistence

Services & Models

  • Consolidated swap provider models into protocol-based architecture
  • Improved SwapDepositURIBuilder for deposit address generation
  • Enhanced SwapBackend for provider dispatching
  • Refined error handling across swap operations

How Has This Been Tested?

  • Tested Coinbase transfer amount flow with amount validation, error handling, and "You will receive.." summary display
  • Verified ConverterCard component rendering across different exchange rates and screen sizes
  • Tested Coinbase storyboard navigation and SwiftUI hosting controller lifecycle transitions
  • Confirmed state persistence during navigation and amount input field handling
  • Built and ran on iPhone 17 simulator with no compilation errors

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

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • New Features
    • Introduced a refreshed Coinbase transfer experience with amount entry, currency selection, receive estimates, network status, validation, payment, and two-factor authentication flows.
    • Added clearer transfer success, failure, limit, and remaining-balance messaging.
  • UI Improvements
    • Updated conversion cards, layout spacing, colors, and separators across Coinbase and Maya screens.
  • Bug Fixes
    • Corrected DASH currency conversions.
    • Prevented duplicate Coinbase sign-in completion handling.

- Add TransferAmountView and ViewModel for Coinbase transfer input
- Add TransferAmountHostingController for UIKit integration
- Update IntegrationViewController+Coinbase with new screen routing
- Support custom transfer amounts for Coinbase operations
- Update Coinbase.storyboard with transfer amount screen integration
- Remove old TransferAmountViewController references
- Add new hosting controller wiring for SwiftUI TransferAmountView
…ut control

- Enhance FrameReader with improved geometry calculations
- Improve ScaleToFitWidth for responsive text scaling
- Support better layout adaptability across screen sizes
- Enhance MayaAmountView with better amount formatting
- Improve LocalCurrencyView for better currency selection UX
- Support new converter card integration
- Update project.pbxproj with new Coinbase transfer amount files
- Remove old TransferAmountViewController references
- Add new converter card and receive estimate components
- Update asset references for arrow and diagonal icons
- Remove legacy UIKit TransferAmountViewController
- Replaced by new SwiftUI TransferAmountView with TransferAmountHostingController
- Complete migration to modern SwiftUI-based approach
- Update MayaConvertView to use new DashUIKit ConverterCard
- Improve exchange rate display with new component
- Better layout for amount input and conversion preview
…e management

- Enhance TransferAmountHostingController with better lifecycle handling
- Improve TransferAmountViewModel for state persistence and validation
- Better error handling and user feedback during transfer
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@romchornyi, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4e3783ee-fdae-4ba7-ba7d-65eb7714d114

📥 Commits

Reviewing files that changed from the base of the PR and between dd8049b and 546dd1c.

📒 Files selected for processing (2)
  • DashWallet.xcodeproj/project.pbxproj
  • DashWallet/Sources/UI/Maya/Convert/MayaConvertView.swift
📝 Walkthrough

Walkthrough

The Coinbase transfer flow now uses SwiftUI with a dedicated view model and UIKit hosting controller. Coinbase storyboard modules and project wiring were updated, DashUIKit components replaced duplicated UI helpers, and currency conversion and authentication continuation handling were corrected.

Changes

Coinbase Transfer Amount SwiftUI Migration

Layer / File(s) Summary
Storyboard bindings and layout
DashWallet/Sources/UI/Coinbase/Base.lproj/Coinbase.storyboard
Updates Coinbase storyboard module bindings, layout metrics, Interface Builder metadata, and theme resources.
Transfer amount state and transaction handling
DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountViewModel.swift
Adds transfer state, input sanitization, balance calculations, validation, leftover-balance checks, 2FA routing, and transaction callbacks.
SwiftUI transfer screen
DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountView.swift
Adds amount entry, converter, receive estimate, network states, currency selection, keyboard handling, and previews.
Hosting controller and payment presentation
DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountHostingController.swift
Embeds the SwiftUI view and coordinates payment, 2FA, transaction status, limit errors, and leftover warnings.
Project and entry-point wiring
DashWallet/Sources/UI/Coinbase/CoinbaseEntryPoint/IntegrationViewController+Coinbase.swift, DashWallet.xcodeproj/project.pbxproj
Routes transfers to the hosting controller and registers the new transfer files in the project.

DashUIKit Adoption and Helper Relocation

Layer / File(s) Summary
Maya conversion card refactor
DashWallet/Sources/UI/Maya/Convert/MayaConvertView.swift
Replaces custom conversion-card rows and geometry tracking with DashUIKit components.
DashUIKit helper API relocation
DashWallet/Sources/UI/SwiftUI Components/Geometry Readers/FrameReader.swift, DashWallet/Sources/UI/SwiftUI Components/Geometry Readers/ScaleToFitWidth.swift
Removes duplicated view extensions and updates the FrameReader preview.
DashUIKit project integration
DashWallet.xcodeproj/project.pbxproj
Links DashUIKit and synchronizes Geometry Readers and ScrollViews groups for both targets.

Conversion, Authentication, and Gift Card Updates

Layer / File(s) Summary
Currency conversion and authentication correctness
DashWallet/Sources/Infrastructure/Currency Exchanger/CurrencyExchanger.swift, DashWallet/Sources/Models/Coinbase/Auth/CBAuth.swift
Corrects DASH conversion direction and ensures Coinbase sign-in continuations resume once.
Gift card project references
DashWallet.xcodeproj/project.pbxproj
Updates GiftCardProvider and AddRedeemUrlChallengeToGiftCardsTable project entries.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant TransferAmountView
  participant TransferAmountViewModel
  participant TransferAmountHostingController
  participant PaymentController

  User->>TransferAmountView: Enter amount and select transfer
  TransferAmountView->>TransferAmountViewModel: transfer()
  TransferAmountViewModel->>TransferAmountHostingController: onInitiatePayment
  TransferAmountHostingController->>PaymentController: Start payment
  PaymentController-->>TransferAmountHostingController: Payment result
  TransferAmountHostingController-->>TransferAmountView: Show transfer status
Loading

Possibly related PRs

Suggested reviewers: hashengineering

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding the Coinbase transfer amount screen and its converter UI components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/coinbase-receive-summary

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@DashWallet/Sources/UI/Coinbase/Transfer` Amount/TransferAmountView.swift:
- Around line 35-37: The NavigationBar call in TransferAmountView uses a
trailing comma after the leading closure argument, which breaks compilation on
the Swift 5.0 toolchain. Update the DashUIKit.NavigationBar invocation to remove
that trailing comma while keeping the existing leading: {
NavigationBarElement.back.button { onBack?() } } argument intact.

In `@DashWallet/Sources/UI/Maya/Convert/Components/MayaAmountView.swift`:
- Line 19: The new DashUIKit import in MayaAmountView should be reordered to
match the project’s sorted_imports rule. Move the DashUIKit import into the
correct alphabetical/configured import group alongside the existing imports, and
run SwiftFormat/SwiftLint to ensure the file matches the expected import
ordering.

In `@DashWallet/Sources/UI/Maya/Convert/MayaConvertView.swift`:
- Line 19: The new DashUIKit import is out of the configured sort order and is
triggering sorted_imports. Update the import block in MayaConvertView so
DashUIKit is placed according to the project’s import ordering rules, and re-run
SwiftFormat/SwiftLint to verify the imports are sorted correctly.
🪄 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: 4bb1098f-7013-4b7b-9027-dc6234ae74bb

📥 Commits

Reviewing files that changed from the base of the PR and between a461373 and fff30eb.

📒 Files selected for processing (12)
  • DashWallet.xcodeproj/project.pbxproj
  • DashWallet/Sources/UI/Coinbase/Base.lproj/Coinbase.storyboard
  • DashWallet/Sources/UI/Coinbase/CoinbaseEntryPoint/IntegrationViewController+Coinbase.swift
  • DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountHostingController.swift
  • DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountView.swift
  • DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountViewController.swift
  • DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountViewModel.swift
  • DashWallet/Sources/UI/Maya/Convert/Components/MayaAmountView.swift
  • DashWallet/Sources/UI/Maya/Convert/MayaConvertView.swift
  • DashWallet/Sources/UI/Menu/Settings/LocalCurrency/LocalCurrencyView.swift
  • DashWallet/Sources/UI/SwiftUI Components/Geometry Readers/FrameReader.swift
  • DashWallet/Sources/UI/SwiftUI Components/Geometry Readers/ScaleToFitWidth.swift
💤 Files with no reviewable changes (1)
  • DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountViewController.swift

Comment thread DashWallet/Sources/UI/Maya/Convert/Components/MayaAmountView.swift Outdated
Comment thread DashWallet/Sources/UI/Maya/Convert/MayaConvertView.swift
- Enhance TransferAmountView with better amount formatting and validation
- Improve MayaAmountView for better exchange rate display
- Update MayaConvertView layout with ConverterCard improvements
- Better visual consistency across amount input screens
@romchornyi

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
✅ 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.

…nfig

- Improve TransferAmountViewModel with better amount validation
- Update project.pbxproj for build configuration consistency
- Better error handling and user feedback
@romchornyi

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
✅ 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.

jeanpierreroma and others added 3 commits July 13, 2026 13:46
Resolve conflicts against master (post #780 About Dash redesign + DashUIKit):
- Keep our Coinbase Transfer Amount screen files (auto-merged)
- FrameReader.swift / ScaleToFitWidth.swift: keep ours — this branch still
  needs the local FrameReader/LocationReader structs (DashUIKit's are
  internal); only the View extensions were removed to avoid clashing with
  DashUIKit's public readingFrame/scaleToFitWidth
- Restore LocationReader.swift and ScrollViewWithOnScrollChanged.swift that
  master deleted but this branch still uses
- project.pbxproj: take master's structure (DashUIKit remote, 14 DashSpend
  files, groups); drop our duplicate/explicit geometry entries; re-add
  "Geometry Readers" and "ScrollViews" synchronized groups to the dashwallet
  and dashpay targets so the restored files compile via file-system sync

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
DashWallet/Sources/Infrastructure/Currency Exchanger/CurrencyExchanger.swift (1)

192-197: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Bypass conversion when source and target currencies are identical.

If amountCurrency and currency are the same (e.g., converting DASH to DASH), the method currently proceeds to convertDash, which attempts to fetch the exchange rate. If the rate provider does not explicitly store a 1:1 rate for the currency, this will unexpectedly throw a ratesNotAvailable error.

Adding an early return prevents this exception and eliminates unnecessary computations.

💡 Proposed fix
     public func convert(to currency: String, amount: Decimal, amountCurrency: String) throws -> Decimal {
         if amount.isZero { return 0 }
+        if currency == amountCurrency { return amount }
 
         if amountCurrency == kDashCurrency {
             return try convertDash(amount: amount, to: currency)
         }
🤖 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 `@DashWallet/Sources/Infrastructure/Currency` Exchanger/CurrencyExchanger.swift
around lines 192 - 197, Update convert(to:amount:amountCurrency:) to return the
input amount immediately when amountCurrency equals currency, before the
convertDash path or other rate lookups. Preserve the existing zero-amount
behavior and all conversion logic for differing currencies.
DashWallet.xcodeproj/project.pbxproj (1)

3597-3597: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Missing PBXBuildFile definition for DashUIKit in dashpay target.

The dashpay target's PBXFrameworksBuildPhase references the build file ID 51760D812FF7C2CF00E70F0B, but this identifier is missing from the PBXBuildFile section. This will cause project parsing issues or linker errors for dashpay.

Please add the missing PBXBuildFile definition to the PBXBuildFile section.

🛠 Proposed fix (add to PBXBuildFile section)
 /* Begin PBXBuildFile section */
 ...
+		51760D812FF7C2CF00E70F0B /* DashUIKit in Frameworks */ = {isa = PBXBuildFile; productRef = 5149DA072FF3DA5200207AE5 /* DashUIKit */; };
🤖 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 `@DashWallet.xcodeproj/project.pbxproj` at line 3597, Add the missing
PBXBuildFile entry for identifier 51760D812FF7C2CF00E70F0B in the PBXBuildFile
section, referencing the existing DashUIKit file and preserving the dashpay
target’s PBXFrameworksBuildPhase reference.
🤖 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 `@DashWallet.xcodeproj/project.pbxproj`:
- Line 3597: Add the missing PBXBuildFile entry for identifier
51760D812FF7C2CF00E70F0B in the PBXBuildFile section, referencing the existing
DashUIKit file and preserving the dashpay target’s PBXFrameworksBuildPhase
reference.

In `@DashWallet/Sources/Infrastructure/Currency`
Exchanger/CurrencyExchanger.swift:
- Around line 192-197: Update convert(to:amount:amountCurrency:) to return the
input amount immediately when amountCurrency equals currency, before the
convertDash path or other rate lookups. Preserve the existing zero-amount
behavior and all conversion logic for differing currencies.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: adfa32d1-0388-49e9-80be-3e419b316cd1

📥 Commits

Reviewing files that changed from the base of the PR and between fff30eb and dd8049b.

📒 Files selected for processing (6)
  • DashWallet.xcodeproj/project.pbxproj
  • DashWallet/Sources/Infrastructure/Currency Exchanger/CurrencyExchanger.swift
  • DashWallet/Sources/Models/Coinbase/Auth/CBAuth.swift
  • DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountView.swift
  • DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountViewModel.swift
  • DashWallet/Sources/UI/Maya/Convert/MayaConvertView.swift
🚧 Files skipped from review as they are similar to previous changes (3)
  • DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountView.swift
  • DashWallet/Sources/UI/Maya/Convert/MayaConvertView.swift
  • DashWallet/Sources/UI/Coinbase/Transfer Amount/TransferAmountViewModel.swift

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