From 94b5a7cf832f7da07c18e9eee10f845799b9b657 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 1 Oct 2026 22:38:55 -0700 Subject: 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 --- tools/feed-window-test.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/feed-window-test.js') diff --git a/tools/feed-window-test.js b/tools/feed-window-test.js index 64e8364..3cf702f 100644 --- a/tools/feed-window-test.js +++ b/tools/feed-window-test.js @@ -7,8 +7,14 @@ const notes = [note('a', 100), note('b', 90), note('c', 80), note('d', 70)]; const rows = (top) => notes.map((e, i) => ({ id: e.id, top: top + i * 200, bottom: top + (i + 1) * 200 })); const above = note('above', 110), gap = note('gap', 95), below = note('below', 60); const check = (name, fn) => { fn(); console.log('✓ ' + name); }; -check('header-visible arrivals wait without changing the displayed window', () => { +check('header-visible prepends go in above the first post; visible gaps wait', () => { const r = mergeFeedWindow(notes, 4, [above, gap], { rows: rows(180), height: 844 }); + assert.deepEqual(r.added, [above]); + assert.deepEqual(r.deferred, [gap]); + assert.deepEqual(r.notes.slice(0, r.shown).map((e) => e.id), ['above', 'a', 'b', 'c', 'd']); +}); +check('a busy header (composer open) holds even the prepend', () => { + const r = mergeFeedWindow(notes, 4, [above, gap], { rows: rows(180), height: 844, holdHead: true }); assert.equal(r.notes, notes); assert.equal(r.shown, 4); assert.deepEqual(r.deferred, [above, gap]); -- cgit v1.2.3