Skip to content

feat: spark transfer to spending design - #1963

Merged
ovitrif merged 11 commits into
masterfrom
feat/spark-transfer-to-spending-v64
Nov 19, 2026
Merged

ovitrif merged 11 commits into
masterfrom
feat/spark-transfer-to-spending-v64

Conversation

@ovitrif

@ovitrif ovitrif commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Twin: synonymdev/bitkit-ios#1357
Refs: #1840

Description

  • Updates the transfer to spending Review 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.
  • 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 (one line, cut at its end) and no Learn More button, with the frame's angled Trezor running behind the sign button; the signed check sits 32 dp under the grid.
  • Moves the available amount and its actions under the amount on both amount screens, with the number pad pinned to the bottom; on short screens the pad rows shrink before that gap does.
  • Keeps the amount in step with a currency unit switched on another screen.
  • 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 lightning onboarding and spending intros' titles 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.
  • Hides the speed rows' fees while no quote is available.
  • Translates the new and changed strings into every shipped locale and drops the removed keys from each.

Out of Scope

  • TransferLearnMoreScreen.kt: the heading reads "Later" while the speed row reads "Normal", as in the frames.
  • Spacing above headlines and the disabled button style follow the app's shared components, not each frame.
  • A fiat amount the app writes into the keypad reads as zero in locales with Arabic-Indic digits; older than this PR: bug: fiat amount reads as zero with arabic-indic digits #1965, from chore: translate spark design strings #1961 (review).
  • With dollars as the primary unit, the amount screen shows the available amount in dollars, a "USD" unit button and a "." key, where the frames show bitcoin, "BITCOIN" and "000"; that is the app-wide unit behaviour, not this screen's.
  • Spark connection, App Status, transfer to savings, force transfer and the update spending balance modal: their own PRs.

Design

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

Preview

Screen Figma App
Lightning onboarding, introduction
Fund Spending Balance
Spending introduction
Amount, empty
Amount, entered
Amount, USD
Review
Learn More
Transfer confirmed
Spending Balance, empty
Hardware wallet, amount
Hardware wallet, Review & Sign
Hardware wallet, signed

Recordings at 2x

J1: transfer to spending J2: transfer status J6: hardware wallet
j1-spark-transfer-to-spending2x.mp4
j2b-spark-transfer-status2x.mp4
j6-hw-db88-2x.mp4
J3: banner opens progress J4: transfer unavailable J5: amount over max
r12x.mp4
r22x.mp4
r32x.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)

  • Processing Payment, Payment successful, Fast Transfer Fee Changed, Fast Transfer Unavailable, Adding to spending balance, Transfer Successful: built earlier; unchanged by this PR

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

  • Dev build (regtest) built with ESPLORA_URL=http://10.0.2.2:3999 (add --no-build-cache if a cached BuildConfig drops it), with python3 scripts/spark-regtest-esplora.py --port 3999 running on the emulator's host.
  • New wallet; Spark funded from Lightspark's regtest faucet at the deposit address on the Spark connection screen (SparkDepositAddress), then moved to Savings with Transfer to Savings.
  • Hardware wallet: the Trezor Bridge emulator, funded on the Electrum regtest (./lsp), since the hardware wallet does not sync over ESPLORA_URL.

Journeys

  • J1: updated spark-transfer-to-spending.xml — fee grid, Fast and Normal, currency toggle and a unit switched elsewhere, Learn More, funding options — passed on the branch before bcaede84d
  • J2: updated spark-transfer-status.xml — Fast and Normal transfers through to the spending balance — passed on the branch before bcaede84d
  • J3: updated transfer-banner-opens-progress.xml — the banner reopens the transfer at its step, also after a relaunch — passed on bcaede84d
  • J4: updated transfer-unavailable-sheet.xml — with Spark down, the funding options and the Manual Setup route — passed on bcaede84d
  • J5: updated external-amount-over-max.xml — the over-max toast and cap, entered from "Add Connection" — passed on bcaede84d
  • J6: updated transfer-to-spending.xml (hardware wallet) — sign screen with the fee grid, deposit address and speed rows, then signing on the Bridge emulator — passed on db88d415f

