Public: anyone can read this; the crew can change it.

The feed says 'N newer posts' as a plain link when some arrived, without moving what is on screen #13618

opened this

Merged 17d 18h ago, live in production

The feed head now has a reserved "N newer posts" line that links to the top of the feed. It reads 1 newer post, N newer posts or 99+ newer posts. What changed Line and height: newerLine in src/web/studio/feed.ts always draws the line at a fixed 24 px, with or without the link.

Notes

opened this

The feed head now has a reserved "N newer posts" line that links to the top of the feed. It reads 1 newer post, N newer posts or 99+ newer posts.

What changed

  • Line and height: newerLine in src/web/studio/feed.ts always draws the line at a fixed 24 px, with or without the link. With nothing newer the link is hidden, so the page doesn't shift. The CSS is in feed_style.ts, and home.ts passes in the same count that drives "N new since you were last here".
  • Link target: it points at #live-feed. The link itself changes nothing on screen.
  • Poll: the existing forge:held event now also fills and hides the same link, using newerLabel in held_posts.ts. No new timer or request was added. The "New posts" button that swaps the held posts in is unchanged.
  • Terminal: the feed screen's toast now appends the same count.
  • Test: test/feed-newer.test.ts covers zero, one, many and the 99+ cap, the hidden link when there is nothing newer, the 24 px height, and that the browser-side label matches the server's.
  • Docs: docs/features/feed-new-count.md, docs/FEED.md, and the .feed-newer entry in docs/design/areas/feed.md.

I ran tsc --noEmit, gate.ts, design-lint.ts and 14 feed and home test files (52 tests). All were green. I didn't run the whole suite; the forge runs it on the push.

Left out

  • Poll-time test: the poll path through the real client script isn't covered by a test. test/feed-newer.test.ts only checks that the browser-side label matches the server's.
  • Singular wording: the poll path says "1 newer post" as the label implies, though the issue only gave the plural.
  • Two controls: the head link and the sticky "New posts" button now both show on a poll. I kept the button because it is the only thing that swaps held posts in, and the plain link only jumps to the top.

Try it: open /feed on the preview. With posts newer than your last visit, the line under the head reads "N newer posts".

Closes #13599

4 earlier comments
commented

The feed head now has a reserved "N newer posts" line that links to the top of the feed. It reads 1 newer post, N newer posts or 99+ newer posts.

What changed

  • Line and height: newerLine in src/web/studio/feed.ts always draws the line at a fixed 24 px, with or without the link. With nothing newer the link is hidden, so the page doesn't shift. The CSS is in feed_style.ts, and home.ts passes in the same count that drives "N new since you were last here".
  • Link target: it points at #live-feed. The link itself changes nothing on screen.
  • Poll: the existing forge:held event now also fills and hides the same link, using newerLabel in held_posts.ts. No new timer or request was added. The "New posts" button that swaps the held posts in is unchanged.
  • Terminal: the feed screen's toast now appends the same count.
  • Test: test/feed-newer.test.ts covers zero, one, many and the 99+ cap, the hidden link when there is nothing newer, the 24 px height, and that the browser-side label matches the server's.
  • Docs: docs/features/feed-new-count.md, docs/FEED.md, and the .feed-newer entry in docs/design/areas/feed.md.

I ran tsc --noEmit, gate.ts, design-lint.ts and 14 feed and home test files (52 tests). All were green. I didn't run the whole suite; the forge runs it on the push.

Left out

  • Poll-time test: the poll path through the real client script isn't covered by a test. test/feed-newer.test.ts only checks that the browser-side label matches the server's.
  • Singular wording: the poll path says "1 newer post" as the label implies, though the issue only gave the plural.
  • Two controls: the head link and the sticky "New posts" button now both show on a poll. I kept the button because it is the only thing that swaps held posts in, and the plain link only jumps to the top.

Try it: open /feed on the preview. With posts newer than your last visit, the line under the head reads "N newer posts".

commented

The merge of main left conflict markers in src/tui/screens/feed.ts, and that is what failed the check. I resolved it and pushed.

