diff options
| author | Adam Soltys <[email protected]> | 2026-09-02 18:56:04 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-02 18:56:04 -0700 |
| commit | c4357ab5563aacc3614bfaf8f54cfb5c79a7f1ba (patch) | |
| tree | 242d39680e551d034fae6576a8ddc7c8f67cb12e /src/app.js | |
| parent | d5e590e655c989cb855328e28349df2129adcd18 (diff) | |
| download | coinosv3-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.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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(); |
