Refactor and unify the send & multisig-propose flow#541
Open
n13 wants to merge 5 commits into
Open
Conversation
Scanning an address left the send and multisig-propose recipient buttons stuck on "Enter address". Scan assigned the controller text inside setState, firing the change listener's nested setState mid-update, so validation never enabled the button. Route scan, paste, and recent through a shared _setRecipient helper that assigns the controller text outside setState (the same path paste already used), letting the listener drive validation. Also removes the duplicated assignment across the three input methods in both screens.
align with design, delete duplicated screens from msig
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch started as a one-line fix for the scan→continue button bug, but the scope grew into a full refactor of the send experience. The regular send and multisig propose flows were near 1:1 duplicated screens; they are now unified behind a single set of screens driven by a
SendStrategy, and several related fixes/features came along with it.Net ~−800 lines (four duplicated multisig screens deleted), no new localization keys, and the regular send flow is visually unchanged from the original Figma design.
1. Unified send & multisig-propose flows (Strategy pattern)
The two flows (recipient → amount → review → done) were copy-pasted. They now share one implementation, with a
SendStrategyencapsulating everything that differs between them:send_strategy.dart—SendStrategy+ value types:SendStrings(per-flow labels),SendFee(RegularFee/ProposeFee),SendOutcome(Submitted/NeedsHardwareSignature/Failed),SendTerminalContent.regular_send_strategy.dart— single-signer transfer from the active account (local signing, or Keystone hand-off).multisig_propose_strategy.dart— multisig proposal (member affordability gating, propose-fee breakdown, proposal submission + provider invalidation).select_recipient_screen.dart,input_amount_screen.dart,review_send_screen.dart, and a unifiedsend_terminal_screen.dart(renamed fromtx_submitted_screen.dart).propose_recipient_screen.dart,propose_amount_screen.dart,propose_review_screen.dart,propose_done_screen.dart.home_screen.dart,shared_address_action_sheet.dart.Keystone signing seam: hardware signing is modeled as an orthogonal step via
SendOutcome.NeedsHardwareSignature, threaded throughkeystone_sign_screen.dart/keystone_scan_signature_screen.dart. This leaves room for multisig + Keystone later without adding another branch.2. "View in Explorer" on the terminal screen
transaction_submission_service.dartnow returns the extrinsic hash (it was already computed, just discarded); added anexplorerImmediateTransactionUrl()helper.ExplorerLinkwidget and reused it across the terminal, the POS receipt (pos_qr_screen.dart), and the transaction/proposal detail sheets — removing three near-duplicate copies.3. Self-send handling on the recipient screen
Entering or scanning your own address previously left the button silently disabled on "Enter address". Now it:
Works for both flows (
strategy.sourceAccountIdresolves to the active account for sends, the multisig address for proposals).4. Debug QR scanner button
kDebugMode-only button to the sharedQrScannerPagethat returns a test address, so the send / swap / add-account flows can be exercised in the simulator where the camera is unavailable.AppConstants.debugTestAddress, reused by the existing hardware-account debug fill.5. Original fix (scan → continue button)
Scan and paste took different code paths; scan assigned the controller text inside
setState, so the validation listener never enabled the button. Unified scan/paste/recent through a single_setRecipienthelper (the path paste already used). This screen was subsequently folded into the refactor above.Test plan