restore-keeps-tags-and-closed-channels.xml and non-cjit-channel-no-payment-notification.xml only change the "Manual setup" label they name; J4 checks that label.

Automated Checks

  • updated SpendingAmountScreenTest.kt — available row gap, small screens, a unit switched on another screen, the typed amount kept on return
  • updated SpendingFeeGridTest.kt, SpendingSpeedRowsTest.kt — fee grid, speed rows, no fee without a quote
  • added SpendingHwSignedScreenTest.kt — the check 32 dp under the grid, the grid not clickable
  • updated FundingScreenTest.kt — option order and labels

Evidence

On regtest emulators (Android 16, 896×1994 at 320 dpi), dev builds of this branch with the Spark regtest Esplora proxy:

  • J1: Review showed the fee grid with Fast and Normal, the fees switched to dollars and back, a unit switched on the amount screen carried over, and Learn More showed the two blocks.
  • J2: a Fast transfer went Processing Payment → Payment Successful → Fast transfer unavailable → funds moved to spending; a Normal one showed "about 30 minutes".
  • J3: the banner reopened "Funds in transfer" at Processing Payment, and after a relaunch at its later step; the done screen cleared the banner.
  • J4: with Spark failing to start, every entry showed the sheet; Manual setup came first and enabled, the other options disabled.
  • J5: the toast read "currently limited to ₿ 54 210", the field stopped at 9 999 and delete took it to 999.
  • J6: on the Trezor Bridge emulator, the sign screen showed the grid, the deposit address and the speed rows; signing reached "Transaction signed" and the progress screen.
  • J1 was rerun on 57e42119e with the local Spark stack, which its recording and stills show; later commits change only the hardware wallet sign screen.
  • J6 and the hardware wallet stills are from db88d415f.
  • After bcaede84d, returning to the amount screen redraws the amount only when the unit changed (6a90e63), covered by SpendingAmountScreenTest.kt.

Gaps

  • J6's deposit never reaches Spark: the hardware wallet syncs on the Electrum regtest, not Spark's chain, so the transfer stays in progress after the journey.
  • Not reached on device: the No Bitkit Savings dialog, Fast Transfer Fee Changed and Adding to spending balance (Spark's regtest claimed too quickly); they are unchanged by this PR.

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), Claude Opus 5.5 (reasoning: medium)

Verified: just format, compile, test, lint; journeys on a regtest emulator
Verified: none (journey text only; the journey passed on bcaede8 with this setup)
@ovitrif ovitrif added this to the 3.2.0 milestone Nov 17, 2026
@ovitrif ovitrif self-assigned this Nov 17, 2026
Verified: none (changelog only)
@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-17T22:13:37.094824Z c34aec3 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 22:13

@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: c34aec318f

ℹ️ 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".

Comment thread app/src/main/res/values/strings.xml Resolved
@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect the Spark transfer-to-spending flow.

The PR appears safe to merge, with a non-blocking amount-editing issue worth fixing.

Findings

  1. P2 Returning rewrites the entered amount ▶

Summary

Updates the transfer-to-spending screens with a shared fee grid, currency switching, revised speed choices, and new Spark explanations.

  • Transfer reviews show Fast and Normal choices with a clear fee breakdown.
  • Hardware-wallet transfers show the deposit address and fee choices before signing.
  • Transfer amount screens keep the available balance below the amount and the keypad at the bottom.
  • Funding choices and Spark introductions use the labels and order from the new screens.
  • Transfer setup screens place their illustrations and progress steps with updated spacing.

Reviews (1) · Last reviewed commit: "docs: describe how to stop spark for the..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 357f06e (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

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

No findings. Moves the transfer to spending Review, HW sign and signed screens to the v64 fee grid (tap to switch units) with Fast/Normal speed rows, rewrites Learn More for Spark, pins the number pad under a fixed 32 dp Available row, and reorders the funding options. Reviewed 67118fa, full tier, static: per the repo track's rule the Android branch is not built on this box, so this rests on the code and on CI.

