From 16ee8bff43e8733848ef1b944b9d9312ce4ec223 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 15 Aug 2026 14:18:48 -0700 Subject: The header speaks in icons: gear for settings, padlock to lock, and the avatar goes straight to your profile — the popup menu retires 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 | 53 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/app.js b/src/app.js index 6c30c34..583a488 100644 --- a/src/app.js +++ b/src/app.js @@ -1627,33 +1627,44 @@ function lock({ offerPassword = false } = {}) { } // ================================================================ WALLET -// The avatar anchors the identity menu: Edit profile, Settings, Messages, -// Logout. The avatar node itself comes from the messages feature (profile -// cache + punk fallback); without that feature there's no menu. +// The avatar IS your profile now — one tap opens it (edit lives there). +// Settings and Lock stand beside it as their own icons; no popup menu. function avatarMenu() { const me = (featureHook('nostrLoginIdentity') || {}).pubkey || (wallet.nostrPubkey && wallet.nostrPubkey()); - // No identity (watch-only wallet): the menu still exists — Settings and - // Logout don't need keys — behind a neutral face. + // No identity (watch-only wallet): a neutral face with nowhere to go. const node = (me && featureHook('headerAvatar', me)) || h('span', { class: 'chat-avatar header-ava fallback', html: '', }); - const item = (label, fn) => h('button', { - class: 'icon-select-item', - onClick: () => { ui.avatarMenu = false; fn(); render(); }, - }, label); - return h('span', { class: 'avatar-menu-wrap' }, - h('button', { class: 'header-avatar', onClick: () => { ui.avatarMenu = !ui.avatarMenu; render(); } }, node), - (() => { const dt = animWindow('avmenu', !!ui.avatarMenu, 220); return ui.avatarMenu - ? h('span', {}, - h('div', { class: 'menu-backdrop', onClick: () => { ui.avatarMenu = false; render(); } }), - (() => { const m = h('div', { class: 'icon-select-menu avatar-menu' }, - me ? item(t('profEdit'), () => featureHook('showProfile', me)) : null, - item(t('tabSettings'), () => { ui.chatOpen = false; ui.profilePk = null; ui.screen = 'wallet'; ui.tab = 'settings'; ui.settingsPage = null; }), - me ? item(t('msgDmsTitle'), () => { ui.profilePk = null; ui.chatOpen = true; }) : null, - item(t('lockWallet'), () => lock({ offerPassword: true }))); applyAnim(m, 'anim-menu', dt); return m; })()) - : null; })()); + return h('button', { + class: 'header-avatar', + title: me ? t('profEdit') : undefined, + onClick: me ? () => { featureHook('showProfile', me); render(); } : undefined, + }, node); +} + +function settingsBtn() { + return h('button', { + class: 'header-msgs', title: t('tabSettings'), 'aria-label': t('tabSettings'), + onClick: () => { + ui.chatOpen = false; ui.profilePk = null; ui.userSearch = null; ui.noteThread = null; + ui.screen = 'wallet'; ui.tab = 'settings'; ui.settingsPage = null; render(); + }, + }, h('span', { + class: 'hm-ico', + html: '', + })); +} + +function lockBtn() { + return h('button', { + class: 'header-msgs', title: t('lockWallet'), 'aria-label': t('lockWallet'), + onClick: () => lock({ offerPassword: true }), + }, h('span', { + class: 'hm-ico', + html: '', + })); } // Messages sit one tap away, left of the wallet selector. The dot is presence, @@ -1705,6 +1716,8 @@ function brandHeader(withLock) { ? h('div', { class: 'row gap6', style: 'align-items:center' }, searchBtn(), messagesBtn(), + settingsBtn(), + lockBtn(), h('button', { class: 'btn-sm', onClick: () => { ui.screen = 'accounts'; render(); } }, acc ? acc.label : t('accounts')), avatarMenu()) -- cgit v1.2.3