Skip to content

feat: spark transfer to spending design - #1357

Merged
ovitrif merged 20 commits into
masterfrom
feat/spark-transfer-to-spending-design
Nov 24, 2026
Merged

ovitrif merged 20 commits into
masterfrom
feat/spark-transfer-to-spending-design

Conversation

@ovitrif

@ovitrif ovitrif commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Refs: #1270
Twin: synonymdev/bitkit-android#1963

Description

  • Updates the transfer to spending confirm screen to the v64 frame: a grid of network fees, service fees, to spending and total, then Fast and Normal rows with their fee marked "max" and "est"; tapping the fees switches every amount between bitcoin and the local currency, and stays in bitcoin while Bitkit has no rate for that currency.
  • Rewrites Learn More to explain the transfer speeds (Fast, Later) and the spending balance: Spark, its operators and what that means for security.
  • Updates the hardware wallet sign screen to the same fee grid and speed rows, with the deposit address to confirm on the device and no Learn More button.
  • Moves the available amount and its actions under the amount on both amount screens, as in the frames.
  • Reorders the funding options to Transfer from Savings, Transfer from HW wallet, Use other wallet, Manual setup, with the frames' labels; Learn More there stays only while Spark is unavailable.
  • Updates the spending intro's title and copy, and the no-funds dialog button, to the frames.
  • Keeps the Spending screen's "Transfer From Savings" button in title case, as in its frame, on a key of its own.
  • Shows the fee rows as loading only while the quote loads, and hides a speed row's fee when the quote failed instead of showing it as zero.
  • Draws the Transfer and Spending intros at the frames' 16 pt side inset, and places the signed check 32 pt under the fee grid, as in the frames.
  • Matches the hardware wallet sign screen to its frame: 32 pt under the title, 10 pt between the fee rows and above the speed rows, the angled Trezor partly behind the button, and the deposit address truncated at the end.
  • Keeps the amount screens in step with the fee grid's unit switch: going back shows the same amount in the new unit, and an amount typed in an unchanged unit stays as typed.
  • Translates the new and changed strings into every shipped locale and drops the removed keys. It also fixes wrong existing values in these flows: missing first lines in German, a German string in Dutch, the transfer direction in Spanish, swapped lines in French and Russian, a Polish typo, and Catalan fee wording that differed from the rest of the file.

Out of Scope

Design

Figma page "Bitkit - Progress v64" in the Bitkit Wallet file:

Preview

Figma App

The app with Normal selected, and with the fees switched to dollars:

Normal 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

  • Manual setup, local balance, review, custom fee, channel opening: unchanged in v64; this PR only moves "Manual setup" to the end of the funding list

QA Notes

Setup

  • Debug build (regtest), launched with SPARK_CHAIN_SERVICE_URL set 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

  • J1: updated spark-transfer-to-spending.xml — fee grid, Fast and Normal, currency toggle, Learn More, funding options (passed on b1a0f24, see Evidence)
  • J2: updated transfer-to-spending.xml (hardware wallet) — sign screen shows the address and the Fast and Normal rows
    • Ran on db9980d with the Trezor emulator: pairing, the sign screen, signing and the funded transfer pass; steps 13 and 26 expect hardware rows in the home list that the app shows elsewhere, as on master (see Gaps), so it stays open
    • Open QA gap: not run with a physical Trezor
  • J3: updated transfer-banner-opens-progress.xml, spark-transfer-status.xml, transfer-unavailable-sheet.xml, external-amount-over-max.xml — new labels only
    • Ran on fcc6522; the label checks and the deposit claim pass, but some steps are blocked by their environment (see Gaps), so it stays open

Manual Tests

  • 1. Transfer from a paired Trezor → Review & Sign shows the deposit address under "Address (confirm on device)" and the Fast and Normal rows (passed on db9980d with the Trezor emulator)
    • Open QA gap: not run with a physical Trezor
  • 2. On the amount screen switch to dollars, tap 25%, continue, tap the fees once (they switch to bitcoin), go back → the amount shows in bitcoin, and a keypad digit edits it (passed on fcc6522, recording in Preview)
  • 3. In Dutch, open Transfer to Spending → amount → confirm and Learn More → every label is translated, with no English left — the journeys run in English