What I checked, and 5 candidates I ruled out

Read in full: SpendingAmountScreen.kt, SpendingConfirmScreen.kt, SpendingHwSignScreen.kt, SpendingHwSignedScreen.kt, TransferLearnMoreScreen.kt, FundingScreen.kt, FeeInfo.kt, AmountInputViewModel.kt, the RootNavHost transfer routes in ContentView.kt
Contracts traced: every removed string key (spending_confirm__about, __spending_fee, __later_text, spending_learn_more__text, transfer_intro__text) has no remaining reference in app/src; lightning__spark_trust is still used by SparkDetailScreen. The removed test tags (SpendingConfirmSpendingFee, HardwareTransferSignLearnMore, TransferLearnMoreBalance) appear nowhere in synonymdev/bitkit-e2e-tests; the tags it does use here (SpendingConfirmMore, FundManual) are kept.
CI at review time: build-and-test, build-local, detekt and lint green; compose-ui and the e2e-tests-local shards still pending.

Ruled out

  • Unit re-sync on the amount screen: LaunchedEffect(currencies.primaryDisplay) also runs each time the screen comes back from Review, not only after a switch. It calls setSats with the same sats, so the worst case is reformatted text (e.g. classic 0.0005 shown as 0.00050000), the same thing Quarter, Max and the unit button already do. No amount changes.
  • Double update with the in-screen unit button: switchUnit writes the text after amountInputHandler.switchUnit, and the effect then writes the same text from the same sats. Both are idempotent.
  • AvailableRowLayout on very short screens: when room is smaller than four 40 dp pad rows, gap.coerceAtMost(room - pad.height) can go negative and the Available row would overlap the amount. That only happens below the 640 dp height that SpendingAmountScreenTest pins, so this is a narrow rule-out, not a reachable bug on supported sizes.
  • Content overloads in the hardware package: SpendingHwSignedScreen.Content is now internal next to the file-private Content in SpendingHwSignScreen.kt, both callable with only state. CI's compile resolves them, so there's no ambiguity.
  • Funding options: the Spark branch keeps onHardware.takeIf { canFundOnChain } (the old canFundWithSpark && is implied by the branch), and the non-Spark branch keeps HW disabled. Manual setup is reachable on both branches.

Merge confidence: 4/5. No findings, but compose-ui and e2e were still running and the branch was not built here.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the session does not surface the setting to the reviewer)

Verified: just format, just compile, just test, just lint
Verified: just compile, just lint
Verified: just format, just compile, just test, just lint
@ovitrif

ovitrif commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed dab6978: the hardware sign screen now draws the frame's angled Trezor running behind the sign button, and cuts the deposit address at its end. Fresh screenshots follow.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed f4053fb: the hardware wallet Review & Sign screen now turns off the font's contextual alternates for the deposit address, so an x between two digits no longer renders as × and the address reads exactly as the device shows it.

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code scan at f4053fb: no HIGH or MEDIUM. One LOW (design) is inline.

What I checked:

  • Total debit. The shown total is quote.totalSats = amount + network fee, the on-chain debit. The service fee and To spending both come from quote.claimFeeSats(state.speed), so the grid and the selected row agree.
  • Speed and fee. A speed change requotes, the swipe is off while quoting, and onConfirm re-prices and asks for another swipe on any increase. send() passes approvedMiningFeeSats = quote.networkFeeSats.
  • Unit switch. The resync on Review (SpendingAmountScreen.kt:192-198) goes through setSats, which keeps the sats, so switching units doesn't change the amount, Max included.
  • Hardware signing. The shown address is the HwSendRequest address. Back stays blocked while signing or while a broadcast is unresolved, and a second signAndBroadcast is refused. Removing Learn More also removes a route that disposed the screen mid-flow.
  • States. None dropped: offline, quote error, not covered, below claim fee, No Bitkit Savings, sync view, and the Spark-unavailable Funding branch are all kept.
  • Journeys and tags. The six updated journeys match the head, and the removed tags have no references left.
  • Figma. Review, Review & Sign, Learn More and Fund Spending Balance match in copy, order, the max/est captions, selection and the truncated address. The only delta is the spacing inline.
  • Journey parity with synonymdev/bitkit-ios#1357. The confirm-screen actions now match word for word. Android adds four actions iOS also implements but its journey doesn't check: no FundLearnMore when Spark is usable, "still shows Normal selected", the amount-unit carry-over steps, and the ellipsis and angled Trezor wording in hardware-wallet/transfer-to-spending.xml. Porting those to the iOS files keeps the specs diffable; nothing changes here.

