aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-02 18:56:04 -0700
committerAdam Soltys <[email protected]>2026-09-02 18:56:04 -0700
commitc4357ab5563aacc3614bfaf8f54cfb5c79a7f1ba (patch)
tree242d39680e551d034fae6576a8ddc7c8f67cb12e /src/app.js
parentd5e590e655c989cb855328e28349df2129adcd18 (diff)
downloadcoinosv3-c4357ab5563aacc3614bfaf8f54cfb5c79a7f1ba.tar.gz
coinosv3-c4357ab5563aacc3614bfaf8f54cfb5c79a7f1ba.zip
Recipient search warms its pipes on focus, not first keystroke: the Primal cache socket, the registrar's TLS session, and the NIP-50 relay connections each cost a handshake that used to land on the first query — the cold second of dead air. Touching the send recipient field, opening user search, or unfolding New message now pre-opens all three (throttled; the idle reaper still closes the socket a minute after real use)
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/app.js b/src/app.js
index a818d67..da724dc 100644
--- a/src/app.js
+++ b/src/app.js
@@ -6,7 +6,7 @@
import { Wallet, newMnemonic, isValidMnemonic, accountXpubFor, cacheKeyFor, utxoId, parseExtendedKey, xpubToZpub, encryptVault, decryptVault } from './wallet.js';
import { qrSvg } from './qr.js';
-import { makeSearcher, resultRows, searchable, punkUrl } from './recipient-search.js';
+import { makeSearcher, resultRows, searchable, punkUrl, warmSearch } from './recipient-search.js';
import { npubOf } from './nostr.js';
import { nip98Header } from './nip98.js';
import { NOSTR_MARK } from './features/nostrlogin.js';
@@ -3870,8 +3870,10 @@ function recipientRow(s, r, i) {
type: 'text', class: 'mono-input grow', placeholder: i === 0 ? t('destPlaceholder') : 'bc1q…',
autocapitalize: 'none', autocomplete: 'off', spellcheck: 'false', value: r.address,
// the delay lets the keyboard start opening (and any render() swap of
- // this input) before parkSendField measures the live activeElement
- onFocus: () => setTimeout(parkSendField, 300),
+ // this input) before parkSendField measures the live activeElement.
+ // warmSearch pre-opens the search transports so the first keystroke's
+ // results don't pay three cold handshakes.
+ onFocus: () => { warmSearch(); setTimeout(parkSendField, 300); },
onInput: (e) => {
const v = e.target.value;
r.address = v; syncCheck();