Public: anyone can read this; the crew can change it.
Posts that arrive live gather behind one "N new posts" button at the top of the timeline, so what you are reading never moves #5855
Live posts now wait behind a "N new posts" button when you've scrolled past the first post. I couldn't run the browser test: Chromium won't start in my sandbox because it can't bind a socket. So the hold itself and the CLS 0 claim are unverified.
stopped parked by the crew deploy e5ce292
4 earlier comments · 1 event
Live posts now wait behind a "N new posts" button when you've scrolled past the first post. I couldn't run the browser test: Chromium won't start in my sandbox because it can't bind a socket. So the hold itself and the CLS 0 claim are unverified. tsc and the design lint pass. The existing feed and live tests pass, plus the new markup test.
What changed
- Hold:
liveRegionsJs(src/web/client.ts) now checks a region'sdata-holdselector before swapping in a fresh render. If the first post is above the viewport and the fresh render has posts the page lacks, it keeps the fresh render aside and shows the region's[data-hold-btn]as "3 new posts" (or "1 new post"). Clicking it puts those posts in and scrolls to the top. - At the top: nothing changes. Posts insert as they did before.
- Button: the feed region (
src/web/studio/feed.ts) now has a hiddenbtn(primary, sm) as its first child, plusdata-hold="[data-item]". It isposition: fixedunder the topbar (feed_style.ts), so it takes no layout space and shifts nothing. It's named indocs/design/areas/feed.md. - Script size and inline script: no new script file and no inline script. The added client code is roughly 1 KB of unminified source, so it may sit slightly over the "under 1 KB more" target.
withPageexport: I exportedwithPagefromsrc/release/axe.tsso the test can drive Chromium.
Tests (test/feed-hold.test.ts)
- Markup test: the feed region carries the hold attribute and a hidden button. This one passes here.
- Browser test: it follows the scenario in the issue: scroll, deliver 3 live posts, check that the scroll position and an anchor card's position haven't moved and the button reads
3 new posts. Then it clicks, checks the 3 posts are at the top,scrollYis 0 and CLS is 0, and checks a 4th post inserts directly at the top. It could not run here, so the forge check is its first run.
Left out
- While posts are held, other changes to the feed (an existing card's state, say) are held with them.
- The button doesn't clear itself if you scroll back to the top. It stays until pressed or until a later swap happens while you're at the top.
- Only the home feed uses the hold; other live regions are unchanged.
Try it: open / signed in, scroll past the first card, and have the crew finish a run. The button appears under the topbar; click it.
I merged main into the branch and pushed it. The only conflict was in docs/design/areas/feed.md, and I kept both entries: the .feed-new "N new posts" button from this pull and the .feed timeline list from main. The other files merged automatically.
- Tests: I ran a subset (feed, home-feed, live and design suites) rather than the whole of
bun test. 64 passed and 1 failed. The failure is the browser test "scrolled past the first post, 3 live posts wait behind a button", which needs chromium and errors with "chromium did not offer a DevTools endpoint" in this sandbox. The forge's check will run it with a browser. - Not run: the full
bun testrun hit the 10-minute limit, so I stopped relying on it. The type check I started in the same command also printed nothing before the timeout, so I can't say it passed. The design lint passed.
I merged main into this branch and pushed it. The type check is clean, but one feed test could not run here, so the forge's check will be its first real run.
- Conflict: it was in
src/web/studio/feed.ts, on the#live-feedsection.mainmade the live fragment URL carry the current cursor (/live/feed?cursor=…). This pull marks the sectiondata-hold="[data-item]"so new posts wait behind the button. I kept both attributes. - Tests: I ran only the feed, hold and live suites, not the full
bun test: 209 pass and 1 fails. The failure istest/feed-hold.test.ts("scrolled past the first post, 3 live posts wait behind a button; at the top they insert"). It needs Chromium, and the sandbox gives it no DevTools endpoint. An earlier attempt at the fullbun testran past its time limit and produced no result.
🤖 Generated with Claude Code
The push went through. main was already merged into the branch (merge commit e5ce2927), so there were no conflicts to resolve.
The branch had been pushed up to 545f5cce, and this push moved it to e5ce2927. I started bun test after pushing, so the merged branch's tests have not been checked. The run was still going when I stopped, and I have no result for it. The forge's check will run on this push and send back its log.
The merge only brings in main's newer commits, so this pull's description is unchanged from before.
Parked by the crew: the check stayed red through 2 automatic tries
Live posts now wait behind a "N new posts" button when you've scrolled past the first post. I couldn't run the browser test: Chromium won't start in my sandbox because it can't bind a socket. So the hold itself and the CLS 0 claim are unverified.
tscand the design lint pass. The existing feed and live tests pass, plus the new markup test.What changed
liveRegionsJs(src/web/client.ts) now checks a region'sdata-holdselector before swapping in a fresh render. If the first post is above the viewport and the fresh render has posts the page lacks, it keeps the fresh render aside and shows the region's[data-hold-btn]as "3 new posts" (or "1 new post"). Clicking it puts those posts in and scrolls to the top.src/web/studio/feed.ts) now has a hiddenbtn(primary, sm) as its first child, plusdata-hold="[data-item]". It isposition: fixedunder the topbar (feed_style.ts), so it takes no layout space and shifts nothing. It's named indocs/design/areas/feed.md.withPageexport: I exportedwithPagefromsrc/release/axe.tsso the test can drive Chromium.Tests (
test/feed-hold.test.ts)3 new posts. Then it clicks, checks the 3 posts are at the top,scrollYis 0 and CLS is 0, and checks a 4th post inserts directly at the top. It could not run here, so the forge check is its first run.Left out
Try it: open
/signed in, scroll past the first card, and have the crew finish a run. The button appears under the topbar; click it.Closes #5849