perf: not relevant.

Device gate (partial): f4053fb — not run yet; pending: transfer/spark-transfer-to-spending.xml, transfer/spark-transfer-status.xml, transfer/transfer-banner-opens-progress.xml, transfer/transfer-unavailable-sheet.xml and hardware-wallet/transfer-to-spending.xml (Trezor emulator) on the Spark regtest stack, with the Figma screens on the device. Device results and the final review type follow in a second review.

Fee grid 32 below the title, 10 between rows and 10 above the speed rows, as the Review & Sign frame draws it.

Verified: just format, compile, test, lint
@ovitrif
ovitrif requested a review from jvsena42 November 18, 2026 10:34
@jvsena42

Copy link
Copy Markdown
Member

Device gate (partial): db88d41. Pixel_9 emulator (Android 17) on the local Spark stack (bitkit-docker spark profile), fresh wallet with 500k in Savings and no channel.

  • transfer/spark-transfer-to-spending.xml: 14/14 pass.
    • Funding options: Transfer, Hardware, Receive and Manual, all enabled, with no FundLearnMore.
    • 25% is 124 909, and Max is 499 635.
    • Confirm with Fast: network ₿ 458, service ₿ 546 ("max"), to spending ₿ 124 363, total ₿ 125 367.
    • Normal: service ₿ 99 ("est"), and to spending goes up by 447 with network and total unchanged.
    • Tapping the fees switches every amount to $ and back. Learn More keeps Normal selected.
    • The unit carries over: the amount shows "$ 80.13", delete gives "80.1" with no toast, and the unit button returns to ₿.
    • From the Savings card, Transfer To Spending skips the intro.
  • transfer/spark-transfer-status.xml: pass.
    • Fast goes Processing → Payment Successful → Transfer Successful, then Spending reads 124 649 on Home.
    • Normal shows "about 30 minutes", then Payment Successful.
    • The first Normal attempt failed with "Unable to broadcast": the Electrum sync timed out (ldk_node::chain::electrum:966 … deadline has elapsed, then SyncUnhealthyError='Wallet sync failed before send') while the host was at load 12. The retry passed, so I'm counting it as environment.
  • transfer/transfer-banner-opens-progress.xml: 7 of 8 pass. The banner shows, and tapping it opens Funds in transfer at Payment Successful. Done clears the banner.
    • ⚠️ Not verified: action 7, the relaunch. The local stack claims a Normal deposit at 0 confirmations within about 6 s, so I held the transfer open by pausing the Spark operators. That also stalled Spark's sync after the relaunch, which made the banner disappear.

