From 81df06c53eef1ef2931ed48955aded1e6ce0fa4f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 29 Jun 2026 08:49:16 -0700 Subject: Send progressive disclosure, swap context in tx detail, LN amount placeholder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Send: show only the destination input ('Address or Lightning invoice') until a valid on-chain/SP address is entered, then reveal amount + fee rate + coin selection + Review. A pasted bolt11 still auto-advances to its own confirmation, so those controls never appear for it. New wallet.isOnchainAddress() validator + a destReady() gate; recipient onInput/paste re-render only when validity flips. - History: stop listing swaps at the top. Instead, a send/receive that was part of a swap shows its Lightning context (invoice, swap fee, status, refund) on the tx detail screen via swaps.findByTxid(). Removed the dead swapListView. - Lightning receive: drop the '50000' amount placeholder — a bare number looked like a value was already entered; the min/max hint below covers it. Verified in-browser: controls hidden until a valid address, then revealed; LN receive placeholder empty; no errors. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/swap.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/swap.js') diff --git a/src/swap.js b/src/swap.js index 1e56223..8bc4183 100644 --- a/src/swap.js +++ b/src/swap.js @@ -239,6 +239,9 @@ export class SwapManager { } list() { return this.wallet.loadSwaps(); } + // The swap (if any) an on-chain tx belongs to — its lockup funding (submarine), + // claim (reverse), or refund. Lets the tx detail screen show the swap context. + findByTxid(txid) { return this.list().find((s) => s.fundTxid === txid || s.claimTxid === txid || s.refundTxid === txid) || null; } _get(id) { return this.wallet.loadSwaps().find((s) => s.id === id); } _save(rec) { const list = this.wallet.loadSwaps(); -- cgit v1.2.3