Skip to content

feat: spark transfer status design - #1901

Merged
ovitrif merged 10 commits into
masterfrom
feat/spark-transfer-status-design
Nov 13, 2026
Merged

ovitrif merged 10 commits into
masterfrom
feat/spark-transfer-status-design

Conversation

@ovitrif

@ovitrif ovitrif commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

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

This PR:

  1. Updates the Spark "Funds in transfer" screen to the six designed frames
  2. Fixes the Home transfer banner so it opens the pending transfer's progress
  3. Fixes the Savings banner so it opens a running Spark emergency exit

Description

  • Updates the transfer status screen to the "Funds In Transfer (spark)" frames, so each step says what Spark is doing: "Processing Payment" until Spark lists the deposit, then "Payment Successful" (either speed) and "Adding To Spending Balance", ending on "Transfer Successful" with "Awesome!".
  • Adds the "Fast transfer fee changed" frame with "Wait" and "Approve" side by side, so a repriced fast transfer can go on at normal speed: "Wait" shows "Using Normal Transfer Speed" on the last step with "about 30 minutes".
  • Adds the "Fast transfer unavailable" frame, which goes on at normal speed with "Using Normal Transfer Speed".
  • Shows the coins while the fast transfer is in question and the transfer arrows in dashed rings otherwise, held still as in the frames.
  • Fixes the "TRANSFER IN PROGRESS" banner on Home, which now opens that transfer's progress at its current step, keeping Approve or Wait over a changed fee, also after a relaunch once Spark lists the deposit.
  • Fixes the Savings banner, which now opens the progress of a running Spark emergency exit.
  • Adds the new English strings and drops the removed keys from every locale; the translations of the new keys are tracked in chore: translate spark strings #1840.

Out of Scope

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:

1 Processing Payment 2 Payment Successful

Frames 3 and 4:

3 Fee Change 4 Fast Transfer unavailable

Frames 5 and 6:

5 Adding To Spending Balance 6 Transfer Successful

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:

Status frames Transfer banner Savings banner
and-flow2x.mp4
and-banner2x.mp4
and-exit2x.mp4

QA Notes

Setup

  • Dev build (regtest) with Spark connected on its regtest and reading Bitkit's chain, as spark-transfer-to-spending.xml sets up: built with ESPLORA_URL from scripts/spark-regtest-esplora.py, Savings funded with scripts/spark-regtest-fund.py (at least 20 000 sats, confirmed), no channels.
  • Home needs at least one activity to show the transfer banner.

Journeys

  • J1: new spark-transfer-status.xml — the transfer status screen walks the designed frames for an Instant and a Later transfer
  • J2: new transfer-banner-opens-progress.xml — the Home transfer banner reopens the transfer at its current step, also after a relaunch

Manual Tests

  • 1. Start a Spark emergency exit (Settings → Advanced → Lightning Connections → Spark → Emergency exit, swipe) → Home → tap the Savings banner → Exit in progress opens — a running emergency exit, which holds the Spark balance for days, not in Capabilities

Automated Checks

  • added TransferStatusTest.kt — each claim state, seen deposit, approved fee and Wait maps to its frame
  • updated SettingUpScreenTest.kt — the steps sit above the buttons on a small screen; no fast transfer shows the coins at normal speed
  • updated SparkRepoTest.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 screen
  • updated SparkFundingViewModelTest.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 it
  • updated ContentViewTest.kt — the transfer banner opens the deposit's progress and back returns home

Evidence

  • a80e669 end to end against Spark's regtest, dev debug build, media emulator (API 37): J1 (Instant and Later) and J2 pass, including the banner after a relaunch. J1 showed the step label going back to "Processing Payment" for about 2 s while Spark claimed the deposit; a6ade5b fixes it. Spark's regtest claimed each deposit before "Adding To Spending Balance" showed, so the journey treats that frame as optional.
  • c3654ca (before the reopen fix, which changes no frame) on a dev debug build, media emulator (API 37), with a local debug hook staging each claim state, the pending deposit and the running exit (not part of this PR):
    • all six frames and the Wait state match the Figma frames side by side (Preview);
    • J2's banner steps: the banner opens "Payment Successful" with "about 30 minutes", also after a relaunch;
    • case 1: the Savings banner opens "Exit in progress".
  • just compile, just test and just lint pass on a1d2f09.

Gaps

  • The fee changed, unavailable and "Adding To Spending Balance" frames did not occur on Spark's regtest; they were staged with the debug hook above.
  • a6ade5b is covered by SparkFundingViewModelTest.kt, not rerun on a device.

Models used

  • Planning/scoping: claude-opus-5-5 (reasoning: medium)
  • Implementation: claude-opus-5-5 (reasoning: medium)
  • Review: claude-sonnet-5-5 (reasoning: low)

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.
@ovitrif ovitrif self-assigned this Nov 12, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 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-12T18:18:19.893894Z a1d2f09 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.

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

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

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes stay within Spark transfers and the two Home banner routes.

Restore pending fee decisions after restart before merging.

Findings

  1. P1 Fee choices disappear after restart ▶
  2. P2 Normal transfers exceed journey timeout ▶

