From 49da2555e84da4a461c070c0d7bb7032c6bb52e4 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 31 Jul 2026 08:31:55 -0700 Subject: Re-render the send form when a destination annotation appears MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The lightning-address zap button is computed at render time, but onInput only re-rendered when on-chain validity flipped — an lnaddr never does, so the button never appeared. Track sendFormNote presence like readiness and re-render on a flip. Verified with a headless-browser check. Co-Authored-By: Claude Fable 5 --- src/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/app.js') diff --git a/src/app.js b/src/app.js index 5aa1316..8eda874 100644 --- a/src/app.js +++ b/src/app.js @@ -2408,6 +2408,9 @@ function recipientRow(s, r, i) { const single = s.recipients.length === 1; const maxOn = single && s.max; r._ready = destReady(r.address); // reflected each render; onInput re-renders on a flip + // same idea for destination annotations (e.g. the lightning-address zap + // button): they only exist in the rendered tree, so a flip must re-render + r._note = !!featureHook('sendFormNote', r.address); // Updated imperatively on input (and on render) so paste, typing, and scan // all reflect immediately without disrupting the input's focus/cursor. @@ -2431,8 +2434,9 @@ function recipientRow(s, r, i) { const hadError = !!ui.sendError; ui.sendError = ''; // editing the destination starts over — drop stale errors if (tryFeature(v, true)) return; // a bolt11 advances to its own confirmation - // reveal/hide amount + controls as validity flips (or an error clears) - if (hadError || destReady(v) !== r._ready) render(); + // reveal/hide amount + controls as validity flips, an annotation + // (zap button) appears/disappears, or an error clears + if (hadError || destReady(v) !== r._ready || !!featureHook('sendFormNote', v) !== r._note) render(); }, }); const row = h( -- cgit v1.2.3