From 7b7f2b5e8a6f2abc05fef94e0a8f6cb9dd0b9928 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 4 Aug 2026 01:46:59 -0700 Subject: The bio edits in a textarea, and only appears once on your own profile Co-Authored-By: Claude Fable 5 --- src/features/messages.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/features/messages.js b/src/features/messages.js index 3854f26..f9a2176 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -1046,10 +1046,11 @@ export function messagesFeature(ctx) { } const name = displayName(pk); const npub = npubOf(pk) || pk; - const field = (label, key, ph = '') => h('label', { class: 'field' }, + const field = (label, key, ph = '', multi = false) => h('label', { class: 'field' }, h('span', { class: 'lab' }, label), - h('input', { - type: 'text', placeholder: ph, value: ui.profEdit[key], + h(multi ? 'textarea' : 'input', { + ...(multi ? { rows: '4', style: 'font-family:var(--sans);min-height:72px' } : { 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 @@ -1072,7 +1073,8 @@ export function messagesFeature(ctx) { 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' })) - : showAbout ? h('p', { class: 'small', style: 'margin:0;white-space:pre-wrap' }, about.slice(0, 1000)) : null, + // the editor's About textarea IS the bio here — no static copy above it + : showAbout && !ui.profEdit ? 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', { @@ -1083,7 +1085,7 @@ export function messagesFeature(ctx) { ui.profEdit ? h('div', { class: 'col', style: 'gap:8px' }, field(t('profName'), 'name'), - field(t('profAbout'), 'about'), + field(t('profAbout'), 'about', '', true), field(t('profPicture'), 'picture', 'https://…'), h('button', { class: 'btn-primary btn-block', disabled: ui.profSaving, onClick: saveProfile }, ui.profSaving ? h('span', { class: 'spinner sm' }) : t('save'))) -- cgit v1.2.3