Skip to content

fix: match force transfer pay and completed screens to frames - #1362

Merged
ovitrif merged 6 commits into
masterfrom
fix/spark-force-transfer-frames
Nov 19, 2026
Merged

ovitrif merged 6 commits into
masterfrom
fix/spark-force-transfer-frames

Conversation

@ovitrif

@ovitrif ovitrif commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Twin: synonymdev/bitkit-android#1960
Refs: #1361

Description

  • Pay to confirm starts the force transfer by itself once the funding address holds the emergency fees, also when they are already there on entry, so it has no Continue button, as in the frame. One start runs at a time; while it runs the button shows a spinner, Cancel is disabled and back, menu and swipe-back are hidden or blocked. A failed start shows its error and "Try Again", and never retries by itself.
  • The completed force transfer screen drops the "small amounts stayed on Spark" line and the unused-fees notes the returned paragraph already counts, as in the frame. It keeps only notes saying where funds still are: dust kept at the address, a refused or still-unconfirmed sweep, and funding still at its address. Failed and cancelled transfers keep the full note.
  • The Transfer to Savings intro's title and text sit 16 pt in, as in the frame, instead of 32.
  • Spark's connection screen shows a running force transfer in yellow, worded as App Status's Spark row ("Force transfer to savings in progress..." or "Emergency fees needed"), instead of a green "Connection open".
  • Removes the unused lightning__spark_exit__partial_text string from every locale.

Out of Scope

Design

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

Preview

Figma App

The starting, failed and completed states were captured on a local build that reports funded fees, a start that runs or fails, and a finished transfer with small amounts left on Spark and a confirmed leftover sweep, since a real force transfer cannot be cancelled.

J1, Pay to confirm with the fees already there: it starts on its own, fails, and Try Again starts it again (2x):

j1.mp4

QA Notes

Journeys

N/A

Manual Tests

  • 1. Force Transfer To Savings with savings that can't pay the emergency fees → Pay to confirm shows only Cancel; pay the amount from another wallet → the spinner shows and the transfer starts by itself — not run: a started force transfer cannot be cancelled (see Gaps)
  • 2. Spending → Transfer To Savings with the intro not yet seen → title and text 16 pt from the edge, aligned with Get Started

Automated Checks

  • ran swiftformat --lint, node scripts/validate-translations.js, SparkExitMathTests, SparkExitSweepTests, SparkExitRecordTests, SparkExitReviewTests, SparkExitDriverTests, AppStatusExitTests, AppStatusHelperTests (pass)
  • updated SparkExitMathTests — Pay to confirm starts on its own once a read finds the fees covered, on entry included, once a visit, never while a start runs
  • updated AppStatusExitTests — the Spark row's force transfer wording, shared by App Status and Spark's connection screen

Evidence

  • iPhone 17 Pro simulator (iOS 27.0), regtest wallet with Spark funded:
    • Pay to confirm, unfunded: Cancel only, back and menu shown.
    • Staged start: spinner in the primary button, Cancel disabled, no back or menu; staged failure: error toast, Try Again and Cancel enabled, back and menu back.
    • Staged completed transfer with 2 skipped leaves and a confirmed leftover sweep: four ticked steps, the returned paragraph, Wallet Overview, and no small-amounts line or leftover note.
    • Savings intro: title and text at 16 pt, as in the frame.

Gaps

  • Manual test 1's payment was not sent: it starts a force transfer that runs for weeks. SparkExitMathTests cover the start rule and SparkExitDriverTests the start itself.
  • Spark's connection screen during a force transfer was not captured: it has no frame, and only a real force transfer, which cannot be cancelled, reaches it. AppStatusExitTests cover its wording.

j1.mp4

Models used

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

Pay to confirm starts the force transfer on its own as soon as a read finds the fees covered, on entry too, as in the frame without Continue. A failed start shows Try again and never retries by itself; a running start spins the button.

Verified: swiftformat --lint, validate-translations, SparkExitMath, Sweep, Record, Review and Driver unit tests on the iOS simulator
The done text drops the small amounts left on Spark, and a completed exit names only leftover fee funding that stays at the address: what a sweep sent back is in the returned note.

Verified: swiftformat --lint, validate-translations, SparkExitMath, Sweep, Record, Review and Driver unit tests on the iOS simulator
A done force transfer hides leftover lines only for confirmed sweeps the
returned note counts as unused fees. A sweep still sending, or one the
note cannot count, keeps its line and transaction link.

Verified: swiftformat --lint
The intro's title and text sat 32 pt in, inside both the screen's and
the text block's padding; they now share the button's 16 pt inset.

