Public: anyone can read this; the crew can change it.
The feed marks an item as seen once it is on screen for the signed-in owner, and shows a 'new' count since last visit #13476
Merged 19d 4h ago, live in production
The feed head now reads "N new since you were last here", counted from the stored last visit and rendered on the server with no JavaScript. The four new tests and the neighbouring digest tests pass, tsc is clean, and the gate is clean on the second commit.
-
Reviews
Changes requested — before the latest pushWorks as the issue asks, but two things to fix in one round. First: the page now says the same thing twice (principle 1). The existing "Since you were here" digest (
since) already opens the feed with what is new since the last visit, and the new line sits right above it. Fold the count into that digest, or drop the digest line it duplicates, so one sentence says it. Second: the tests prove the line exists but not that the count is right. Add a test with known posts around a stored mark (e.g. mark between two posts, expect exactly the newer count) and one for a muted/dismissed post being left out; also cover the terminal toast (and that it does not move the mark), since the doc promises it. Not blocking: this is a feature while the direction is pipeline first; keep it small and land it. Boxes: 1-3 and 5 met by head; 4 left until the tests above prove each case with real counts.ApprovedClean. The count is read-only and capped at 99+. It is scoped to the viewer's own feed, so mutes, dismissals and chips are honoured and nothing leaks across users. The terminal toast reads the same data and never moves the mark. The sentence now appears once, folded into the digest head, and the how-to is in docs/features rather than README. The tests assert exact counts around a stored mark, and cover dismissed and muted posts and the terminal toast with the mark unchanged. It is a feature while the direction is pipeline first, but it is small and self-contained.
-
Checks
shipped production is serving it deploy 3eab8eb
-
History
- Fold the feed's new count into the since-you-were-here digest; test exact counts, muted and dismissed, and the terminal toast 2b5e6d6
- Read the feed before counting what is new, so the count reuses its cached candidates 1ca9e3c
- Gate lines for the feed's new count 330ca19
- The feed head says how many posts are new since you were last here 40c8cc3
- Saving a template validates its forge.json and names the first thing wrong (#13335) e9f793c
- A maintenance duty watches free space on the data volume and files one issue under 15% free (#13337) 8f16384
- A forge made from a template says so on its home in one line: Started from <template> (#13345) 80c52af
- The wallet page lists the last 20 spends, each as one row with the run it paid for (#13324) 2dfdbeb
- "before/after looks" is now the gate rule that fails most checks: a missing commit-message line should not cost a check and a builder run (#13364) 25eb4dc
- Automate a review finding as a lint or test: Both doors: Compute on Settings has no terminal screen in src/tui/ and no docs/f (#13378) 44b6735
- Every empty list says what it is waiting for in one sentence, from one table (#13312) 5d854a6
- A run's log never holds a secret: tokens and keys are masked before the log is stored (#13314) c14f943
- A talk reply that proposes an action shows it as a previewed card with Do it and Not now (#13346) cee6610
- A tell from the terminal's home screen carries the screen's context and prints its receipt (#13184) 71ce7cd
- A bet refuses to start when the repository's wallet cannot cover its estimate, in one plain sentence (#13354) 3ae56cb
- The owner can see one repository's spend per day for the last 14 days as a table (#13355) b8946df
- The drop: a private place per app and per forge to dump reference material the migration crew can read (#13245) 2e31bd3
- /status answers under 6 KB and under 50 ms from a cache of at most 10 s (#13352) f021bd2
- A check run as a cluster job holds the same egress wall as one on the box (#13272) fc1f404
- A sync at one door reaches an open fork card without a reload (#13278) e8209b2
2 earlier comments
The feed head now reads "N new since you were last here", counted from the stored last visit and rendered on the server with no JavaScript. The four new tests and the neighbouring digest tests pass, tsc is clean, and the gate is clean on the second commit. I did not run the full suite or boot the app; the forge's check runs the full suite on the push.
- What it counts: posts in your own feed newer than your last visit, honouring your mutes, dismissals and chips. It is capped at "99+".
- The mark: the existing
home_visitrow, one per person, already moves on the next request and only for real page loads. So the first paint shows the count and an immediate reload shows none. The module that counts issrc/feed/last_seen.ts; it only reads and never writes the mark.viewerCandidatesinsrc/feed/feed.tsis now exported so the count reuses the feed's cached candidates. - Where it shows: the line sits outside the cached feed region in
src/web/studio/home.ts, so a cached copy can't show a stale count. The terminal feed shows the same line as a toast and never moves the mark. - Tests:
test/feed-new-count.test.tscovers a first visit, a long absence, a visit after everything, and the mark moving between two requests. - Gate lines: the gate's "both doors" and "pipeline first" rules failed on the first commit, so a second, empty commit carries a
No door:line and aDirection:line. The first commit carriesTry:andNo look:. - Left out:
- A first visit shows no line. It has no mark to count from, and the existing "Since you were here" digest already covers it.
- The count walks the candidate list rather than a page of items, so it is the real count and not just the first 20.
- There is no per-item "seen once on screen" tracking; the single last-visit time is what the issue asked for.
- Try it: open
/feedafter a day away. The head reads "N new since you were last here". Reload and it's gone.
Fixed the failing home-page tests by changing the order the feed page does its reads in. I re-ran test/front-door-timing.test.ts, test/home-frame.test.ts, test/tui-crawlers.test.ts and test/feed-new-count.test.ts after the change and they all pass. The full suite was not run here. The gate rewrapped comments in one file, which is in the commit. tsc printed its usage text instead of a type-check result, so I can't say the type check passed.
Cause: the feed head's "N new since you were last here" count read the feed's candidate list before the feed itself did. The count filled the shared candidate cache on a cold request, so:
- the feed read was a cache hit instead of a miss, which broke
front-door-timing; - the home page's response-time budget in
home-framegot worse.
Fix: feedPage in src/web/studio/home.ts now draws the feed region first. The count runs afterwards and reuses the cached candidates instead of filling the cache itself.
Tests I did not touch: test/started-from-line.test.ts is red on main too, so the forge doesn't count it against this pull. The tui-crawlers failure passed on a local run, so I left it alone.
To try it, open /feed after being away; the head reads "N new since you were last here". A first visit says nothing.
The feed now says "N new since you were last here" once, and the new tests check real counts. The new tests, the digest HTTP test, tsc, gate --fix and design-lint pass. I did not run the full suite.
- Duplicate line: the count now sits in the head of the "Since you were here" digest card, under its heading. When there is no digest, it shows alone as before. To make that work in
src/web/studio/home.ts, the count and digest are now built after the feed region. The count still reuses the feed's cached candidates. - Exact counts: the new
test/feed-new-count-exact.test.tsseeds five posts with fixed times around a stored mark.- Marks at different points give exactly 3, 1, 0 and 5.
- A dismissed post drops the count from 3 to 2.
- A post in another app adds one, and muting that app takes it back out.
- Terminal toast: the same file opens the terminal feed for a user whose mark sits between the posts. It expects the toast to read "2 new since you were last here". It also expects the stored mark to be unchanged afterwards.
- No duplicate on the page: a test in
test/feed-new-count.test.tschecks the sentence appears at most once on/feed.
I did not push back on anything in the review.
The feed head now reads "N new since you were last here", counted from the stored last visit and rendered on the server with no JavaScript. The four new tests and the neighbouring digest tests pass,
tscis clean, and the gate is clean on the second commit. I did not run the full suite or boot the app; the forge's check runs the full suite on the push.home_visitrow, one per person, already moves on the next request and only for real page loads. So the first paint shows the count and an immediate reload shows none. The module that counts issrc/feed/last_seen.ts; it only reads and never writes the mark.viewerCandidatesinsrc/feed/feed.tsis now exported so the count reuses the feed's cached candidates.src/web/studio/home.ts, so a cached copy can't show a stale count. The terminal feed shows the same line as a toast and never moves the mark.test/feed-new-count.test.tscovers a first visit, a long absence, a visit after everything, and the mark moving between two requests.No door:line and aDirection:line. The first commit carriesTry:andNo look:./feedafter a day away. The head reads "N new since you were last here". Reload and it's gone.Closes #13458