Still running: transfer/transfer-unavailable-sheet.xml, hardware-wallet/transfer-to-spending.xml on the Trezor emulator, Review & Sign spacing against 51990:155518 on the device, and l10n in de and pt-BR.

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Device results so far at db88d41: one l10n LOW inline, nothing above LOW. Earlier results are in #1963 (comment).

  • hardware-wallet/transfer-to-spending.xml, on the Trezor emulator through Bridge: pass. The sign screen shows network ₿ 459, service ₿ 1 891, to spending ₿ 795 464 and total ₿ 797 814. The address is on one line with an ellipsis, and the angled Trezor sits behind the button. The device prompted for recipient, amount, locktime and a summary of 0.00797814 including the 0.00000459 fee. After that the flow went to Processing Payment, and a −797 814 Transfer row appeared with To Spending in its detail.
    • Not observed: the "Transaction Signed" step. It moved on within the 2 s polling gap.
    • Precondition not met: the "older blue hardware received row" step. The hardware wallet's received rows were older than the recent list.
  • Review & Sign spacing at db88d41. Measured from uiautomator bounds: title to first label 32 dp, row gap 10 dp, address row to Fast row 10 dp. That matches 51990:155518, so my earlier LOW is fixed on the device.
  • l10n. pt-BR fits on Review, Sign, Learn More, Funding and Amount. de fits except the headline inline. "TRANSFER SPEED" and two Funding titles are untranslated in de, but those keys predate this PR.

Still pending: transfer/transfer-unavailable-sheet.xml, and the banner relaunch step, which needs a chain that waits for confirmations. The final review type follows.

Comment thread app/src/main/res/values-de/strings.xml Resolved

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving at db88d41: nothing above LOW from the code scan or the device gate. The spacing LOW is fixed and measured on the device. The approval stands with one LOW open, the German Learn More headline. Fix it here or in a follow-up issue, your choice, and reply on the thread saying which.

Device gate: db88d41 — Pixel_9 emulator (Android 17), local Spark stack (bitkit-docker spark profile), Trezor emulator through Bridge for the hardware journey.

  • journeys:
    • transfer/spark-transfer-to-spending.xml 14/14.
    • transfer/spark-transfer-status.xml passed. One Normal attempt hit an Electrum sync timeout under host load, and the retry passed.
    • transfer/transfer-unavailable-sheet.xml 11/11, with Spark broken: every entry shows the sheet, both links open, and Manual Setup is the only enabled option.
    • hardware-wallet/transfer-to-spending.xml passed, including the Trezor prompts for recipient, amount, locktime and summary, and the −797 814 Transfer row.
    • transfer/transfer-banner-opens-progress.xml 7 of 8.
  • Review & Sign spacing matches 51990:155518 on the device: title to grid 32 dp, row gaps 10 dp, address row to Fast row 10 dp.
  • perf: not relevant.
  • Figma: Review, Review & Sign, Learn More and Funding match.
  • l10n: de and pt-BR, 1 overflow (inline).

⚠️ Not verified:

  • transfer-banner-opens-progress.xml action 7, the relaunch. The local stack claims a Normal deposit at 0 confirmations within seconds, and pausing the operators to hold it open also stalled Spark's sync after the relaunch. It needs a chain that waits for confirmations.
  • The "Transaction Signed" step of the hardware journey. It moved on before it could be captured.
    Skipped — covered by CI at db88d41: unit tests, compose UI tests, detekt, lint, e2e.

Verified: just format, compile, test, lint
@ovitrif
ovitrif requested a review from jvsena42 November 18, 2026 12:34
Merges master; the screens map keeps both PRs' rows.

Verified: just format, compile, test, lint
@ovitrif

ovitrif commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

357f06e merges master after #1960; the only conflict was docs/screens-map.md, which keeps both PRs' rows.

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

Jarvis reviewed Spark Transfer to Spending and hardware confirmation at 357f06e8, including the German Learn More copy fix and the merge from 847d6de5. No material findings.

GitHub shows 17 passing checks, including the required E2E gate, and six skipped. The Trezor emulator signing evidence is from db88d415. Current-head rendering and end-to-end hardware deposit settlement remain unverified.

Reviewer model: gpt-6.1-sol
Reasoning effort: xhigh

@ovitrif

ovitrif commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Merging: approved on 357f06e with all required checks green and no open threads.

@ovitrif
ovitrif merged commit 7bfbdb6 into master Nov 19, 2026
23 checks passed
@ovitrif
ovitrif deleted the feat/spark-transfer-to-spending-v64 branch November 19, 2026 02:21
@ovitrif ovitrif mentioned this pull request Nov 19, 2026
14 tasks done
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