diff options
| author | Adam Soltys <[email protected]> | 2026-11-14 22:03:23 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-11-14 22:03:23 -0700 |
| commit | 933e85020c2cc56b511ff47a73943c92ea1d044a (patch) | |
| tree | e12f9ffd835cd9c1fc9bffa81b76f910e194be80 /tools/profile-stream-test.js | |
| parent | 065d1b96afa32781f1a0805e0b4a02d32bf883ee (diff) | |
| download | coinosv3-933e85020c2cc56b511ff47a73943c92ea1d044a.tar.gz coinosv3-933e85020c2cc56b511ff47a73943c92ea1d044a.zip | |
Search inside someone's posts: their profile puts them in the search field, and "franca wildwood" is understood. "i found him by searching franca but then i was wanting some way to search his feed for something … i was wanting to search 'franca wildwood' but knew it wouldn't work … we couldn't just have a clever way of guessing what the user is trying to do?" (Adam, 2026-11-14). No second field: on a profile the header field (and the phone's search page opened from a profile) carries the person as a chip, "Search their posts, or anyone…"; Enter searches only their posts, people still show below for picking someone else, and × or Backspace on the empty field searches everywhere again. Words that begin or end with someone's name (first/last one or two words, matched at the start of a word of their name or address) are offered as "“wildwood” in Franca Yibisi's posts" at the top of the results; when that's someone you follow or whose profile you opened this session, it's the Enter choice (↵), otherwise only a row ("bitcoin wallet" is not Bitcoin Magazine's posts), and never when the whole query is someone's name. The search is a feed like any text search, /feed?q=wildwood&p=npub…: the NIP-50 relays asked with the author, plus the author's own recent posts (home, archive and their own relays, up to four pages of 400 until ten match) checked here word by word, since few people are in a search index; what their profile already loaded shows at once. tools/search-scope-test.js (real relays): chip on fiatjaf's profile, "relay" → only his posts, every one saying it; "fiatjaf relay" guessed and taken by Enter; × and Backspace; phone width. profile-stream, post-search, search-avatar-loading and features-smoke pass
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VMan6UKGJyuGyZFxddYRxS
Diffstat (limited to 'tools/profile-stream-test.js')
| -rw-r--r-- | tools/profile-stream-test.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/profile-stream-test.js b/tools/profile-stream-test.js index b7dfb9b..2b426bb 100644 --- a/tools/profile-stream-test.js +++ b/tools/profile-stream-test.js @@ -27,7 +27,7 @@ try { await page.waitForSelector('.user-search-main', { timeout: 10000 }); await page.type('.user-search-main', Q, { delay: 60 }); // the result rows: people (not the "posts that say this" or #topic rows) - const rows = () => page.evaluate(() => [...document.querySelectorAll('.list .item')].filter((r) => !/^[\u{1F50D}#]/u.test(r.textContent.trim())).map((r) => r.textContent.trim().slice(0, 40))); + const rows = () => page.evaluate(() => [...document.querySelectorAll('.list .item:not(.search-scoped-row)')].filter((r) => !/^[\u{1F50D}#]/u.test(r.textContent.trim())).map((r) => r.textContent.trim().slice(0, 40))); let found = []; for (let i = 0; i < 60 && !found.length; i++) { found = await rows(); if (!found.length) await sleep(250); } if (!found.length) console.log(await page.evaluate(() => document.querySelector('.user-search-main')?.closest('.col')?.parentElement?.innerHTML.slice(0, 1500))); @@ -35,7 +35,7 @@ try { const wait = Number(process.env.WAIT || 0); // ms between results and the tap (prefetch's head start) if (wait) await sleep(wait); const t0 = Date.now(); - await page.evaluate(() => [...document.querySelectorAll('.list .item')].filter((r) => !/^[\u{1F50D}#]/u.test(r.textContent.trim()))[0].click()); + await page.evaluate(() => [...document.querySelectorAll('.list .item:not(.search-scoped-row)')].filter((r) => !/^[\u{1F50D}#]/u.test(r.textContent.trim()))[0].click()); let ghostAt = 0, firstAt = 0, rowsAt3 = 0; for (let i = 0; i < 200; i++) { const s = await page.evaluate(() => ({ @@ -57,10 +57,10 @@ try { // Adam 2026-11-14 — they updated a page hidden under the profile) await page.setViewport({ width: 1300, height: 900 }); await sleep(500); - const field = await page.$('.header-search'); + const field = await page.$('input.header-search, .header-search-field'); check('the desktop header has a search field', !!field); if (field) { - await page.evaluate(() => { const f = document.querySelector('.header-search'); f.focus(); f.value = ''; }); + await page.evaluate(() => { const f = document.querySelector('input.header-search, .header-search-field'); f.focus(); f.value = ''; }); await field.type('jack', { delay: 60 }); let again = []; for (let i = 0; i < 80 && !(again.length && again[0] !== found[0]); i++) { again = await rows(); if (!(again.length && again[0] !== found[0])) await sleep(250); } |
