From 51e0a583ca29019bced1e4e6349afd1c7572a988 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 3 Aug 2026 07:48:31 -0700 Subject: Zap screens show the recipient, cap amounts to Spending, faster search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The zap flows (ark-direct and Lightning) show the recipient's avatar chip instead of a bare name, and their LNURL ceiling is now capped by our own Spending balance โ€” when Spending can't cover their minimum the amount field is replaced by a plain "not enough in Spending" notice rather than an impossible "min 1 ยท max 0" range. The confirm path enforces the same cap. Recipient search feels instant now: the first short query fires after 120ms (the wait users actually notice) and longer mid-word queries wait 500ms to skip characters still being typed; cached prefixes stay instant. Onboarding success screen: check below the title and larger. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi --- src/recipient-search.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/recipient-search.js') diff --git a/src/recipient-search.js b/src/recipient-search.js index 553673e..b8a17ea 100644 --- a/src/recipient-search.js +++ b/src/recipient-search.js @@ -140,11 +140,16 @@ export function makeSearcher(onUpdate) { clearTimeout(timer); const my = ++seq; if (!searchable(q)) { onUpdate(q, null); return; } - const cached = queryCache.has(q.trim().toLowerCase()); + const s = q.trim().toLowerCase(); + // Get something on screen fast, then relax: the first short query fires + // almost immediately (that's the wait the user actually feels), while + // longer ones โ€” mid-word keystrokes โ€” wait long enough to skip the + // characters still being typed. Cached prefixes are instant. + const wait = queryCache.has(s) ? 0 : s.length <= 3 ? 120 : 500; timer = setTimeout(async () => { const rows = await searchRecipients(q).catch(() => []); if (my === seq) onUpdate(q, rows); - }, cached ? 0 : 300); + }, wait); }, clear() { seq++; clearTimeout(timer); onUpdate('', null); }, }; -- cgit v1.2.3