Repository navigation
feat: spark transfer status design - #1901
Conversation
Maps the deposit states onto the six Funds In Transfer (spark) frames: processing, payment successful, fast fee changed, fast transfer unavailable, adding to spending balance and transfer successful. Adds a journey and tests for the mapping.
The success frame's button shows the design's "Awesome!". The banner journey drops the removed speed line.
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1d2f09dd3
ℹ️ 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".
[Medium impact] The changes stay within Spark transfers and the two Home banner routes. Restore pending fee decisions after restart before merging. FindingsSummaryUpdates Spark transfer progress and connects Home banners to pending transfers and running emergency exits.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Home transfer banner] --> B[Open SettingUp with txid]
B --> C{Claim exists in memory?}
C -->|Yes| D[Show current claim and choice]
C -->|No after restart| E[Assign Later]
E --> F[Show normal-speed progress]
G[Home Savings banner] --> H{Spark exit running?}
H -->|Yes| I[Open exit progress]
Reviews (1) · Last reviewed commit: "chore: add changelog fragment" · Reviewed by Greptile |
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
|
Milestone 3.2.0: this PR brings the Spark transfer status screens to their design and restores the Home banner tap, both part of the Spark release in 3.2.0. It closes no issue, so the milestone sits on this PR. |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Moves the Spark "Funds in transfer" screen to the six designed frames, and makes the Home transfer banner open the pending deposit's progress and the Savings banner open a running emergency exit. Reviewed a1d2f09, full tier, static: per this repo's rule for auto reviews the branch was not built here, so this rests on the code and CI.
What I checked, and 5 candidates I ruled out
Read: SettingUpScreen.kt (transferStatusOf, TransferStatusFrame, steps), ProgressSteps, SparkFundingViewModel.showDeposit / onPayRepriced / onWait, SparkRepo.followShownDeposit / waitForMatureClaim / claimInstantly / markClaimedDeposits / inProgressDepositTxid, LightningRepo.followRecoveredSparkFunding, the HomeScreen banner wiring, AppViewModel.onSparkExitBannerTapped / onSparkExitOpened and the isSparkExitRequested effect in ContentView, plus the string removals across locales.
CI: build-and-test, build-local, compose-ui, detekt, lint and Greptile green; two e2e-tests-local shards were still running when I posted.
Ruled out
- Banner tapped before Spark lists the deposit:
inProgressDepositTxidreads the samedepositslist that carries the locally broadcast, unlisted deposit, so the banner has a txid as soon as it shows. followShownDepositoverriding the claim the funding screen follows: it only insertsLaterwhen the map has no entry for the txid, so an Instant claim in progress keeps its state.followShownDepositthen hiding a later recovery:followRecoveredSparkFundingskipswaitForMatureClaimwhen an entry exists, but the entry it finds is alreadyLater, the same state that call sets; the early claim cap it would release is only set byclaimInstantly, which this path never ran.- Index out of range in
ProgressSteps: every frame'sstepIndexis 0 to 2 over a three-label list, whichTransferStatusTestasserts. - Savings banner tap with nothing to open: the click is only wired when
isSparkExiting; a channel close's savings banner stays non-clickable as before.
Merge confidence: 4/5, no findings and the status mapping and banner open are tested, but two e2e shards were still running and the branch was reviewed without a local build.
Reviewer model: claude-opus-5-5
Reasoning effort: 15 (runtime setting of this run)
There was a problem hiding this comment.
Code scan at a80e669: no HIGH or MEDIUM. Reviewed as a funds change (SparkRepo, SparkFundingViewModel, LightningRepo recovery).
Checked and clean:
- No double start.
followShownDepositonly insertsLaterwhen the txid has no entry. It starts no job, sets no fee cap and calls no SDK method. A later Instant follow still overwrites it, becausefollowDepositClaimwrites unconditionally.onConfirmwith a showntxidemitsSentwithout sending, andonAmountChangeclears thattxid. - Approval shows the true fee. Approve pays
repriced.offer.earlyFeeSatsas the ceiling, the same valuestatusTextrenders. A further rise yieldsRepricedagain, which outranksisFeeApproved, so the user is asked again. Wait recordsWaitedonly fromRepriced. - Spark-supplied data in the UI: only the numeric fee is rendered, through
formatToModernDisplay. The txid travels on anInternalOnlyroute. - Lifecycle:
- Process-death restore of
SettingUp(txid)re-runs the idempotentshowDeposit. wipe()clears_claimChoices.transferStatusOfcovers everySparkDepositClaimcase.- Back and the button both go through
navigateToHome(). navigateTois single-top, so a double tap on the banner does not stack screens.- v3.1.1 holds no Spark or
SettingUpstate, so there is no upgrade path to check.
- Process-death restore of
- Strings: the nine removed keys are gone from all 16 locale files and have no remaining references. The new keys are English-only by decision (#1840).
- perf: not relevant. The PR adds screen-scoped collectors and one
stateIn, with no new background work, locks or waits.
One LOW candidate is waiting on the device run. After a relaunch, the "TRANSFER IN PROGRESS" banner shows from the cached balanceInTransferToSpending, but its tap target (sparkState.inProgressDepositTxid, HomeScreen.kt:411) stays null until Spark's first refresh lists the deposit. broadcastDeposits is in memory only. I'll post it only if J2's relaunch step reproduces it.
scripts/spark-regtest-fund.py) needs the shared CI wallet's SPARK_REGTEST_MNEMONIC, which my environment does not have. Spark's regtest chain was reachable. J1/J2, the Figma comparison of frames 1–6 and the relaunch banner tap are still pending, and I'll run them once funding is available. Not approving until then.
Spark drops a deposit from its list while claiming it, so the status screen went back to Processing Payment for a moment before Transfer Successful. A deposit once listed now stays seen. The journey treats Adding To Spending Balance as a step Spark's regtest may skip.
@jvsena42 I ran J1 and J2 end to end against Spark's regtest, funding Savings from the shared regtest wallet. QA for a80e669: 🔴 J1: transfer status, Instant and LaterInstant The transfer goes through "Processing Payment" and "Payment Successful" to "Transfer Successful" in about 12 s, with the right headline, text, steps and buttons. After "Payment Successful" the label goes back to "Processing Payment" for about 2 s, because Spark drops the deposit from its list while claiming it. a6ade5b keeps a deposit seen once Spark lists it. Spark claimed the deposit before "Adding To Spending Balance" could show, so the journey now treats that frame as optional.
Later The text ends "about 30 minutes.", and the label moves from "Processing Payment" to "Payment Successful", then "Transfer Successful". It shows the same step-back as Instant, fixed in a6ade5b.
🟢 J2: the banner reopens the transfer, also after a relaunchJ2: the banner reopens the transfer, also after a relaunch The banner opens "Funds in transfer" at its current step. After a relaunch it reopens at "Payment Successful", and it leaves Home once "Awesome!" is tapped.
It reproduces:
The tap needs the deposit's txid, which the app keeps in memory only until Spark lists the deposit. Persisting it belongs with the other state a relaunch drops, so I added it to #1905 and to Out of Scope rather than changing it here.
The Figma frames 1–6 against the screens are in the Preview, staged with a local debug hook. The fee changed and unavailable frames depend on Spark's quote and did not occur on regtest. |
pwltr
left a comment
There was a problem hiding this comment.
Reviewed a6ade5b against db3b1b2.
-
High candidate — stale Spark attempts can submit twice.
LightningRepo.kt:1537removes the final Spark send-generation check. InSparkRepo.kt:531-548, two attempts can both read no previous payment, then the second can resume authorization after the first finishes and releases its in-flight entry. It reaches another SDK send without rechecking history. Restore a final generation/history guard and the removed regression coverage. Duplicate settlement depends on SDK behavior; the local second-submission path is supported by the source. -
Medium — a successful exit rebuild can keep asking for funding.
SparkExitDriver.kt:366-386discards the successful-build signal when holding a Redo rebuild for an unread leaf. If held funds cover that build but an olderNeedsFundingamount remains higher, the old shortfall survives and the progress screen still requests a top-up throughout the hold. Clear the obsolete request after a successful build using held funds and restore the removed regression case.
Review details
Quick review
Model: Claude Opus 5.5
Reasoning effort: high
General review
Model: GPT-6.1 Sol
Reasoning effort: high
Combined review
Model: GPT-6.1 Sol
Reasoning effort: high
|
@pwltr both findings come from comparing this PR's head with master after #1898 merged. This branch starts before #1898, so the review sees #1898's additions as removals.
So there is nothing to change here for these two. Could you re-review against the PR's own diff? |
pwltr
left a comment
There was a problem hiding this comment.
Reviewed a6ade5b against the PR’s merge-base diff. No additional code findings. The English-only transfer and fee-approval strings remain deferred to #1840 as documented.
The reported removals in LightningRepo.kt and SparkExitDriver.kt are absent from this PR’s diff; they come from changes made only on the newer base branch.
Device checks: transfer-banner-opens-progress.xml passed on an Android emulator, using a test build temporarily adapted to a local regtest setup.
Review details
Quick review
Model: Claude Opus 5.5
Reasoning effort: high
General review
Model: GPT-6.1 Sol
Reasoning effort: high
Combined review
Model: GPT-6.1 Sol
Reasoning effort: high
Twin: synonymdev/bitkit-ios#1318
Refs: #1840
This PR:
Description
Out of Scope
SettingUpScreen.kt: the fee keeps the app's money format (₿ 2 134) rather than the frame's₿ 2134.SparkRepo.kt: a relaunch drops the followed claim, its approved fee and a pending fee change, as on master — bug: fast transfer fee prompt gone after relaunch #1905, raised in feat: spark transfer status design #1901 (comment).HomeScreen.kt: right after a relaunch the transfer banner opens the transfer only once Spark lists the deposit (seconds when online), because the app keeps a broadcast deposit in memory only — part of bug: fast transfer fee prompt gone after relaunch #1905, raised in feat: spark transfer status design #1901 (review).SettingUpScreen.kt: the Wait and Approve test tags staySettingUpWaitandSettingUpPay, where iOS usesSparkDepositWaitandSparkDepositPay; the journeys README records it.Design
Figma section "Funds In Transfer (spark)" in the Bitkit Wallet file (section):
The fee on Fee Change keeps the app's money format (
₿ 2 134, with the thousands space) where the frame shows₿ 2134.Preview
Figma frame (left) and the app (right), frames 1 and 2:
Frames 3 and 4:
Frames 5 and 6:
After Wait on Fee Change, the last step reads "Using Normal Transfer Speed" with about 30 minutes:
Recordings at 2x: the frames in order with Wait tapped; the Home banner opening the transfer, again after a relaunch; the Savings banner opening a running emergency exit:
and-flow2x.mp4
and-banner2x.mp4
and-exit2x.mp4
QA Notes
Setup
spark-transfer-to-spending.xmlsets up: built withESPLORA_URLfromscripts/spark-regtest-esplora.py, Savings funded withscripts/spark-regtest-fund.py(at least 20 000 sats, confirmed), no channels.Journeys
spark-transfer-status.xml— the transfer status screen walks the designed frames for an Instant and a Later transfertransfer-banner-opens-progress.xml— the Home transfer banner reopens the transfer at its current step, also after a relaunchManual Tests
Automated Checks
TransferStatusTest.kt— each claim state, seen deposit, approved fee and Wait maps to its frameSettingUpScreenTest.kt— the steps sit above the buttons on a small screen; no fast transfer shows the coins at normal speedSparkRepoTest.kt— a deposit opened after a relaunch reads as claimed once Spark claims it; Approve and Wait over a changed fee are kept for a reopened screenSparkFundingViewModelTest.kt— the banner opens the deposit at its claim step, with the choice made over its changed fee; the deposit stays seen once Spark lists it, also while Spark claims itContentViewTest.kt— the transfer banner opens the deposit's progress and back returns homeEvidence
just compile,just testandjust lintpass on a1d2f09.Gaps
SparkFundingViewModelTest.kt, not rerun on a device.Models used
claude-opus-5-5(reasoning:medium)claude-opus-5-5(reasoning:medium)claude-sonnet-5-5(reasoning:low)