From b5b38eef005dab031d75804d96c8de2c1694764a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 3 Aug 2026 09:13:17 -0700 Subject: Profile page: hide machine-noise fields, real Back button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An npub-shaped lightning address (npub1…@npub.cash) duplicated the npub box below it and overflowed the card — it's hidden now, as is a lud16 identical to the nip05. A one-character "about" (fiatjaf's is literally "~") is noise rather than a bio, so it's skipped. Both remaining identity lines wrap. The inline ‹ chevron becomes a full-width Back button under the actions, matching every other page. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi --- src/features/messages.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/features/messages.js b/src/features/messages.js index 46f7399..41a961d 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -930,19 +930,27 @@ export function messagesFeature(ctx) { type: 'text', placeholder: ph, value: ui.profEdit[key], onInput: (ev) => { ui.profEdit[key] = ev.target.value; }, })); + // A lightning address worth showing: not an npub-shaped machine address + // (npub1…@some.relay duplicates the npub below) and not the same string + // as the nip05 already on screen. + const nip05 = full && full.nip05 ? String(full.nip05).replace(/^_@/, '') : null; + const lud16 = full && full.lud16 ? String(full.lud16) : null; + const showLud = lud16 && !/^npub1/i.test(lud16) && lud16 !== nip05; + // an about of "~" or a lone character is noise, not a bio + const about = full && typeof full.about === 'string' ? full.about.trim() : ''; + const showAbout = about.length > 1; return h('div', { class: 'col', style: 'gap:16px' }, ctx.brandHeader(false), h('div', { class: 'card col', style: 'gap:12px' }, h('div', { class: 'row gap6', style: 'align-items:center' }, - backBtn(() => { ui.profilePk = null; ui.profEdit = null; render(); }), avatar(pk, 'chat-avatar profile-avatar', false), h('div', { class: 'col grow', style: 'min-width:0;gap:2px' }, h('div', { class: 'chat-title' }, name), - full && full.nip05 ? h('div', { class: 'muted small' }, String(full.nip05).replace(/^_@/, '')) : null, - full && full.lud16 ? h('div', { class: 'muted small' }, '⚡ ' + full.lud16) : null)), + nip05 ? h('div', { class: 'muted small break' }, nip05) : null, + showLud ? h('div', { class: 'muted small break' }, '⚡ ' + lud16) : null)), full === undefined ? h('div', { class: 'row gap6', style: 'align-items:center' }, h('span', { class: 'spinner sm' })) - : full.about ? h('p', { class: 'small', style: 'margin:0;white-space:pre-wrap' }, String(full.about).slice(0, 1000)) : null, + : showAbout ? h('p', { class: 'small', style: 'margin:0;white-space:pre-wrap' }, about.slice(0, 1000)) : null, h('div', { class: 'addr-box break npub-box', style: 'font-size:11px' }, h('span', { class: 'grow', style: 'min-width:0' }, npub), h('button', { @@ -977,7 +985,8 @@ export function messagesFeature(ctx) { ui.tab = 'send'; render(); hook('matchSendText', npubStr); - } }, t('profPay'))))); + } }, t('profPay')))), + h('button', { class: 'btn-ghost btn-block', onClick: () => { ui.profilePk = null; ui.profEdit = null; render(); } }, t('back'))); } const backBtn = (onClick) => h('button', { class: 'iconbtn chat-back', onClick }, '‹'); -- cgit v1.2.3