From d45c2f2e5a3a7c7e50b701a82c15866a8dc96811 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 15 Aug 2026 12:53:23 -0700 Subject: The social layer grows up: a header magnifier finds anyone on nostr, ⚡ zaps your saved amount in one tap (asking once if you haven't picked one), and tapping a note opens its thread 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_014tE4U5nEjGTQy8PwYqamfv --- src/app.js | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/app.js') diff --git a/src/app.js b/src/app.js index 4e46f30..babd095 100644 --- a/src/app.js +++ b/src/app.js @@ -1644,13 +1644,31 @@ function messagesBtn() { class: 'header-msgs' + (unread ? ' unread' : ''), title: t('msgDmsTitle'), 'aria-label': t('msgDmsTitle'), - onClick: () => { ui.profilePk = null; ui.chatOpen = true; ui.msgView = 'home'; render(); }, + onClick: () => { ui.profilePk = null; ui.userSearch = null; ui.noteThread = null; ui.zapSetup = null; ui.chatOpen = true; ui.msgView = 'home'; render(); }, }, h('span', { class: 'hm-ico', html: '', })); } +// Find anyone on nostr from the header — results open their profile. +function searchBtn() { + if (!featureHook('userSearchAvailable')) return null; + return h('button', { + class: 'header-msgs', + title: t('searchUsers'), + 'aria-label': t('searchUsers'), + onClick: () => { + featureHook('openUserSearch'); + render(); + setTimeout(() => document.querySelector('.user-search-input')?.focus(), 60); + }, + }, h('span', { + class: 'hm-ico', + html: '', + })); +} + function brandHeader(withLock) { const acc = activeAccount(); return h( @@ -1663,6 +1681,7 @@ function brandHeader(withLock) { ), withLock ? h('div', { class: 'row gap6', style: 'align-items:center' }, + searchBtn(), messagesBtn(), h('button', { class: 'btn-sm', onClick: () => { ui.screen = 'accounts'; render(); } }, acc ? acc.label : t('accounts')), @@ -1928,6 +1947,9 @@ function goHome() { ui.chatOpen = false; ui.profilePk = null; ui.profEdit = null; + ui.userSearch = null; + ui.noteThread = null; + ui.zapSetup = null; ui.arkExitPage = null; ui.settingsPage = null; ui.addrScan = false; @@ -3773,6 +3795,14 @@ async function importSnapshotFile(e) { const ctx = { h, ui, render, wallet, toast, copy, copyBtn, pasteBtn, blankSend, goBack, goHome, openExternal, fmtAmount, unitLabel, unitTag, parseAmount, getUnit: () => unit, toggleUnit, download, + // the one-tap zap amount, synced across devices with the rest of the state + zapDefaultSat: () => (wallet.loadFeatureState ? (wallet.loadFeatureState('prefs', {}).zapSat || 0) : 0), + setZapDefaultSat: (n) => { + const p = wallet.loadFeatureState('prefs', {}); + p.zapSat = Math.max(1, Math.floor(n) || 0); + wallet.saveFeatureState('prefs', p); + try { wallet.saveCache(); } catch {} + }, brandHeader, activeAccount, setAccounts: (list) => { accounts = list; }, getAccounts: () => accounts, claimTargets, enterWallet, activateAccount, commitAccount, -- cgit v1.2.3