Automated Checks

  • ran swiftformat --lint, node scripts/validate-translations.js, NumberPadTests (pass, with the new testRefreshDisplayFollowsUnitSwitchedElsewhere and testRefreshDisplayKeepsTypedTextInSameUnit)

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

  • J3 deposit claim: launched without 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

  • J2 and case 1: not run with a physical Trezor. J2 steps 13 and 26 expect the hardware received row and the new Transfer row in the home list; the app lists the received row on the hardware wallet screen and the new row reads "From Savings", unchanged from master.
  • J3 spark-transfer-status.xml and transfer-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).
  • J3 transfer-unavailable-sheet.xml actions 6-11: need Spark not running, and this build had Spark connected.
  • J3 external-amount-over-max.xml actions 10-11: the over-max toast did not show. This PR does not touch that screen (FundManualAmountView.swift).

Models used

  • Planning/scoping: Claude Opus 5.5 (reasoning: medium)
  • Implementation: Claude Opus 5.5 (reasoning: medium), Claude Sonnet 5.5 (reasoning: high)
  • Review: Claude Sonnet 5.5 (reasoning: high)

@ovitrif ovitrif added this to the 3.2.0 milestone Nov 17, 2026
@ovitrif ovitrif self-assigned this Nov 17, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T19:31:30.035926Z b1a0f24 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ovitrif
ovitrif requested review from a team, ben-kaufman and pwltr and removed request for a team November 17, 2026 19:29
@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[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.

Findings

  1. P2 Full address is hidden ▶
  2. P2 Missing fees look free ▶

Summary

Updates the transfer-to-spending screens with:

  • Transfer reviews show fees, speed choices, and the hardware deposit address.
  • Amount screens put the available balance and quick actions below the entered amount.
  • Funding choices use the new order and labels when Spark is ready.
  • Learn More explains transfer timing and who operates Spark.
  • The Spending screen keeps its Transfer From Savings button in title case.

Two non-blocking display issues remain: the hardware address is cut off, and failed quotes show zero fees.

Explicit deferrals from ovitrif: translations are assigned to the stacked translation PR; the fee grid’s missing accessibility action is out of scope; “Later” in Learn More versus “Normal” in the picker is intentional.

Reviews (1) · Last reviewed commit: "feat: spark transfer to spending design" · Reviewed by Greptile

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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 talosmachina 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.

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.prefix removed under another caller: the other callers (FundManualConfirmView, SavingsConfirmView, the preview) never passed prefix.
  • Funding buttons enabled while Spark is unavailable: transferFromSavingsButton and useOtherWalletButton now carry isDisabled: !canFundWithSpark in both branches, and RectangleButton guards the action on isDisabled, 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: TransferLearnMoreView no longer reads SparkTransferFlow or CurrencyViewModel, so dropping them from the preview and the screen is consistent.
  • Missing image assets: clock and check-mark exist in Assets.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 ben-kaufman 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.

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

ovitrif added a commit that referenced this pull request Nov 18, 2026
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
@ovitrif

ovitrif commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

db9980d matches three screens to the v64 frames:

  • Learn More's "Fast" and "Later" headings are white and bold.
  • The hardware wallet sign screen draws the frame's angled Trezor, with its lower part behind the button.
  • The deposit address on that screen is truncated at the end, as the frame shows it. This replaces the middle truncation from the earlier address threads; the device still shows the full address to confirm.

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
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
@ovitrif
ovitrif force-pushed the feat/spark-transfer-to-spending-design branch from 39dee51 to 0b9709d Compare November 19, 2026 02:45

@pwltr pwltr 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.

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)
@ovitrif

ovitrif commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

@pwltr Fixed in f9d8b4d, as you suggested: AmountInputViewModel now remembers the unit its keypad text was written in.

  • Coming back from Review or Review & Sign while that unit still shows, the typed text stays as typed, so a rate refresh that drops the currency no longer clears it to 0.00.
  • After the fee grid switched the unit, the screen shows the kept satoshi amount instead of reading the old digits in the new unit, so fiat digits are never parsed as classic bitcoin.
  • testReturnRedrawsOnlyAfterTheTextsUnitChanged covers the rule, next to the existing refreshDisplay tests.

@ovitrif
ovitrif requested a review from pwltr November 19, 2026 14:28

@pwltr pwltr 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.

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)
@ovitrif

ovitrif commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

