aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/messages.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-03 09:13:17 -0700
committerAdam Soltys <[email protected]>2026-08-03 09:13:17 -0700
commitb5b38eef005dab031d75804d96c8de2c1694764a (patch)
treed035e75ae814402eb6af886c5c38efa78c7a0757 /src/features/messages.js
parent5eca02f4ae20018fe050b36519fcc5a2d7c4c674 (diff)
downloadcoinosv3-b5b38eef005dab031d75804d96c8de2c1694764a.tar.gz
coinosv3-b5b38eef005dab031d75804d96c8de2c1694764a.zip
Profile page: hide machine-noise fields, real Back button
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi
Diffstat (limited to 'src/features/messages.js')
-rw-r--r--src/features/messages.js19
1 files changed, 14 insertions, 5 deletions
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 }, '‹');