aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-12-05 06:19:34 -0700
committerAdam Soltys <[email protected]>2026-12-05 06:19:34 -0700
commit1e5c781b85d7cf9922914c57ddbaf9acfd075042 (patch)
treec005225f6248c54d4dad94410e8de711a57facda /tools
parent8249966d6f55b06c6f7a6340693b068a89058327 (diff)
downloadcoinosv3-1e5c781b85d7cf9922914c57ddbaf9acfd075042.tar.gz
coinosv3-1e5c781b85d7cf9922914c57ddbaf9acfd075042.zip
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6UBzkUjWrGu31fqD5d
Diffstat (limited to 'tools')
-rw-r--r--tools/link-preview-test.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/link-preview-test.js b/tools/link-preview-test.js
index 3b2aad3..2eeac7d 100644
--- a/tools/link-preview-test.js
+++ b/tools/link-preview-test.js
@@ -22,7 +22,7 @@ const POSTS = [
finalizeEvent({ kind: 1, created_at: now - 120, tags: [], content: 'film night https://paff.club/movie/1382-hackers-1995/play?q=1080p&t=4910' }, AUTHOR),
finalizeEvent({ kind: 1, created_at: now - 150, tags: [], content: 'on repeat https://paff.club/song/abc123' }, AUTHOR),
];
-const PROFILE = finalizeEvent({ kind: 0, created_at: now - 100, tags: [], content: JSON.stringify({ name: 'Linker', picture: 'http://localhost:5311/face.png' }) }, AUTHOR);
+const PROFILE = finalizeEvent({ kind: 0, created_at: now - 100, tags: [], content: JSON.stringify({ name: 'Linker', picture: 'http://localhost:5311/face.png', about: 'Read me at https://news.example/story/1 or https://paff.club/movie/1382-hackers-1995/play?q=1080p&t=4910' }) }, AUTHOR);
const html = await buildHtml({ minify: true, pwa: false });
const previewHits = [];
@@ -201,6 +201,15 @@ try {
for (let i = 0; i < 20; i++) { draft = await page.evaluate(() => { const p = document.querySelector('.draft-preview'); return p && { card: !!p.querySelector('.link-card'), title: p.querySelector('.link-title')?.textContent }; }); if (draft?.card) break; await sleep(250); }
check('a draft\'s preview shows the link as its card', opened && draft?.card && /Hackers/.test(draft.title || ''), JSON.stringify(draft));
check('...asked for once the typing settled, not per keystroke', previewHits.filter((u) => u.startsWith('https://movies.example')).length === 1, JSON.stringify(previewHits));
+ // a bio's links stay links (Adam, 2026-12-05: PAFF's bio painted two big cards)
+ await page.evaluate(() => document.querySelector('.draft-preview')?.closest('dialog, .modal')?.remove());
+ await page.evaluate(() => { const a = document.querySelector('.notes-feed > .row .note-avatar'); a.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true })); a.click(); });
+ await waitText('read me at', 10000);
+ const bio = await page.evaluate(() => {
+ const p = [...document.querySelectorAll('p')].find((n) => /read me at/i.test(n.textContent));
+ return p && { links: [...p.querySelectorAll('a')].map((a) => a.getAttribute('href')), card: !!p.querySelector('.link-card, .paff-embed, .paff-song') };
+ });
+ check('a bio shows its links as plain links, no cards', !!bio && !bio.card && bio.links.length === 2, JSON.stringify(bio));
check('no page errors', errs.length === 0, errs.slice(0, 2).join(' | '));
} finally { await browser.close(); server.stop(true); paffServer.stop(true); }
console.log(ok ? '\nāœ… links show as the cards their pages describe' : '\nāŒ failed');