aboutsummaryrefslogtreecommitdiffstats
path: root/src/recipient-search.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-03 07:48:31 -0700
committerAdam Soltys <[email protected]>2026-08-03 07:48:31 -0700
commit51e0a583ca29019bced1e4e6349afd1c7572a988 (patch)
tree6408a352c9a8109ff6cfd2a69a4e6a9ef53cc37f /src/recipient-search.js
parent161adb250e4273d0bcaa160516bc950f5f46310f (diff)
downloadcoinosv3-51e0a583ca29019bced1e4e6349afd1c7572a988.tar.gz
coinosv3-51e0a583ca29019bced1e4e6349afd1c7572a988.zip
Zap screens show the recipient, cap amounts to Spending, faster search
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi
Diffstat (limited to 'src/recipient-search.js')
-rw-r--r--src/recipient-search.js9
1 files changed, 7 insertions, 2 deletions
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); },
};