Verified: swiftformat --lint
@ovitrif ovitrif added this to the 3.2.0 milestone Nov 18, 2026
@ovitrif ovitrif self-assigned this Nov 18, 2026
@ovitrif
ovitrif requested review from a team, ben-kaufman and pwltr and removed request for a team November 18, 2026 06:00
Verified: none (changelog only)
@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The main behavior change is limited to the Spark force-transfer funding flow.

Restore a clear partial-transfer warning before merging so users are not told that unrecovered funds were transferred.

Findings

  1. P1 Partial transfers look complete ▶

Summary

Updates the force-transfer payment and completion screens, and aligns the savings introduction text with its button.

  • The Spark exit starts once a funding read shows enough money.
  • Completed Spark exits show returned fees without repeating them.
  • The Savings intro text and button use the same horizontal padding.

Reviews (1) · Last reviewed commit: "fix: inset transfer to savings intro tex..." · 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: d3eaf6c87d

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

@chatgpt-codex-connector

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-18T06:03:38.460125Z d3eaf6c 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.

@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. Pay to confirm now starts the force transfer by itself once a read this visit finds the fees covered (on entry too), with Try again and a spinner in place of Continue; the completed screen drops the skipped-leaves line and the leftover notes the returned paragraph already counts; the Savings intro text moves to 16 pt. Reviewed b81eaf8, full tier, static: iOS does not build on this host, so nothing was built or run here.

What I checked, and 6 candidates I ruled out

Read in full: SparkExitPayView, SparkExitLeftoverStatus, SparkExitProgressView (text, returnedText, the new isReturnedFeesShown), SparkExitMath.returned / sweptLeftoverSats / canAutoStartFunding, SparkExitManager.watchFundingAddress / readFundingAddress / useQuote, SparkExitRecord.leftoverLine, OnboardingView.
Call sites traced: canAutoStartFunding (one view, one test), buttonHorizontalPadding / contentHorizontalPadding (only SavingsIntroView passes it; the other 18 OnboardingView callers take the default 16, so their layout is unchanged), lightning__spark_exit__partial_text (no reader left, removed from every locale).
CI: SwiftFormat, validate and detect-changes green; Run Tests, Run Integration Tests and build-local still pending when this was written.

Ruled out

  • Auto-start on a stale reading: hasReadFunding is reset in .task and set only by onRead, which watchFundingAddress calls only after a successful read, so fundingSeenSats left over from the Funding screen cannot start it before this visit reads the address.
  • A missed start: canAutoStart is false at appearance (hasReadFunding false), so onChange always sees the false-to-true edge.
  • Double start: start() guards on isStarting, and hasAutoStarted is set before start() in the auto path, so canAutoStart drops at once.
  • Try again missing after a failure: every throwing path of startSparkExit leaves isStarting false with hasAutoStarted true, and isFunded still holds, so the button shows; a cancelled start lands in the same state.
  • Unused-fees notes hidden while the returned note does not name them: isReturnedFeesShown uses the same spendingSats > 0 && feesSats > 0 test as returnedText, and feesSats includes sweptLeftoverSats (earlier sweeps plus the confirmed one), so a hidden .swept or earlier-sweep line is always counted in the paragraph; failed and cancelled exits keep every line since returned is nil outside .done.
  • Funds on Spark no longer mentioned: skippedLeafCount counts leaves the build never took into the exit, which stay in the Spark balance; leaves the exit gave up on still show through SparkExitLeftBehind. Dropping the line follows the linked frame.

Merge confidence: 4/5, no findings, but the unit and integration runs were still pending and the view changes were reviewed without a build.

Spark stays connected through a force transfer, so its connection screen read a green "Connection open" while App Status showed the transfer in yellow. The screen now shows the same yellow status and wording as App Status's Spark row.

Verified: swiftformat --lint, AppStatusExitTests, AppStatusHelperTests, SparkExitMathTests on the iPhone 17 Pro simulator

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

Reviewed the force-transfer payment, progress and completion screens, including the text shared with App Status. The required unit, integration, lint and E2E checks passed on GitHub.

An irreversible force transfer and the Spark connection screen during an active transfer remain unverified by this review.

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

@ovitrif

ovitrif commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Merging: approved at the current head, all required checks green, no open threads.

@ovitrif
ovitrif merged commit 0c75667 into master Nov 19, 2026
21 of 22 checks passed
@ovitrif
ovitrif deleted the fix/spark-force-transfer-frames branch November 19, 2026 02:21
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.

3 participants