From 0712c1474b24a858a4650422319fbc9dc8d5427a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 2 Aug 2026 19:47:39 -0700 Subject: Profile: copy icon inside the npub box instead of a "Copy key" button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An npub isn't a key — no button, no label; just a small copy glyph right-aligned in the box. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi --- src/features/messages.js | 11 ++++++++--- src/style.css | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/features/messages.js b/src/features/messages.js index f95c8c7..d74c338 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -48,7 +48,7 @@ const APP_BASE = 'https://v3.coinos.io'; const CACHE_MAX = 50; // messages kept per channel / per DM thread in feature state export function messagesFeature(ctx) { - const { h, ui, render, wallet, toast, hook, copyBtn } = ctx; + const { h, ui, render, wallet, toast, hook } = ctx; // ---- persisted state ---------------------------------------------------- @@ -864,8 +864,13 @@ export function messagesFeature(ctx) { 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, - h('div', { class: 'addr-box break', style: 'font-size:11px' }, npub), - copyBtn(npub, t('copyKey')), + h('div', { class: 'addr-box break npub-box', style: 'font-size:11px' }, + h('span', { class: 'grow', style: 'min-width:0' }, npub), + h('button', { + class: 'copy-ico', title: t('copy'), + onClick: async () => { try { await navigator.clipboard.writeText(npub); toast(t('copied')); } catch {} }, + html: '', + })), ui.profEdit ? h('div', { class: 'col', style: 'gap:8px' }, field(t('profName'), 'name'), diff --git a/src/style.css b/src/style.css index 2323635..90bb257 100644 --- a/src/style.css +++ b/src/style.css @@ -395,3 +395,6 @@ hr.divider { margin: 16px 0; } .chat-avatar.fallback .punk { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; } .header-avatar { padding: 0; border: none; background: none; cursor: pointer; display: flex; } .chat-avatar.header-ava { width: 30px; height: 30px; font-size: 11px; } +.npub-box { display: flex; align-items: center; gap: 8px; } +.copy-ico { flex-shrink: 0; background: none; border: none; padding: 2px; color: var(--muted); cursor: pointer; display: flex; } +.copy-ico:hover { color: var(--ink); } -- cgit v1.2.3