Repository navigation
feat: spark connection and app status design - #1964
Conversation
Verified: just format, compile, test, lint; journeys on a regtest emulator
Verified: just format, just compile, just test, just lint
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. |
Verified: none (changelog text only)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63cd701fe5
ℹ️ 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 affect Spark’s connection screens and the app-wide health status shown to wallet users. The PR appears safe to merge, with a non-blocking display issue on Spark's detail page. Findings
SummaryUpdates Spark's connection details and App Status with receiving capacity, grouped deposits, force-transfer status, and an app-version footer.
ovitrif explicitly leaves translations to #1961; accepts the brief SDK deposit-list gap and regtest explorer mismatch; follows shared spacing and text sizes rather than exact frames; and defers Blocktank renewal, ToS checkmarks, and the separate transfer flows. Reviews (1) · Last reviewed commit: "fix: show an unconfirmed spark deposit a..." · Reviewed by Greptile |
Regtest APKDownload bitkit-dev-debug universal APK (expires in 30 days). |
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Moves Spark into Open Connections with "no limit" receiving, rebuilds the Spark connection screen to the v64 frame, folds the force transfer into App Status's Spark row and counts Spark in the menu status. Reviewed 3540dde, full tier, static: an auto review never builds a bitkit-android branch here, so this is read from the code and from CI.
What I checked, and 6 candidates I ruled out
Read in full: the whole diff, plus HealthRepo.computeHealthState, SparkRepo.start / refresh (how deposits and hasStartFailed are built), SparkState.isUsable, SparkExitRecord.isActive, AppStatusViewModel.exitStep, LightningConnectionsViewModel (where spark and isSparkReceiving come from)
Call sites traced: SparkDepositRow (removed, no callers left), the removed string keys settings__status__exit__title, settings__status__exit__pending, lightning__spark_deposits_claimed / _pending (no references left in app/src), LightningChannel(receivingUnlimited)
CI: build-local and detect-changes green; build-and-test, lint, compose-ui and the e2e shards still pending when I reviewed
Ruled out
- The menu turns red for an unsupported Spark:
computeApp()mapssparkthroughlet, so a null Spark drops out oflistOfNotNull;HealthRepoTest.ktpins it. - App Status's Spark row and the menu disagree on a running force transfer: both read
record.isActive(HealthRepothroughsparkExitRepo.state, the row throughexitStep), so the row shows the exit exactly while the menu counts Spark as pending. - The detail screen reads "Offline..." on a device where Spark is unsupported:
health.spark ?: ERRORonly applies where Spark is null, and the detail route is reached only from the Spark row and the connections list, both of which exist only where Spark does. - The deposit amount overflows when re-adding the claim fee:
grossSatsadds throughsafe(), and an unclaimed deposit keeps its own amount, so the row reads the same on-chain value before and after the claim (SparkUiTest.kt). - "no limit" while Spark cannot receive: the list row, the bar and the BALANCE row all gate on
isUsable(isReady && !isExiting), the same flag the header uses, so a connecting, offline or exiting Spark shows only its spending side. - Open Connections with Spark and no channels hides the empty state wrongly:
isEmptyalready requiredspark == nullbefore this PR, so a Spark-only wallet showed the list then too; the change only moves where the row sits.
Merge confidence: 4/5. Unit tests, lint and the e2e shards had not finished when I reviewed, and the menu's red state with Spark offline is covered by HealthRepoTest.kt only, not seen on a device (the PR's Gaps say so).
Reviewer model: claude-opus-5-5
Reasoning effort: Unknown (the reviewing session's metadata does not record it)
Verified: just format, just compile, just test, just lint
|
Pushed 54acd5a: once Spark had connected, going offline left its bar and "no limit" receiving on while the status read "Offline...". Receiving now needs the device online as well as a usable Spark, on Lightning Connections and the Spark connection screen; |
Verified: just compile, just lint
Verified: just format, just compile, just test, just lint
|
Pushed 44d854e: Spark's bar draws the dark spending track with the bright balance on its right half, App Status reads "Synced" for a healthy node, and the backup date uses the locale's short form, all as the v64 frames. Fresh screenshots follow. |
Verified: just format, just compile, just test, just lint
|
Pushed 16be32e: the backup time follows the device's 12- or 24-hour setting, as on iOS. |
Verified: just format, compile, test, lint
|
Pushed 7409d13: App Status reads the backup date as The description's App Status still and the J3 and J4 recordings are now from this head. |
jvsena42
left a comment
There was a problem hiding this comment.
Code scan at 7409d13: no HIGH or MEDIUM. One LOW is inline.
What I checked:
- Health.
computeApp()now counts Spark where it's supported: offline or failed-to-start Spark turns the menu red, and connecting turns it yellow. An active exit maps to PENDING, from the samerecord.isActivethatAppStatusViewModel.exitStepreads. Backups still feedcomputeApp. In recovery mode Spark stays PENDING. - Backup timestamp (
DateTime.kt:80-91). It usesgetBestDateTimePatternwithis24HourFormat, an injectable zone and locale, and no relative times. All locales carry the{date}/{time}template. - Spark details.
grossSatsadds the claim fee back only for claimed deposits, usingsafe(). The txid is shortened, confirmations are capped at 3, and the force-transfer condition is unchanged. - Journeys and tags. The journeys' tags and strings exist at the head, nothing in bitkit-e2e-tests uses the removed ones, and the
SparkDetailScreen.ktrow in the screens map now names its frame. - Figma. "Connection details Spark" (52015:389976) and App Status error (51990:156590) match in sections, status pill, provider rows, balance with "no limit", the deposit groups, buttons and footer. The frame's "Spark Via Breeze" looks like a typo; the app keeps "Spark via Breez".
perf: not relevant. HealthRepo gains one flow input and no polling.
Device gate (partial): 7409d13 — not run yet; pending: settings/app-status-spark-row.xml, settings/spark-connection-details.xml, settings/app-status-emergency-exit.xml and transfer/spark-emergency-exit.xml on the Spark regtest stack, plus the Figma screens on the device. Device results and the final review type follow in a second review.
The status reads as App Status's Spark row while an exit runs, in yellow, instead of Connection open. Verified: just format, compile, test, lint
|
Device gate (partial):
Still running: |
A rate priced at zero or one that does not parse no longer counts, so the fee grid stays in bitcoin. Fiat to sats fails on a zero or negative rate and on a negative or out of range result instead of wrapping. Verified: just format, compile, test, lint
|
45ba38e: only a positive exchange rate counts as a rate. A rate priced at zero, or one whose price doesn't parse, kept the fee grid's tap switching to fiat, which then showed zeros. Fiat to sats now fails on a zero or negative rate and on a negative or out of range result, where it wrapped before. |
The keypad remembers the unit its amount was typed in. Once another screen, such as the fee grid, switches the unit, it redraws the amount from sats, so the next key never reads fiat digits as bitcoin. Verified: just format, compile, test, lint
|
0a643ed: an amount typed in one unit is redrawn from its sats once another screen switches the unit, as the fee grid on Review does. Before, going back to the amount screen kept the fiat text, and the next key read those digits as bitcoin. |
pwltr
left a comment
There was a problem hiding this comment.
Reviewed 0a643ed.
Medium: Rejecting a zero rate in CurrencyRepo.kt:198 hides bitcoin amounts that are drawn from a fiat conversion. With a zero or unparseable price for the selected currency, convert(sats) now returns nothing, and MoneyCaptionB (Money.kt:203, Spark's balance, deposits and fees), BalanceHeaderView.kt:110, WalletBalanceView.kt:79, ActivityRow.kt:277 and SendCoinSelectionScreen.kt:258 then show no amount, even in bitcoin. Formatting the bitcoin amount from sats there, as rememberMoneyText now does, keeps them shown.
The redraw after a unit switch elsewhere is right: every change to the typed text records its unit, and a key press or a unit change redraws from sats first.
Review details
General review
Model: Claude Opus 5.5
Reasoning effort: high
The rate lookup is back to master's, so a zero price no longer hides bitcoin amounts drawn from a conversion; fiat-to-sats and the unit switch still refuse it. The fee grid and the claim speed fees show bitcoin while fiat is selected without a usable rate. Transfer To Savings also needs the device online. Verified: just format, compile, test, lint
The fees and max changed toasts fall back to bitcoin while fiat has no usable rate, like the fee grid, so a change never reads as zero. Verified: just format, compile, test, lint
pwltr
left a comment
There was a problem hiding this comment.
Reviewed 4dccc2a.
Medium: The first keypad edit can zero a redrawn fiat transfer amount in Arabic. With Arabic-Indic digits, enter 20,000 sats, switch to fiat on Review with a valid rate, then go back and press Backspace. AmountInputViewModel.kt:153 copies localized fiat text into the keypad input, and AmountInputViewModel.kt:388 parses it as an ASCII decimal. The edit stores zero sats and disables Continue in SpendingAmountScreen.kt:293. Keep the keypad value in a parseable form when redrawing the localized amount.
Low: Opening regtest Spark Details from Offline App Status after an exit reconnect fails can leave the deposit address missing after Spark recovers. AppStatusScreen.kt:253 now permits entry from cached state, but SparkDetailViewModel.kt:71 requests the address only on entry. If the SDK is absent then, the copy row stays missing through reconnect and pull-to-refresh. Reopening Details restores it.
Low: The fiat guard in CurrencyRepo.kt:284 accepts any positive matching ticker, while CurrencyRepo.kt:195 converts using the first match. A zero-priced first USD ticker followed by a positive one can show a real fee or fee increase as $0.00. A first price that parses as infinity can leave fees blank. Check that the ticker conversion actually uses has a finite, positive price before enabling fiat in the fee grids, speed rows and change warnings.
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 redrawn amount gives the keypad ASCII digits, so an edit in Arabic no longer reads it as zero. Fiat shows only while the ticker conversions use, the first, has a finite positive price. Regtest Spark Details loads the deposit address again once Spark connects. Verified: just format, compile, test, lint
@pwltr Addressed in 5020b49. A redrawn amount hands the keypad ASCII digits, Details loads the address again once Spark connects, and fiat shows only while the first matching ticker has a finite positive price. |
pwltr
left a comment
There was a problem hiding this comment.
Reviewed 5020b49. The keypad redraw, regtest deposit-address retry, and first-ticker fiat guard are fixed.
Medium: MoneyCaptionB requires a successful fiat conversion before it displays a Bitcoin amount (Money.kt:202). After Spark has read its state, the Offline row now opens Spark Details (AppStatusScreen.kt:253). If the selected currency has no cached quote, the Spending balance is blank (SparkDetailScreen.kt:145) even though Spark still has the last known sats. The same caption drops the spending amount in both bars (LightningChannel.kt:90, called from SparkDetailScreen.kt:116 and LightningConnectionsScreen.kt:443), the deposit amount and claim fee (SparkDetailScreen.kt:273, SparkDetailScreen.kt:277), the withdrawal amount and fee (LightningConnectionsScreen.kt:482, SparkDetailScreen.kt:175), and the known balance at an earlier exit address (SparkDetailScreen.kt:398). Format these Bitcoin captions directly from sats, as rememberMoneyText already does for Bitcoin.
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
MoneyCaptionB formats bitcoin from sats, so Spark's balance, bars, deposits, withdrawals, fees and earlier exit balances show while the selected currency has no rate. Typography is lazy, so loading the app text styles before the theme no longer leaves the button style unset. Verified: just format, compile, test, lint
@pwltr Addressed in 3d9cf92. |
pwltr
left a comment
There was a problem hiding this comment.
Reviewed 3d9cf92. No open findings. Spark’s Bitcoin captions now format directly from sats, so the balance, deposit amounts, and fees stay visible when the selected currency has no rate. The theme’s button text style is initialized correctly even when the app text styles load first.
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
|
Merging: approved on 3d9cf92 with CI green and no open threads. |
Twin: synonymdev/bitkit-ios#1360
Refs: #1840
Description
Out of Scope
Design
Figma page "Bitkit - Progress v64" in the Bitkit Wallet file:
Preview
Recordings at 2x
j1-spark-connection-details2x.mp4
j2-app-status-spark-row2x.mp4
j3-7409.mp4
j4-app-status-emergency-exit2x.mp4
Figma notes
Every note above the v64 frames for these flows, with what this PR does about it.
Settings › Advanced
Support & App Status
Onboarding New User
QA Notes
Setup
ESPLORA_URL=http://10.0.2.2:3995(add--no-build-cacheif a cachedBuildConfigdrops it), withpython3 scripts/spark-regtest-esplora.py --port 3995running on the emulator's host.SparkDepositAddress); J4 also needs Savings funds to pay the force transfer fees.Journeys
spark-connection-details.xml— Spark in the open connections, status, provider, balance, deposits and footer, the deposit tx link — passed on9a4562742app-status-spark-row.xml— the "Lightning Provider (Spark)" row, its tap-through and the version footer — passed on9a4562742spark-emergency-exit.xml— the "Force Transfer To Savings" entry and the force transfer start — passed on7409d139fapp-status-emergency-exit.xml— the force transfer on the Spark row and its tap-through to progress — passed on5c5dd5b99Automated Checks
HealthRepoTest.kt— Spark counted in the status, pending while a force transfer runs, ignored where unsupportedSparkDetailScreenTest.kt— deposits (claimed, confirming, pending with no or unknown confirmations), the bar's "no limit"SparkDetailViewModelTest.kt— the status follows Spark's health, offline while unknownSparkUiTest.kt— the deposit's on-chain amount before and after its claim, receiving only while online, connected and not exitingEvidence
On a regtest emulator (Android 16, 896×1994 at 320 dpi) with the local Spark stack, dev build of
16be32ee9(J1, J2 and the App Status states)7409d139f(J3 and App Status) and5c5dd5b99(J4 and App Status, force transfer):7409d139f); the row opened the Spark connection.Gaps
SparkDetailScreenTest.ktcovers it.Models used
Claude Opus 5.5(reasoning:medium)Claude Opus 5.5(reasoning:medium),Claude Sonnet 5.5(reasoning:high)Claude Sonnet 5.5(reasoning:high),Claude Opus 5.5(reasoning:medium)