Repository navigation
feat: spark transfer to spending design - #1357
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The changes affect the Spark spending-funding and hardware-transfer flows. The PR appears safe to merge, with two non-blocking display fixes recommended. FindingsSummaryUpdates the transfer-to-spending screens with:
Two non-blocking display issues remain: the hardware address is cut off, and failed quotes show zero fees. Explicit deferrals from Reviews (1) · Last reviewed commit: "feat: spark transfer to spending design" · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1a0f246c1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
talosmachina
left a comment
There was a problem hiding this comment.
1 finding (1 P2). Brings the transfer to spending confirm, Learn More, hardware sign and funding screens to the new frames: a tappable fee grid that switches the unit, Fast/Normal rows marked max/est, and the deposit address on the hardware sign screen. Reviewed a91c431, static review: following this repo's Bitkit rules I did not build or run the iOS branch here, so this rests on reading the code and on CI.
What I checked, and 5 candidates I ruled out
Read: the full Swift diff (SpendingConfirm.swift, SpendingHwSign.swift, SpendingHwSigned.swift, FundingOptions.swift, TransferLearnMoreView.swift, SpendingAmount*.swift, FeeDisplayRow.swift, SpendingWalletScreen.swift, TransferIntroView.swift), the en strings diff and the journey edits.
Strings: node scripts/validate-translations.js passes (0 errors); the keys the PR removes (spending_fee, spark_learn__text, spark_learn__label) have no remaining reference in Swift, journeys or docs; every new key the Swift reads exists in en.
CI at review time: SwiftFormat, validate, detect-changes green; Run Tests, Run Integration Tests and build-local still pending.
Ruled out
FeeDisplayRow.prefixremoved under another caller: the other callers (FundManualConfirmView,SavingsConfirmView, the preview) never passedprefix.- Funding buttons enabled while Spark is unavailable:
transferFromSavingsButtonanduseOtherWalletButtonnow carryisDisabled: !canFundWithSparkin both branches, andRectangleButtonguards the action onisDisabled, so the reordered disabled branch keeps the old behaviour. - Fee tap toggling the display while paying: the toggle is
currency.togglePrimaryDisplay()only, a display setting, so it cannot touch the quote or the swipe. - Learn More losing its environment:
TransferLearnMoreViewno longer readsSparkTransferFloworCurrencyViewModel, so dropping them from the preview and the screen is consistent. - Missing image assets:
clockandcheck-markexist inAssets.xcassets/icons.
The cold reader from another model family timed out on the finding, so it is posted on my own check of the code.
Merge confidence: 4/5, the finding is a P2 and the unit and integration runs had not finished at review time.
Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the run metadata available to this reviewer does not report an effort setting)
ben-kaufman
left a comment
There was a problem hiding this comment.
The fee currency toggle can leave the amount screen showing the old number in the new unit when navigating back.
Reviewer model: gpt-6.1-sol
Reasoning effort: xhigh
Translates the strings #1357 adds or changes into every shipped locale and fixes wrong existing values in its flows (German first lines, German in Dutch, transfer direction in Spanish, line order in French and Russian, a Polish typo). Verified: node scripts/validate-translations.js; every new key present in all 15 locales
|
db9980d matches three screens to the v64 frames:
New stills and recordings follow in the description. |
Implement the v64 frames for transfer to spending from savings and from a hardware wallet: fee grid with service fees, Fast and Normal rows with max and est captions, fees toggle currency on tap, Learn More on speeds and the spending balance, the deposit address on the hardware sign screen, available row under the amount, and the funding options order and labels. Verified: swiftformat lint, validate-translations, Debug simulator build, transfer to spending journey on an iOS 27 simulator against staging regtest
Verified: none (changelog text only)
Draw the Transfer and Spending intros at the frames' 16 pt inset, pin the signed check 32 pt under the fee grid, and hide a speed row's fee when the quote failed instead of showing it as zero. Verified: swiftformat lint, Debug simulator build
Verified: swiftformat lint
Verified: swiftformat lint
Returning to the amount screen redraws the amount only when the unit changed elsewhere, so typed text such as 0.00010 stays as typed. Verified: NumberPadTests on an iPhone 17 Pro simulator (pass); swiftformat --lint
Translates the strings #1357 adds or changes into every shipped locale and fixes wrong existing values in its flows (German first lines, German in Dutch, transfer direction in Spanish, line order in French and Russian, a Polish typo). Verified: node scripts/validate-translations.js; every new key present in all 15 locales
Learn More's Fast and Later headings are white. The hardware wallet sign screen shows the angled Trezor from the frame, its lower part behind the button, and truncates the deposit address at the end. Verified: swiftformat --lint
Verified: swiftformat --lint
The Review & Sign frame draws 32 under the title, 10 between the fee grid's rows and 10 above the speed rows; the screen used the Review frame's 24 for all three. Verified: swiftformat --lint
39dee51 to
0b9709d
Compare
pwltr
left a comment
There was a problem hiding this comment.
Reviewed 0b9709d.
The fee-grid tap switches to fiat even when Bitkit has no exchange rate for the selected currency.
Medium: Tapping the fee grid in Bitcoin mode with a valid quote and no fiat rate makes the fees, amount to Spending, and total show zero. The speed fees and hardware signed summary use the same fallback. The Savings swipe and hardware sign button can still authorize the nonzero transfer. See SpendingConfirm.swift:290, SpendingConfirm.swift:368, SpendingHwSign.swift:44, and SpendingHwSigned.swift:19.
Medium: Going back after that tap shows a fiat zero placeholder on both amount screens. Continue still prices the transfer using the original nonzero Bitcoin amount if it fits the available balance. See SpendingAmount.swift:96 and SpendingAmountHw.swift:89.
Review details
Quick review
Model: Claude Opus 5.5
Reasoning effort: high
General review
Model: GPT-6.2 Sol
Reasoning effort: high
Combined review
Model: GPT-6.2 Sol
Reasoning effort: high
Without an exchange rate for the local currency, the fee grid's tap would show every amount on Review and Review & Sign as zero, and the amount screens' fiat placeholder after going back. The tap now switches to fiat only when a rate exists. Verified: swiftformat --lint, SparkTransferFlowTests and TransferNavigationTests on a simulator (45 passed)
Returning from Review or Review & Sign read the kept keypad text again in the current unit and rate: a rate refresh dropping the currency cleared typed fiat to 0.00, and fiat digits read as classic bitcoin after the fee grid switched could overflow. The amount input now remembers the unit its text was written in, keeps the text while that unit still shows, and draws the kept sats after a switch. Verified: swiftformat --lint, NumberPadTests, SparkTransferFlowTests, TransferNavigationTests and CurrencyTests on a simulator (98 passed)
|
@pwltr Fixed in f9d8b4d, as you suggested:
|
pwltr
left a comment
There was a problem hiding this comment.
It may be worth reworking the currency display for the whole transfer-to-Spending flow so the amount stays visible from entry through approval.
Reviewed f9d8b4d. The fee grid checks the selected exchange rate when tapped, but a later successful refresh can remove that rate or replace it with one that parses as zero while the transfer stays in fiat mode. Please use the Bitcoin amount as a fallback whenever the selected rate is unusable, including after a refresh.
Medium: After switching to fiat on Review or Review & Sign, a missing or zero rate can make the fees and total show zero while the swipe or sign button still uses the nonzero quote. The hardware device still shows the amount it is asked to sign. See Bitkit/Views/Transfer/SpendingConfirm.swift:290 and Bitkit/Views/Transfer/Hardware/SpendingHwSign.swift:44.
Medium: If the user entered a Bitcoin amount, switched to fiat on review and then went back after the rate became unusable, the amount field can show its zero placeholder or a formatted zero while Continue still prices the retained amount. This affects Bitkit/Views/Transfer/SpendingAmount.swift:96 and Bitkit/Views/Transfer/Hardware/SpendingAmountHw.swift:89.
Medium: If the ticker is still present but its price parses as zero, the later Fast-transfer approval can show a zero fee while Approve accepts the provider's nonzero fee. See Bitkit/Views/Transfer/SettingUpView.swift:98.
Low: If the rate becomes unusable while the device is awaiting approval, the signed summary can briefly show a zero total after a nonzero transfer broadcasts. See Bitkit/Views/Transfer/Hardware/SpendingHwSigned.swift:19.
Review details
Quick review
Model: Claude Opus 5.5
Reasoning effort: high
General review
Model: GPT-6.2 Sol
Reasoning effort: high
Combined review
Model: GPT-6.2 Sol
Reasoning effort: high
A rate refresh that drops the selected currency, or returns its price as zero, left Review, Review & Sign, the Fast transfer fee prompt and the signed summary showing zero fiat amounts beside a nonzero transfer. A zero or unreadable price now counts as no rate, and primary amounts show in bitcoin while fiat has no usable rate. Verified: swiftformat --lint, CurrencyTests, FeeItemAmountTests, FiatFormattingTests, LightningAmountConversionTests, NumberPadTests, PaykitAmountEntryConversionTests, PaykitAmountTests, SparkTransferFlowTests and TransferNavigationTests on a simulator (127 passed)
|
@pwltr Fixed the read-only amounts in d63da25, centrally rather than per screen:
out of scope: tracked in #1376, because the amount screens ( |
pwltr
left a comment
There was a problem hiding this comment.
Reviewed d63da25. A missing or unusable exchange rate now leaves several Bitcoin display paths without the converted value they use to format and label the underlying satoshis.
Medium: Classic BTC can show a satoshi count under the Bitcoin symbol. A 5,000-sat fee can read ₿ 5 000 instead of ₿ 0.00005000 on transfer review. The same formatting affects the Fast fee approval, Spark Exit partial-funding instructions, and coin selection amounts and totals. Apply the configured Bitcoin denomination directly to the satoshi amount when fiat conversion is unavailable. See Bitkit/Components/MoneyText.swift:219, Bitkit/ViewModels/CurrencyViewModel.swift:195, and Bitkit/Views/Wallets/Send/SendUtxoSelectionView.swift:116 and Bitkit/Views/Wallets/Send/SendUtxoSelectionView.swift:172.
Low: With Fiat selected and no usable rate, both lines of a paired balance show the same Bitcoin amount. See Bitkit/Components/MoneyText.swift:49 and Bitkit/Components/MoneyStack.swift:76.
Low: When a ticker is present but its price is zero or unreadable, visible Bitcoin amounts can have a screen-reader label made of hidden-balance dots. This includes activity amounts and fees, even in modern Bitcoin mode. See Bitkit/Components/MoneyText.swift:237 and Bitkit/Views/Wallets/Activity/ActivityItemView.swift:400 and Bitkit/Views/Wallets/Activity/ActivityItemView.swift:421.
Review details
Quick review
Model: Claude Opus 5.5
Reasoning effort: high
General review
Model: GPT-6.2 Sol
Reasoning effort: high
Combined review
Model: GPT-6.2 Sol
Reasoning effort: high
Bitcoin amounts that fell back for a missing or unusable rate read as a sat count, even in classic units, and paired balances and screen-reader labels lost their values. They now use the chosen bitcoin unit without a rate, the paired line takes the other unit, and the label reads the shown amount. Verified: m1a CurrencyTests, SparkTransferFlowTests, NumberPadTests (92 passed); swiftformat --lint
|
@pwltr thanks, all three fixed in ea73632:
Bitcoin formatting no longer needs a rate:
The secondary line now takes the unit opposite the primary one as shown, so it reads fiat when the primary falls back to bitcoin (
Without a usable rate the label now reads the amount shown; the dots remain only for a hidden balance. |
An amount redrawn after a unit switch took the display's digits into the number pad's raw input; with a numbering system like Arabic-Indic the next key parsed it as 0 sats. The raw input now keeps ASCII digits, as the twin does. Verified: m1a NumberPadTests, SparkTransferFlowTests, CurrencyTests (93 passed); swiftformat --lint
pwltr
left a comment
There was a problem hiding this comment.
Reviewed e6ada73.
Medium: A rejected keypad digit can change the transfer amount after returning from Review or Review & Sign. The shared redraw keeps the exact sats but writes rounded fiat into the keypad. At $100,000/BTC, enter 100,001 sats, switch the fee grid to fiat, then go back and press another digit. The two-decimal limit leaves 100.00 on screen, but the handler reparses it and Continue quotes 100,000 sats. Skip conversion when the keypad text is unchanged. See Bitkit/ViewModels/AmountInputViewModel.swift:103, Bitkit/Views/Transfer/SpendingAmount.swift:96, and Bitkit/Views/Transfer/Hardware/SpendingAmountHw.swift:89.
MoneyText now picks the secondary unit from the effective primary unit, which falls back to Bitcoin when the fiat rate is unusable.
Medium: The send, receive, LNURL and BTC payment request editors keep their editable fiat amount but lose the exact Bitcoin equivalent when the rate drops. Their conversion line shows zero fiat while the editor still holds the original sats. Give that line an explicit Bitcoin unit in Bitkit/Components/NumberPadTextField.swift:55.
Low: A paired balance shows a zero fiat equivalent below the correct Bitcoin balance when there is no usable rate. Show that conversion as unavailable in Bitkit/Components/MoneyText.swift:61 and Bitkit/Components/MoneyStack.swift:76.
Low: A zero or unreadable ticker now suppresses Bitcoin values that are already available. Both wallet transfer indicators omit the known amount, and the fee weather widget leaves its sats and next-block metrics stale or in an error state even after fetching current fees. Publish the Bitcoin values independently of fiat conversion in Bitkit/Components/IncomingTransfer.swift:27 and Bitkit/ViewModels/Widgets/WeatherViewModel.swift:127.
Pre-existing Medium: Switching units directly on the amount screen can copy Arabic-Indic digits into keypad state. The next edit can reset the amount to zero. The normalization used for the return redraw also applies to this path in Bitkit/ViewModels/AmountInputViewModel.swift:189.
Review details
Quick review
Model: Claude Opus 5.5
Reasoning effort: high
General review
Model: GPT-6.2 Sol
Reasoning effort: high
Combined review
Model: GPT-6.2 Sol
Reasoning effort: high
A refused key, such as a third fiat decimal after returning from review, read the unchanged text again and rounded the kept sats to it: 100 001 sats became 100 000. A refused key now changes nothing. Switching units on the amount screen also keeps ASCII digits in the raw input. Verified: m1a NumberPadTests, SparkTransferFlowTests, CurrencyTests, FeeItemAmountTests, FiatFormattingTests, LightningAmountConversionTests, PaykitAmountEntryConversionTests, PaykitAmountTests, TransferNavigationTests (129 passed); swiftformat --lint
Treating a zero price as no rate in every conversion dropped bitcoin values that need no rate: the transfer indicators lost their amount and the fee widget its figures. Conversion is as on master again; the usable-rate check reads the price, primary amounts show no fiat without it, a paired fiat line reads unavailable, and the editors' conversion line shows the other unit of the amount being edited. Verified: m1a NumberPadTests, SparkTransferFlowTests, CurrencyTests, FeeItemAmountTests, FiatFormattingTests, LightningAmountConversionTests, PaykitAmountEntryConversionTests, PaykitAmountTests, TransferNavigationTests (129 passed); swiftformat --lint
|
@pwltr thanks, all five fixed:
351ee00: a refused key now changes nothing, so the kept sats stay exact.
cfa27b0: the conversion line under an editor now shows the other unit of the amount being edited, so it reads bitcoin while fiat is edited.
cfa27b0: a fiat amount without a usable rate now reads
cfa27b0: conversion is back to master's, so a zero price no longer drops the converted amount and its bitcoin values. The zero-price handling stays where amounts are shown: the usable-rate check reads the price, and primary amounts show bitcoin without it. The transfer indicators and the fee widget get their bitcoin values again.
351ee00: the unit switch now keeps ASCII digits in the raw input too. |
…-to-spending-design # Conflicts: # Bitkit/Views/Transfer/FundingOptions.swift
pwltr
left a comment
There was a problem hiding this comment.
Reviewed 5d91276.
Medium: Delete can leave a positive transfer amount in a fiat field that shows zero. With fiat selected and no exchange rate, tap Max and then Delete on either transfer amount screen. The preset stores the sats, but the fiat field has no text to delete. The new unchanged-text guard treats Delete as a no-op, so Continue still quotes the original amount. The base cleared the amount in this case. Keep the guard for rejected digits and let Delete clear a retained amount when the field is empty. See Bitkit/ViewModels/AmountInputViewModel.swift:76, Bitkit/Views/Transfer/SpendingAmount.swift:165, and Bitkit/Views/Transfer/Hardware/SpendingAmountHw.swift:193.
Low: With no usable exchange rate, tapping the home balance from Bitcoin mode can announce a switch to fiat and consume the one-time hint while the balance still displays Bitcoin. Use the effective displayed unit for the switch feedback. See Bitkit/Components/MoneyStack.swift:137 and Bitkit/Components/MoneyText.swift:56.
Review details
Quick review
Model: Claude Opus 5.5
Reasoning effort: high
General review
Model: GPT-6.2 Sol
Reasoning effort: high
Combined review
Model: GPT-6.2 Sol
Reasoning effort: high
Delete on an empty fiat field now clears an amount a preset kept without text, and the unit toast shows only when the shown unit changes. Verified: NumberPadTests, SendSheetLifecycleTests on iOS simulator
|
@pwltr both points are fixed in 91c489e.
Delete now applies even when the text is unchanged, so on an empty fiat field it clears the amount a preset kept. Rejected digits still return early.
The toast and the one-time hint now go by the unit the balance shows ( |
pwltr
left a comment
There was a problem hiding this comment.
Reviewed 91c489e. Delete clears the retained transfer amount when the fiat field is empty, and tapping the balance without a usable rate preserves the one-time unit-switch hint. No remaining findings in scope.
Review details
Quick review
Model: Claude Opus 5.5
Reasoning effort: high
General review
Model: GPT-6.2 Sol
Reasoning effort: high
Combined review
Model: GPT-6.2 Sol
Reasoning effort: high
|
Cancelled and restarted the e2e run (https://github.com/synonymdev/bitkit-ios/actions/runs/44622890552): its job sat on the self-hosted runner for two hours without reporting a step, where a normal run takes about an hour. The earlier attempt failed because the runner lost contact with GitHub, not on a test. |
|
Force-cancelled the e2e run again (https://github.com/synonymdev/bitkit-ios/actions/runs/44622890552): the job sat on the self-hosted runner for 110 minutes without reporting a step. No e2e job on that runner has completed since 14:03 UTC on 20 Nov; each one since hung the same way, so this looks like the runner rather than this PR. I'll rerun it once the runner is back. |
|
Merging this PR: @pwltr approved the current head, CI and e2e are green and every thread is resolved. |
Refs: #1270
Twin: synonymdev/bitkit-android#1963
Description
Out of Scope
AmountInputViewModel, amount screens: entering or keeping a fiat amount while the selected rate is unusable shows zero, as on master — bug: amount entry shows zero when the fiat rate is unusable #1376, raised in feat: spark transfer to spending design #1357 (review).SpendingConfirm.swift: the fee grid toggles the currency on tap but exposes no accessibility action, soui-automation tapby its id does not reach it; a touch on a fee does.TransferLearnMoreView.swift: the heading reads "Later" while the speed row reads "Normal", as in the frames.Design
Figma page "Bitkit - Progress v64" in the Bitkit Wallet file:
Preview
The app with Normal selected, and with the fees switched to dollars:
J1 at 2x: amount, confirm, Normal, currency toggle, Learn More, Spending screen, funding options:
j1.mp4
Case 2 at 2x: amount in dollars, fees switched to bitcoin on the confirm screen, back shows the amount in bitcoin and the keypad edits it:
a-unit-back2x.mp4
Figma notes
Every note above the v64 frames for these flows, with what this PR does about it.
Changelog v64
Transfer to Spending Balance From Savings (Spark)
Transfer to Spending Balance From HW Device (spark)
Funds In Transfer (spark)
Lightning Onboarding From Suggestion Card
Savings, Spending, Hardware, USDT Balances
Transaction Transfer Details
Manual Lightning Setup
QA Notes
Setup
SPARK_CHAIN_SERVICE_URLset to the staging regtest Esplora (https://bitkit.stag0.blocktank.to/electrs), a fresh wallet with confirmed Savings (500 000 sats used) and no channels.Journeys
spark-transfer-to-spending.xml— fee grid, Fast and Normal, currency toggle, Learn More, funding options (passed on b1a0f24, see Evidence)transfer-to-spending.xml(hardware wallet) — sign screen shows the address and the Fast and Normal rowstransfer-banner-opens-progress.xml,spark-transfer-status.xml,transfer-unavailable-sheet.xml,external-amount-over-max.xml— new labels onlyManual Tests
Automated Checks
swiftformat --lint,node scripts/validate-translations.js,NumberPadTests(pass, with the newtestRefreshDisplayFollowsUnitSwitchedElsewhereandtestRefreshDisplayKeepsTypedTextInSameUnit)Evidence
J1 on db9980d on an iPhone 17 Pro simulator (iOS 27.0) against staging regtest, 125 000 sats: Fast shows service fees ₿ 745 (max), Normal ₿ 99 (est); to spending ₿ 124 255 then ₿ 124 901; network ₿ 458 and total ₿ 125 458 stay; the fees switch to dollars and back. Recording in Preview.
J3 on fcc6522, same simulator and backend:
spark-transfer-status.xml: a Fast transfer of 100 000 sats shows "Funds in transfer" with step 1, then "Fast Transfer Unavailable" with "Using Normal Transfer Speed".transfer-banner-opens-progress.xml: a Normal transfer, Continue Using Bitkit, the home banner opens the status screen at its step, and still does after a relaunch.transfer-unavailable-sheet.xml: the sheet, Learn More and Continue to Manual Setup (actions 1-5).external-amount-over-max.xml: the external amount screen, the cap and delete (actions 1-9, 12, 13).J2 and case 1 on db9980d with the bitkit-docker Trezor emulator over Bridge (
TREZOR_BRIDGE=true,Docs/AI_DEVICE_TESTS.md), 25% of a 32 649-sat hardware balance: the sign screen shows network fees ₿ 459, service fees ₿ 511, to spending ₿ 7 742, total ₿ 8 712, the address truncated at the end, the angled Trezor behind the button, Fast ₿ 511 (max) and Normal ₿ 99 (est); four approvals on the emulator sign it, Transaction Signed shows the same fees, and Funds In Transfer follows.j2.mp4
SPARK_CHAIN_SERVICE_URL, a 200 000-sat deposit from Lightspark's regtest faucet is claimed and Spending reads ₿ 199 901 (claim fee ₿ 99).Gaps
spark-transfer-status.xmlandtransfer-banner-opens-progress.xml: "Transfer Successful" not reached. Spark claims only deposits on Lightspark's regtest chain, while Savings lives on the staging regtest chain, so a transfer from Savings never claims on regtest; the claim itself was checked with a faucet deposit (see Evidence).transfer-unavailable-sheet.xmlactions 6-11: need Spark not running, and this build had Spark connected.external-amount-over-max.xmlactions 10-11: the over-max toast did not show. This PR does not touch that screen (FundManualAmountView.swift).Models used
Claude Opus 5.5(reasoning:medium)Claude Opus 5.5(reasoning:medium),Claude Sonnet 5.5(reasoning:high)Claude Sonnet 5.5(reasoning:high)