From e4ed03b5caa874fad189c6a90b3e09da5530d58d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 24 Sep 2026 17:27:00 -0700 Subject: Coins page: a renewal in flight keeps the whole page; a renewal you asked for is in history. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tapping Renew marked the coins pending and the page, finding nothing spendable, collapsed to a single "Pending: N sats" line — no table, no exit explainer. Coins in a round now stay in the table (greyed, tagged renewing), with a card saying where the round is (queued, in a round waiting for a confirmation, finishing). The page no longer closes on Renew. History: a manual renewal shows as "Renewing · in progress" while the round runs, and as "Renewed" after, even when it was free (automatic free renewals stay out of history, as before). Co-Authored-By: Claude Opus 5.5 (1M context) --- src/ark/manager.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ark') diff --git a/src/ark/manager.js b/src/ark/manager.js index 928edf8..7f24b7d 100644 --- a/src/ark/manager.js +++ b/src/ark/manager.js @@ -1854,7 +1854,9 @@ export class ArkManager { return this.info.refreshFees.baseFeeSat + Math.ceil(ppmUnits / 1_000_000); } - async refresh(vtxoIds) { + // manual: the user asked for this one (the coins page) — it earns a + // history row even when free; the wallet's own renewals only when they cost + async refresh(vtxoIds, { manual = false } = {}) { const inputs = (vtxoIds ? vtxoIds.map((id) => this._vtxo(id)) : this.state.vtxos.filter((v) => v.state === 'spendable')); @@ -1873,7 +1875,7 @@ export class ArkManager { id: `refresh-${Date.now()}`, type: 'refresh', step: 'created', inputIds: inputs.map((v) => v.id), outKeyIndex: this.state.nextKeyIndex++, - outAmountSat: totalSat - feeSat, feeSat, + outAmountSat: totalSat - feeSat, feeSat, manual: !!manual, inAmountSat: totalSat, }; for (const v of inputs) v.state = 'pending'; this.state.actions.push(action); @@ -2005,7 +2007,7 @@ export class ArkManager { // inputIds let the history skip "spent elsewhere" rows for coins this // renewal consumed — reconciled before the claim, they'd otherwise // stand as spends that the renewed coin silently contradicts. - this._movement({ type: 'refresh', amountSat: action.outAmountSat, feeSat: action.feeSat || 0, status: 'complete', unlockHash: action.unlockHash, inputIds: [...(action.inputIds || [])], detail: `${inputRecs.length} in -> ${newVtxos.length} out${action.feeSat ? ` · fee ${action.feeSat} sat` : ''}` }); + this._movement({ type: 'refresh', amountSat: action.outAmountSat, feeSat: action.feeSat || 0, manual: !!action.manual, status: 'complete', unlockHash: action.unlockHash, inputIds: [...(action.inputIds || [])], detail: `${inputRecs.length} in -> ${newVtxos.length} out${action.feeSat ? ` · fee ${action.feeSat} sat` : ''}` }); this._save(); } } -- cgit v1.2.3