aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
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/features
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/features')
-rw-r--r--src/features/messages.js5
1 files changed, 3 insertions, 2 deletions
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