@pwltr Fixed the read-only amounts in d63da25, centrally rather than per screen: CurrencyViewModel.convert(sats:) now returns nil for a zero or unreadable price, as for a missing ticker, and a primary MoneyText shows Bitcoin while fiat has no usable rate. That covers each spot even after a later refresh:

  • Review and Review & Sign fees and total
  • the Fast transfer fee prompt in SettingUpView, whose primaryAmountText already falls back to Bitcoin without a conversion
  • the signed summary

testPrimaryAmountsStayInBitcoinWithoutAUsableRate covers it.

out of scope: tracked in #1376, because the amount screens (AmountInputViewModel) can't take or show fiat at all without a usable rate, the same on master, and falling back there means reworking entry for every amount screen, which is your flow-wide suggestion. It's in this PR's Out of Scope.

@ovitrif
ovitrif requested a review from pwltr November 19, 2026 14:55

@pwltr pwltr 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.

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
@ovitrif

ovitrif commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

@pwltr thanks, all three fixed in ea73632:

Medium: Classic BTC can show a satoshi count under the Bitcoin symbol.

Bitcoin formatting no longer needs a rate: ConvertedAmount.bitcoinDisplay(sats:unit:) formats sats in the chosen unit, and every fallback uses it (primaryAmountText, MoneyText, coin selection's amounts and totals). A 5,000-sat fee now reads ₿ 0.00005000 in classic. CurrencyTests.testPrimaryAmountText_FallsBackToBitcoinWithoutARate covers it.

Low: With Fiat selected and no usable rate, both lines of a paired balance show the same Bitcoin amount.

The secondary line now takes the unit opposite the primary one as shown, so it reads fiat when the primary falls back to bitcoin (MoneyText.secondaryUnit, tested in SparkTransferFlowTests.testPrimaryAmountsStayInBitcoinWithoutAUsableRate).

Low: … visible Bitcoin amounts can have a screen-reader label made of hidden-balance dots.

Without a usable rate the label now reads the amount shown; the dots remain only for a hidden balance.

@ovitrif
ovitrif requested a review from pwltr November 19, 2026 16:12
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 pwltr 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.

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
@ovitrif

ovitrif commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

@pwltr thanks, all five fixed:

Medium: A rejected keypad digit can change the transfer amount after returning from Review or Review & Sign.

351ee00: a refused key now changes nothing, so the kept sats stay exact. NumberPadTests.testARejectedFiatKeyKeepsTheExactSats runs your 100,001-sat case at $100,000/BTC.

Medium: The send, receive, LNURL and BTC payment request editors … lose the exact Bitcoin equivalent when the rate drops.

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.

Low: A paired balance shows a zero fiat equivalent below the correct Bitcoin balance when there is no usable rate.

cfa27b0: a fiat amount without a usable rate now reads —, in the text and its label.

Low: A zero or unreadable ticker now suppresses Bitcoin values that are already available.

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.

Pre-existing Medium: Switching units directly on the amount screen can copy Arabic-Indic digits into keypad state.

351ee00: the unit switch now keeps ASCII digits in the raw input too.

@ovitrif
ovitrif requested a review from pwltr November 19, 2026 17:14
…-to-spending-design

# Conflicts:
#	Bitkit/Views/Transfer/FundingOptions.swift

@pwltr pwltr 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.

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
@ovitrif

ovitrif commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

@pwltr both points are fixed in 91c489e.

Medium: Delete can leave a positive transfer amount in a fiat field that shows zero.

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. testDeleteClearsAPresetFiatAmountWithNoRate covers it: Max in fiat with no rate, then Delete, leaves 0 sats.

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.

The toast and the one-time hint now go by the unit the balance shows (MoneyText.primaryUnit). Without a rate, a tap that leaves the balance in Bitcoin shows no toast and keeps the hint.

@ovitrif
ovitrif requested a review from pwltr November 19, 2026 21:51

@pwltr pwltr 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.

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

@ovitrif

ovitrif commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

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.

@ovitrif

ovitrif commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

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.

@ovitrif

ovitrif commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Merging this PR: @pwltr approved the current head, CI and e2e are green and every thread is resolved.

@ovitrif
ovitrif merged commit 28beacf into master Nov 24, 2026
41 of 52 checks passed
@ovitrif
ovitrif deleted the feat/spark-transfer-to-spending-design branch November 24, 2026 09:14
@ovitrif ovitrif mentioned this pull request Nov 24, 2026
1 task
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