From 5a9deb5688ee560c2b020582d43dddbed0cda873 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 17 Aug 2026 23:48:59 -0700 Subject: Typed names take the instant rail too: a Send button outranks the Zap for our domains, resolving to the ark address instead of an LNURL round-trip that needs the recipient awake Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz --- src/features/names.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/features') diff --git a/src/features/names.js b/src/features/names.js index 69987e3..73e34de 100644 --- a/src/features/names.js +++ b/src/features/names.js @@ -593,10 +593,24 @@ export function namesFeature(ctx) { // instead of leaving a picked name looking ignored. sendFormNote(a) { const nr = ui.nameResolve; - if (!nr || nr.text !== a) return null; - return h('div', { class: 'row gap6', style: 'align-items:center;justify-content:center' }, - h('span', { class: 'spinner sm' }), - h('span', { class: 'small muted' }, t('namesResolving', { name: String(a || '').trim() }))); + if (nr && nr.text === a) { + return h('div', { class: 'row gap6', style: 'align-items:center;justify-content:center' }, + h('span', { class: 'spinner sm' }), + h('span', { class: 'small muted' }, t('namesResolving', { name: String(a || '').trim() }))); + } + // A TYPED name on one of our domains: offer the native send (BIP-353 → + // instant ark) as a button, mirroring the zap affordance — typed input + // never auto-advances, since a half-typed domain parses as a name too. + // This note outranks the zaps one (feature order), so our names get the + // free instant rail instead of an LNURL round-trip. + const parsed = parsePaymentName(a); + if (parsed && OUR_DOMAINS.includes(parsed.domain) && hook('arkReady')) { + return h('button', { + type: 'button', class: 'btn-primary btn-block', + onClick: () => beginResolve(a), + }, t('namesSendTo', { name: `${parsed.name}@${parsed.domain}` })); + } + return null; }, settingsCards() { return [namesCard()]; }, }; -- cgit v1.2.3