From c4357ab5563aacc3614bfaf8f54cfb5c79a7f1ba Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 2 Sep 2026 18:56:04 -0700 Subject: 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) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr --- src/features/messages.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/features/messages.js') diff --git a/src/features/messages.js b/src/features/messages.js index ce1975e..3f494e4 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -24,7 +24,7 @@ import { } from '../concord.js'; import { makeDMRumor, unwrapDM, wrapDM } from '../dm.js'; import { saveInbox } from '../dm-inbox.js'; -import { makeSearcher, resultRows, fallbackAvatar } from '../recipient-search.js'; +import { makeSearcher, resultRows, fallbackAvatar, warmSearch } from '../recipient-search.js'; import { getNetwork } from '../api.js'; import { hexToBytes, bytesToHex } from '@noble/hashes/utils'; import { t } from '../i18n.js'; @@ -2299,7 +2299,7 @@ export function messagesFeature(ctx) { // ---- DMs kids.push(h('div', { class: 'row between', style: 'align-items:baseline' }, h('h3', { style: 'margin:0' }, t('msgDmsTitle')), - h('button', { class: 'btn-sm', onClick: () => { ui.msgHomePanel = ui.msgHomePanel === 'newdm' ? null : 'newdm'; render(); } }, t('msgNewDm')))); + h('button', { class: 'btn-sm', onClick: () => { ui.msgHomePanel = ui.msgHomePanel === 'newdm' ? null : 'newdm'; if (ui.msgHomePanel === 'newdm') warmSearch(); render(); } }, t('msgNewDm')))); if (ui.msgHomePanel === 'newdm') { const openThread = (pk) => { dmSearcher.clear(); @@ -2750,6 +2750,7 @@ export function messagesFeature(ctx) { ui.chatOpen = false; ui.profilePk = null; ui.userSearch = { q: '', rows: null }; + warmSearch(); // the field is about to be typed into — open the pipes return true; }, // nostr-login just connected or resumed a signer: wraps the backfill -- cgit v1.2.3