aboutsummaryrefslogtreecommitdiffstats
path: root/tools/feed-streaming-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-01 22:38:55 -0700
committerAdam Soltys <[email protected]>2026-10-01 22:38:55 -0700
commit94b5a7cf832f7da07c18e9eee10f845799b9b657 (patch)
treedf8e71f98bcb19b37295f519ab04b31b220cb0c4 /tools/feed-streaming-test.js
parent4e3def3db32630ecd59d6b40c2436068708fe54b (diff)
downloadcoinosv3-94b5a7cf832f7da07c18e9eee10f845799b9b657.tar.gz
coinosv3-94b5a7cf832f7da07c18e9eee10f845799b9b657.zip
New posts go in above the first post at the top of the feed
Arrivals used to wait behind the pill whenever the feed header was on screen. They now go in above the first post with that post held where it is, so the page grows upward and can be scrolled to before tapping the pill. While the composer or another header field is in use they still wait. The pill clears only when the reader scrolls up to the newest post, not on the hold's own downward correction. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'tools/feed-streaming-test.js')
-rw-r--r--tools/feed-streaming-test.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/feed-streaming-test.js b/tools/feed-streaming-test.js
index 4295243..e662b42 100644
--- a/tools/feed-streaming-test.js
+++ b/tools/feed-streaming-test.js
@@ -136,13 +136,15 @@ try {
await page.close();
page = await visit();
- const headerTop = await page.$eval('.chat-page > .row', (r) => r.getBoundingClientRect().top);
+ const firstKey = await page.$eval('.notes-feed > .row[data-key]', (r) => r.getAttribute('data-key'));
+ const firstTop = await page.$eval(row(firstKey), (r) => r.getBoundingClientRect().top);
await page.evaluate((evs) => window.deliver(evs), [fast, later]);
await page.waitForFunction(() => document.querySelector('.feed-new-pill .n')?.textContent === '2', { timeout: 2000 });
- assert(!(await page.$(row(fast.id))), 'header-visible prepends wait for an explicit tap');
- assert.equal(await page.$eval('.chat-page > .row', (r) => r.getBoundingClientRect().top), headerTop);
- await page.evaluate(() => { scrollTo(0, 1); scrollTo(0, 0); });
- assert.equal(await count(page), 2, 'scrolling at the top does not clear deferred new posts');
+ await page.waitForSelector(row(fast.id), { timeout: 2000 });
+ // header showing: they go in above the first post, which doesn't move
+ assert(Math.abs(await page.$eval(row(firstKey), (r) => r.getBoundingClientRect().top) - firstTop) <= 1, 'header-visible prepends hold the first post still');
+ assert(await page.evaluate(() => scrollY > 0), 'the page is scrolled by what went in above');
+ assert.equal(await count(page), 2, 'the pill still says how many are up there');
await page.click('.feed-new-pill');
await page.waitForSelector(row(later.id));
assert(await page.$eval(row(later.id), (r) => Math.abs(r.getBoundingClientRect().top - 8) <= 2), 'tap reveals the oldest ready new post');