diff options
| author | Adam Soltys <[email protected]> | 2026-09-20 23:23:13 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-20 23:23:13 -0700 |
| commit | e27eaccee624d9bbc84ce4443d7cfba2db4fa15d (patch) | |
| tree | 49077a2c8d02057b69601345270540068824114f | |
| parent | 501da85c85e014eb48e6cd7df246875fadf27cb3 (diff) | |
| download | coinosv3-e27eaccee624d9bbc84ce4443d7cfba2db4fa15d.tar.gz coinosv3-e27eaccee624d9bbc84ce4443d7cfba2db4fa15d.zip | |
Feeds: a following.space link is read before any naddr in the pasted text; the test clears its field between searches.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
| -rw-r--r-- | src/features/messages.js | 10 | ||||
| -rw-r--r-- | tools/feed-custom-test.js | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 10828d9..beae756 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -3629,14 +3629,12 @@ export function messagesFeature(ctx) { // nostr:naddr — the pack it names. function parsePackLink(input) { const s = String(input || '').trim(); - const m = /naddr1[a-z0-9]+/i.exec(s); - if (m) { - const ref = parseNostrRef(m[0].toLowerCase()); - return ref && ref.type === 'addr' && ref.kind === PACK_KIND ? { pk: ref.pk, d: ref.d, relays: ref.relays || [] } : null; - } const link = /\/d\/([^/?#\s]+)[^?\s]*\?(?:[^#\s]*&)?p=([0-9a-f]{64})/i.exec(s); if (link) return { pk: link[2].toLowerCase(), d: decodeURIComponent(link[1]), relays: [] }; - return null; + const m = /naddr1[a-z0-9]+/i.exec(s); + if (!m) return null; + const ref = parseNostrRef(m[0].toLowerCase()); + return ref && ref.type === 'addr' && ref.kind === PACK_KIND ? { pk: ref.pk, d: ref.d, relays: ref.relays || [] } : null; } // Every pack the wide relays hold, once per session: the way to find one // by a few letters of its title — NIP-50 search only knows the packs the diff --git a/tools/feed-custom-test.js b/tools/feed-custom-test.js index 0fc7ab8..af2401f 100644 --- a/tools/feed-custom-test.js +++ b/tools/feed-custom-test.js @@ -74,7 +74,10 @@ page.on('pageerror', (e) => errs.push(String(e))); const click = (t) => page.evaluate((x) => { const e = [...document.querySelectorAll('button')].find((n) => n.textContent.trim().toLowerCase().includes(x)); if (e) { e.click(); return true; } return false; }, t); const waitText = async (x, ms = 25000) => { for (let i = 0; i < ms / 250; i++) { if ((await page.evaluate(() => document.body.innerText)).toLowerCase().includes(x)) return true; await sleep(250); } return false; }; const chips = () => page.evaluate(() => [...document.querySelectorAll('.feed-chip')].map((c) => (c.classList.contains('on') ? '*' : '') + c.textContent.trim())); -const type = async (sel, text) => { await page.click(sel, { clickCount: 3 }); await page.type(sel, text); }; +const type = async (sel, text) => { + await page.evaluate((q) => { const i = document.querySelector(q); i.value = ''; i.dispatchEvent(new Event('input', { bubbles: true })); }, sel); + await page.click(sel); await page.type(sel, text); +}; try { await page.setViewport({ width: 390, height: 844 }); |