Summary

Updates Spark transfer progress and connects Home banners to pending transfers and running emergency exits.

  • Spark transfers show each claim stage in its own progress frame.
  • Home’s transfer banner opens the pending deposit’s progress.
  • The Savings banner opens a running Spark emergency exit.

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]
Loading

Reviews (1) · Last reviewed commit: "chore: add changelog fragment" · Reviewed by Greptile

@ovitrif
ovitrif requested review from a team, ben-kaufman and pwltr and removed request for a team November 12, 2026 18:19
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from a6ade5b (run).

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

@ovitrif ovitrif added this to the 3.2.0 milestone Nov 12, 2026
@ovitrif

ovitrif commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

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 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 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: inProgressDepositTxid reads the same deposits list that carries the locally broadcast, unlisted deposit, so the banner has a txid as soon as it shows.
  • followShownDeposit overriding the claim the funding screen follows: it only inserts Later when the map has no entry for the txid, so an Instant claim in progress keeps its state.
  • followShownDeposit then hiding a later recovery: followRecoveredSparkFunding skips waitForMatureClaim when an entry exists, but the entry it finds is already Later, the same state that call sets; the early claim cap it would release is only set by claimInstantly, which this path never ran.
  • Index out of range in ProgressSteps: every frame's stepIndex is 0 to 2 over a three-label list, which TransferStatusTest asserts.
  • 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)

@ovitrif
ovitrif requested a review from ben-kaufman November 12, 2026 19:41

@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 a80e669: no HIGH or MEDIUM. Reviewed as a funds change (SparkRepo, SparkFundingViewModel, LightningRepo recovery).

Checked and clean:

  • No double start. followShownDeposit only inserts Later when 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, because followDepositClaim writes unconditionally. onConfirm with a shown txid emits Sent without sending, and onAmountChange clears that txid.
  • Approval shows the true fee. Approve pays repriced.offer.earlyFeeSats as the ceiling, the same value statusText renders. A further rise yields Repriced again, which outranks isFeeApproved, so the user is asked again. Wait records Waited only from Repriced.
  • Spark-supplied data in the UI: only the numeric fee is rendered, through formatToModernDisplay. The txid travels on an InternalOnly route.
  • Lifecycle:
    • Process-death restore of SettingUp(txid) re-runs the idempotent showDeposit.
    • wipe() clears _claimChoices.
    • transferStatusOf covers every SparkDepositClaim case.
    • Back and the button both go through navigateToHome().
    • navigateTo is single-top, so a double tap on the banner does not stack screens.
    • v3.1.1 holds no Spark or SettingUp state, so there is no upgrade path to check.
  • 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.

⚠️ Device gate: not run — funding Savings on Spark's regtest (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.
@ovitrif

ovitrif commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

Device gate (partial): a80e669 — not run yet. Pending: J1/J2 on Android against Spark's regtest, Figma frames 1–6 against the running screens, and the relaunch banner tap.

@jvsena42 I ran J1 and J2 end to end against Spark's regtest, funding Savings from the shared regtest wallet.

QA for a80e669:
Tested on an API 37 emulator, dev debug build reading Spark's regtest chain.

🔴 J1: transfer status, Instant and Later
Instant

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.

j1-instant-2x.mp4

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.

j1-later-2x.mp4

🟢 J2: the banner reopens the transfer, also after a relaunch
J2: 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.

j2-banner-opens-progress-2x.mp4

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.

It reproduces:

  • Online, Spark had listed the deposit by the first tap, about 7 s after launch.
  • With the device offline, the banner showed and taps did nothing until the network returned. The transfer then opened 7 s later.

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.

j2-relaunch-offline-check-2x.mp4

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.

@ovitrif
ovitrif requested a review from jvsena42 November 13, 2026 13:01

@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 a6ade5b against db3b1b2.

  • High candidate — stale Spark attempts can submit twice. LightningRepo.kt:1537 removes the final Spark send-generation check. In SparkRepo.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-386 discards the successful-build signal when holding a Redo rebuild for an unread leaf. If held funds cover that build but an older NeedsFunding amount 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

@ovitrif

ovitrif commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed a6ade5b against db3b1b2.

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

  • This PR changes neither LightningRepo.kt nor SparkExitDriver.kt. Its diff against its merge base (df7f224...a6ade5b) only touches SparkRepo.kt for the claim choices.
  • The Spark send-generation guard and the exit rebuild handling, with their regression tests, landed in fix: spark send and exit follow-ups #1898. Merging this PR keeps them: it merges into current master without conflicts.

So there is nothing to change here for these two. Could you re-review against the PR's own diff?

@ovitrif
ovitrif requested a review from pwltr November 13, 2026 14:09

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

@ovitrif

ovitrif commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

Merging: @pwltr approved a6ade5b and CI is green. The relaunch tap before Spark lists the deposit is tracked in #1905, and the translations of the new keys in #1840.

@ovitrif
ovitrif merged commit 953b1cb into master Nov 13, 2026
23 checks passed
@ovitrif
ovitrif deleted the feat/spark-transfer-status-design branch November 13, 2026 18:01
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.

5 participants