From 1b142c92ce869a6ebe97825931ef3553255ba58e Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 19 Sep 2026 22:28:36 -0700 Subject: Zaps: tap again while one flies, hold the bolt to change the amount. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A pending zap no longer refuses the next tap: the optimistic tally keeps one entry per zap and matches each report and receipt to the oldest it can describe, so two default-amount zaps stack, settle and hand over to their receipts one at a time. Instant post zaps run off the send screen's zap slot, so a second tap can't evict the one still resolving, and send action ids are unique within a millisecond. Holding ⚡ (500ms) opens the amount screen in an edit mode — Save alone, or Save and zap this note — from the action bar and the chat chips alike; the press's timer lives on the element so a background repaint mid-press can't turn a lifted finger into a hold. Co-Authored-By: Claude Fable 5.1 --- src/features/ark.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/features/ark.js') diff --git a/src/features/ark.js b/src/features/ark.js index dbc97f6..5327a23 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -1554,11 +1554,18 @@ export function arkFeature(ctx) { // 3. an on-chain address from the BIP-353 record const NAMES_REGISTRAR = 'https://names.coinos.io'; function startNpubPay(pk, npub, eventId = null, autoSat = 0) { - const z = (ui.arkZap = { npub, pk, eventId, amount: '', comment: '', status: 'lookup', autoSat }); - ui.zap = null; // a stale Lightning-zap card must not resurface behind ours - ui.sendError = ''; - render(); - const live = () => ui.arkZap === z; + const z = { npub, pk, eventId, amount: '', comment: '', status: 'lookup', autoSat }; + // A one-tap post zap has no card: it resolves and pays off-screen, so a + // second tap — the same post again, or another — never evicts the one + // already in the air. Everything else takes the send screen's zap slot. + const instant = !!(autoSat && eventId); + if (!instant) { + ui.arkZap = z; + ui.zap = null; // a stale Lightning-zap card must not resurface behind ours + ui.sendError = ''; + render(); + } + const live = () => instant || ui.arkZap === z; // The tap already put a pulsing chip on the note being zapped: whichever // way this goes, say so, so the chip settles instead of pulsing until it // times out. (A handover to the Lightning flow doesn't report — that flow @@ -1627,7 +1634,7 @@ export function arkFeature(ctx) { if (profile && (profile.lud16 || profile.lud06)) { await connectArk().catch(() => {}); if (!live()) return; - if (ctx.hook('canLnZap')) { ui.arkZap = null; ctx.hook('lnZapNpub', pk, npub, z.eventId, z.autoSat); return; } + if (ctx.hook('canLnZap')) { if (ui.arkZap === z) ui.arkZap = null; ctx.hook('lnZapNpub', pk, npub, z.eventId, z.autoSat); return; } } // 3. on-chain fallback if (onchain) { -- cgit v1.2.3