aboutsummaryrefslogtreecommitdiffstats
path: root/tools/feed-follow-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-11 22:55:15 -0700
committerAdam Soltys <[email protected]>2026-09-11 22:55:15 -0700
commitc4677d7c5d66afe6ac5c7eb277cf8c3b2e08e62a (patch)
tree0b6a7523f36fafe7d227dec48e18727ff1ad9937 /tools/feed-follow-test.js
parente9a0aa2ca4d3aa659b579295dd983decd3729b6f (diff)
downloadcoinosv3-c4677d7c5d66afe6ac5c7eb277cf8c3b2e08e62a.tar.gz
coinosv3-c4677d7c5d66afe6ac5c7eb277cf8c3b2e08e62a.zip
The feed opens at twenty posts and runs to the page's edge.
It was rendering everything it held — a hundred-odd notes to show the few you read. It now paints twenty, and reaching the bottom shows twenty more; only when the window catches up with what's cached does it go back to the relays for older posts. Posts arriving live at the top widen the window rather than pushing off the one you'd scrolled to. And the posts are the page now, not a card sitting inside one: they step out through the chat page's padding to the container's own edge, leaving one continuous list with hairlines between the posts instead of two sets of card walls. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_019mrt228Upn9nNCwGixzSLx
Diffstat (limited to 'tools/feed-follow-test.js')
-rw-r--r--tools/feed-follow-test.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/feed-follow-test.js b/tools/feed-follow-test.js
index 35fab2d..4c1fed3 100644
--- a/tools/feed-follow-test.js
+++ b/tools/feed-follow-test.js
@@ -99,6 +99,27 @@ try {
dialled.filter((u) => u.includes('example.invalid')).join(' ') || 'neither dialled');
check('...and our own relays are still asked as well',
dialled.some((u) => u.includes('relay.coinos.io')), dialled.length + ' sockets');
+
+ // The feed opens at twenty posts and grows as you reach the bottom, however
+ // many it is holding.
+ await page.evaluate((k) => {
+ const notes = [];
+ const now = Math.floor(Date.now() / 1000);
+ for (let i = 0; i < 60; i++) notes.push({ id: String(i).padStart(64, '0'), pubkey: 'f'.repeat(64), kind: 1, created_at: now - i * 60, content: 'post ' + i, tags: [] });
+ localStorage.setItem(k + ':feedNotes', JSON.stringify(notes));
+ }, base);
+ await page.reload({ waitUntil: 'domcontentloaded' });
+ await waitText('receive', 20000);
+ await page.evaluate(() => { const b = [...document.querySelectorAll('button')].find((e) => /message/i.test(e.getAttribute('aria-label') || '')); if (b) b.click(); });
+ await sleep(1000);
+ await clickItem('feed');
+ await sleep(1500);
+ const first = await page.evaluate(() => document.querySelectorAll('.notes-feed > .row').length);
+ check('the feed opens at twenty posts, not sixty', first === 20, first + ' rows');
+ await page.evaluate(() => window.scrollTo(0, document.documentElement.scrollHeight));
+ await sleep(1200);
+ const second = await page.evaluate(() => document.querySelectorAll('.notes-feed > .row').length);
+ check('reaching the bottom shows twenty more', second === 40, second + ' rows');
} finally { await browser.close(); server.stop(true); }
console.log(ok ? '\n✅ follows and feed' : '\n❌ failed');
process.exit(ok ? 0 : 1);