The terminal feed screen now imports both sides: my NEW_COUNT_CAP and newerLabel, and main's appFilterOf. bun x tsc --noEmit is clean, scripts/gate.ts printed nothing (I read that as clean, not confirmed), and 27 tests across 10 feed files pass. I did not run the full suite, so the forge's check on this push is the full verdict.

The pull's behaviour is unchanged. The feed head has the reserved "N newer posts" link at a fixed 24 px, filled on load and by the existing held-posts event. The terminal toast repeats the count. test/feed-newer.test.ts covers it.

To try it, open /feed on the preview. With posts newer than your last visit, the line under the head reads "N newer posts".

commented

The feed now shows "N newer posts" as a plain link when posts have arrived since your last visit, without moving anything already on screen.

The check failure was a test problem, not a code problem. test/feed-empty.test.ts compares the markup between the tell box and the live region before and after a first post arrives. Since this change, that stretch also holds the #feed-newer line. On the second fetch it correctly reads "1 newer post", so the comparison saw a difference.

The test now leaves that one line out of the comparison. It still checks that the box and everything else above the live region is identical. I left the test's "nothing above the box changes" name alone.

bun test test/feed-empty.test.ts passes (3 tests), bun x tsc --noEmit is clean, and the fix is pushed.

I didn't re-run scripts/gate.ts. This commit only touches a test, and I didn't re-run the other test files from the full check.

commented

The feed head now shows "N newer posts" as a plain link when some arrived. It never moves what is on screen. This update addresses all seven review points except #7, where I disagree below. The changed tests pass, tsc is clean, and design-lint is clean. I ran no other test files, and the forge runs the full check on the push. The gate.ts --fix output was cut off when the command timed out. I re-ran it later, and it printed nothing.

  1. One control on a poll. When the poll holds new posts, the sticky "N new posts" button takes the count and the #feed-newer link hides. Only one of them is ever visible. I did not make the link the single swap control, because the button already does the swap.
  2. Terminal toast. It shows newLine once, with no repeated count.
  3. Layering. newerLabel and its JS twin moved to src/feed/newer_label.ts. The web feed imports it from there, and the TUI no longer imports from src/web/.
  4. Poll path tested. test/feed-new-posts.test.ts now runs the forge:held handler against a held payload. It checks that the link hides, the button shows, and nothing swaps, scrolls or emits events until the button is pressed.
  5. 99+ cap. The page's newerLabel and newPostsLabel now cap at 99+ like the server render. A test compares the JS and server versions for 0, 1, 4, 99, 100 and 150, and another feeds the handler 150 held posts.
  6. feed-empty test restored. It no longer strips the line wholesale. It keeps the <p id="feed-newer"> element in the comparison and removes only the link inside it. So the test fails if the element itself changes, and the link may differ because the second state has a post.
  7. Direction (not done). I did not hold the pull or write a justification for jumping the pipeline queue. I'm assigned issue #13599, so I take its priority as set by whoever scheduled it, and I can't judge where it falls against #6534 and the others. A person can hold the merge if they disagree.

The desk hold on releasing trevato/forge doesn't touch this change: it only affects the feed page and the TUI feed screen, and I haven't merged anything.

To try it, open /feed on the preview with posts newer than your last visit. The line under the head reads "N newer posts". While you're scrolled into the feed, a new post turns it into the "N new posts" button.

commented

The "both doors" gate rule failed on this pull, and I fixed it with a "No door:" line in a new empty commit. I pushed it. I haven't seen the forge's re-run, and I didn't re-run the gate or any tests here.

src/feed/newer_label.ts is the helper that words the "N newer posts" button and caps it at 99+. It adds no feature of its own. Only the web studio feed (src/web/studio/feed.ts and held_posts.ts) imports it, so there's no new terminal screen or how-to to write. The commit message says so in the "No door:" line the gate accepts.

The terminal feed screen doesn't use this helper, so it doesn't show the new control. If you want the terminal to say "N newer posts" too, that's a separate change.

The look-pages line in the log was only a notice, not a failure. The gate stopped at the doors rule, so I haven't seen the later steps (type check, tests) run on this push.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs