Skip to content

Conversation

@piotr-iohk
Copy link
Collaborator

Description

In preparation for the send e2e suite, this PR aligns iOS behavior with Bitkit RN/Android:

  • Manual-entry invoice validation: the Continue button is gated on a successful decode, invalid addresses keep the button disabled.
  • The Send review screen: tapping the displayed invoice/address (ReviewUri) opens the manual-entry editor, tapping the amount (ReviewAmount) returns to the amount screen with the previously entered sats.

Linked Issues/Tasks

Screenshot / Video

Case Before After
Enter manual address
Simulator.Screen.Recording.-.iPhone.17.-.2025-12-12.at.11.32.55.mov
Simulator.Screen.Recording.-.iPhone.17.-.2025-12-12.at.11.41.47.mov
Edit invoice and amount
Simulator.Screen.Recording.-.iPhone.17.-.2025-12-12.at.11.33.52.mov
Simulator.Screen.Recording.-.iPhone.17.-.2025-12-12.at.12.19.02.mov

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns iOS send flow behavior with Bitkit's React Native/Android implementation by adding manual-entry invoice validation and enabling interactive editing from the review screen. The Continue button on manual entry is now gated on successful invoice decode, and users can tap the displayed invoice/address or amount on the review screen to edit them.

Key Changes:

  • Manual-entry validation: Continue button is disabled until the entered address/invoice successfully decodes
  • Review screen interactivity: Tapping the invoice/address opens the manual-entry editor, tapping the amount returns to the amount screen
  • Amount preservation: Previously entered amounts are restored when navigating back to the amount screen

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
AppViewModel.swift Adds manual entry validation state (manualEntryInput, isManualEntryInputValid) and async validation logic with sequence-based debouncing
SendEnterManuallyView.swift Implements validation-based Continue button gating using custom binding that triggers async validation on text changes
SendConfirmationView.swift Makes invoice/address and amount displays tappable, adds navigation logic to return to manual entry or amount screens
SendAmountView.swift Restores previously entered amount from wallet.sendAmountSats when navigating back to amount screen
MoneyStack.swift Adds optional onTap callback parameter to support custom tap behavior instead of default currency toggle
SendOptionsView.swift Resets manual entry input state when navigating to manual entry screen

@piotr-iohk piotr-iohk marked this pull request as ready for review December 12, 2025 12:51
Copy link
Member

@jvsena42 jvsena42 left a comment

Choose a reason for hiding this comment

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

Tested with valid and invalid parameters:

  • Set Bip 21 manually
  • Set bolt 11 manually
  • Edit amount navigation

@piotr-iohk piotr-iohk merged commit 1aa1d33 into master Dec 15, 2025
7 of 8 checks passed
@piotr-iohk piotr-iohk deleted the fix/send-manual-entry branch December 15, 2025 12:21
BitcoinErrorLog pushed a commit to BitcoinErrorLog/bitkit-ios that referenced this pull request Dec 15, 2025
Comment on lines +603 to +611
if let amountIndex = navigationPath.lastIndex(of: .amount) {
navigationPath = Array(navigationPath.prefix(amountIndex + 1))
} else {
if let confirmIndex = navigationPath.lastIndex(of: .confirm) {
navigationPath = Array(navigationPath.prefix(confirmIndex))
}
navigationPath.append(.amount)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

When paying a Lightning invoice with a fixed amount, it shouldn't be possible to change the amount.

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.

4 participants