aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-10 08:58:02 -0700
committerAdam Soltys <[email protected]>2026-10-10 08:58:02 -0700
commit0262af2885831f67b7025fff84d4987fed4857c6 (patch)
tree3c0692f3ead19a5e2a5972dbc3525fc5844f375f /src/features
parentb530a7015ef6a1126350a9a30cb49dba7cb3f114 (diff)
downloadcoinosv3-0262af2885831f67b7025fff84d4987fed4857c6.tar.gz
coinosv3-0262af2885831f67b7025fff84d4987fed4857c6.zip
Feed: a mention opens the person, not the post. A tap on @name in a feed post opened their profile and then reached the row, which opened the post's thread on top — Adam had to tap the mention again from inside the thread. The mention stops its tap, and a post's row no longer opens its thread for a tap on any link in it (a mention, a URL, a #tag). tools/feed-mention-tap-test.js (on the old code the tap landed on /nevent1…).
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Vps2H27rhbG9ZqseGfMrc3
Diffstat (limited to 'src/features')
-rw-r--r--src/features/messages.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index 35f4712..0a14b9c 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -8225,7 +8225,7 @@ export function messagesFeature(ctx) {
} else if (/^(nostr:|@?)(npub|nprofile)1/i.test(part)) {
const bare = part.replace(/^(nostr:|@)/i, '');
const ref = parseNostrRef(bare);
- if (ref && ref.type === 'pubkey') out.push(h('a', { href: '#', onClick: (e) => { e.preventDefault(); openProfile(ref.pk); } }, '@' + displayName(ref.pk)));
+ if (ref && ref.type === 'pubkey') out.push(h('a', { href: '#', onClick: (e) => { e.preventDefault(); e.stopPropagation(); openProfile(ref.pk); } }, '@' + displayName(ref.pk)));
else out.push(h('span', { class: 'faint' }, bare.slice(0, 12) + '…'));
} else if (/^nostr:(note|nevent)1/i.test(part)) {
const ref = parseNostrRef(part.slice(6));
@@ -9623,7 +9623,9 @@ export function messagesFeature(ctx) {
+ (focus ? ';background:var(--accent-soft,rgba(128,128,128,.08));border-radius:' + (joined ? '8px 8px 0 0' : '8px') + ';padding-left:8px;padding-right:8px;margin:0 -8px' : ''),
// closest('button') guard: on touch, a ⚡ tap must never double as a
// row tap even if propagation quirks let the click reach us
- onClick: openable ? (e) => { if (e.target && e.target.closest && e.target.closest('button')) return; openNoteThread(ev); } : undefined,
+ // nor a link in it: a mention opens the person, a URL its page — the
+ // thread opening underneath as well buried the profile under the post
+ onClick: openable ? (e) => { if (e.target && e.target.closest && e.target.closest('button, a')) return; openNoteThread(ev); } : undefined,
},
// the avatar is its own tap-target (profile), even inside an openable
// row — its handler stops propagation, so the row still opens the thread