From 1e5c781b85d7cf9922914c57ddbaf9acfd075042 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 5 Dec 2026 06:19:34 -0700 Subject: A bio's links stay plain links: no page cards or PAFF players in a profile header. "let's not render site previews in bios" (Adam, 2026-12-05, PAFF's profile showed two big paff.club cards). The bio renders through noteBody with bare links (bareLinkBody); notes are untouched. link-preview-test gains a bio check (fails without the fix); profile-open-test and features-smoke-test pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VMan6UBzkUjWrGu31fqD5d --- src/features/messages.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/features/messages.js') diff --git a/src/features/messages.js b/src/features/messages.js index 952350f..dbbe05e 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -11047,6 +11047,9 @@ export function messagesFeature(ctx) { const x = e.clientX - (r.left + (r.width - w) / 2), y = e.clientY - (r.top + (r.height - hh) / 2); return x >= 0 && x <= w && y >= 0 && y <= hh; } + // A bio's links stay links: no page cards or PAFF players in a profile header. + let bareLinks = false; + const bareLinkBody = (text) => { bareLinks = true; try { return noteBody(text); } finally { bareLinks = false; } }; function urlNode(url, { label = null, isImage = false, shown: written = null } = {}) { if (isVideoUrl(url)) { return videoNode(url, { stable: !!feedPaint }); @@ -11081,7 +11084,7 @@ export function messagesFeature(ctx) { }); } if (youtubeId(url)) return youtubeEmbed(url, youtubeId(url)); - if (!label && paffMusicUrl(url)) { + if (!label && !bareLinks && paffMusicUrl(url)) { let pv = previews.get(url) || null; if (feedPaint) { if (!feedPaint.media.has('pv:' + url)) feedPaint.media.set('pv:' + url, pv); @@ -11089,7 +11092,7 @@ export function messagesFeature(ctx) { } return paffSongCard(url, pv); } - if (!label && paffEmbedUrl(url)) { + if (!label && !bareLinks && paffEmbedUrl(url)) { let pv = previews.get(url) || null; if (feedPaint) { if (!feedPaint.media.has('pv:' + url)) feedPaint.media.set('pv:' + url, pv); @@ -11097,7 +11100,7 @@ export function messagesFeature(ctx) { } return paffEmbed(url, pv); } - if (!label && previewable(url)) { + if (!label && !bareLinks && previewable(url)) { // a frozen feed row keeps the card (or the bare link) it first painted let pv = previews.get(url) || null; if (feedPaint) { @@ -14228,7 +14231,7 @@ export function messagesFeature(ctx) { // in a bio was punching clean through the card). showAbout && !ui.profEdit ? h('p', { class: 'small', style: 'margin:0;white-space:pre-wrap;overflow-wrap:anywhere' }, - ...noteBody(about.slice(0, 1000))) + ...bareLinkBody(about.slice(0, 1000))) : null, ui.profEdit ? null : socialLine(pk), ui.profEdit ? null : socialList(pk), -- cgit v1.2.3