Public: anyone can read this; the crew can change it.
A post in the feed says how long ago its run finished in plain words, and the words never change width on refresh #14713
Check · Review · Land · Live done — Landed and live in production.
Run posts in the feed now say how long ago the run finished, in plain words, in the first paint. The tests for the feed card pass (137 across 21 files), and tsc, scripts/gate.ts --fix and design-lint are clean. I didn't take before/after screenshots or run the app.
shipped production is serving it deploy 5b5da4d
7 earlier comments
The run age in the feed now keeps a fixed width, so it no longer changes size as it grows older. tsc, the design lint and the feed tests pass, and the forge runs the full check on this push.
- Width: the age sits in a new
time[datetime].ageslot withmin-width: 10ch, sized to the longest label,59 min ago..ageis documented indocs/design/areas/feed.md, andAGE_SLOT_CHties the CSS to the label module so a test can check them together. - "finished" dropped (1): the label is now elapsed time only (
4 min ago). The headline already says whether the run finished or failed. - "yesterday" replaced (2): it is now
1 d ago,2 d agoand so on, counted from elapsed hours. - Screen readers (3): the permalink's aria-label is now
Open post, 4 min ago, so the age is announced. I kept the link wrapper rather than moving the age out of it. - Tests (4, 5): the new tests cover the slot class, the aria-label, the label length at 59 min and 999 d, and the 23 h 50 min, 47 h and 49 h edges. I also loosened the regex in
test/feed-time-title.test.tsso it accepts the new class on<time>. - 360px not checked: I did not look at the byline in a real 360px browser here. The slot is nowrap and 10ch wide, and the byline already allows wrapping, but please check it on the preview. A short review block for that check follows.
[
{"go": "/feed", "look": "A run post byline at 360px width", "expect": "App name, age (e.g. '4 min ago') and badge wrap without horizontal overflow; the age does not shift width on refresh"}
]I merged main into the branch and pushed. The only conflict was the import block in src/web/studio/feed.ts, and I kept both sides: ONLY_LEAD from main and finishedLabel from this pull.
- Tests: I ran the three age tests this pull adds (
feed-age,feed-run-time,feed-time-title) plus seven other feed test files. All 53 tests pass. I did not run the full suite, becausescripts/fast.tsfound the change too broad to name tests for. The forge runs the full check on the push. - Type check and design lint:
bun x tsc --noEmitandbun scripts/design-lint.tsare both clean. - Gate:
bun scripts/gate.ts --fixraised one similarity note and changed nothing. It saysfinishedLabelinsrc/feed/finished_label.tsscores 0.61 againstqueuedPhraseinsrc/web/ui.tsand asks "one implementation?". I left both as they are, since merging them is outside this conflict resolution.
The sandbox blocked one network request (alpha--localhost:80) during a stray test run that I stopped. It doesn't affect the result.
<!-- look-pages af91cc51b30a --> Look pages for af91cc5, from the gate:
look pages (inferred): this pull changes src/web/studio/feed.ts, src/web/style/base.ts; the forge pictures / (src/web/studio/feed.ts), /docs (src/web/studio/feed.ts), /explore (src/web/studio/feed.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
A run post's age now keeps a fixed-width slot, is worded by elapsed time, and is read aloud. The fixed slot is sized to the longest label, 59 min ago. I merged current main into the branch and fixed the one failure that was this pull's own.
- Cause: the dead-code test (
test/unused-exports.test.ts) flaggedAGE_SLOT_CHinsrc/feed/finished_label.ts, because only a test used it. - Fix:
src/web/style/base.tsnow writes the slot width from that constant, so the export has a caller. Thefeed-run-timetest now reads the rendered stylesheet rather than the source file, and it passes.tscand the design lint are clean. - Main-branch failures: the check log says the other five failures (the fetch-timeout, relative-time, page-budget, SQL-budget and
/llms.txttests) are also red onmain. I did not touch them.test/time-element.test.tsstill fails in my local run too, on a<time>written by hand insrc/web/pages/passkeys.ts. - client-list: it failed in the earlier check but isn't in this one. My run for it timed out, so I never reproduced it.
- Left as is: the gate still asks whether
finishedLabelandqueuedPhraseinsrc/web/ui.tsshould be one implementation (0.61 similar). I kept them separate, since they're worded differently.
Look at src/web/style/base.ts and test/feed-run-time.test.ts.
<!-- look-pages 69a7a3f6f644 --> Look pages for 69a7a3f, from the gate:
look pages (inferred): this pull changes src/web/studio/feed.ts, src/web/style/base.ts; the forge pictures / (src/web/studio/feed.ts), /docs (src/web/studio/feed.ts), /explore (src/web/studio/feed.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The only feedback was the gate's automated list of look pages, with no change requested. It inferred 28 pages, because every route that imports src/web/studio/feed.ts counts. The age label only renders on feed cards, so I pushed an empty commit with a Looks: / line to narrow the pictures to the home feed. I haven't seen the gate re-run on it, so whether it takes that line is untested.
No code changed in this push. The earlier fix still stands: the stylesheet reads the age slot's width from AGE_SLOT_CH.
Still red, as before:
test/time-element.test.tsis red onmaintoo, on the hand-written<time>insrc/web/pages/passkeys.ts. I left it alone.
<!-- look-pages 4d582387f3f2 --> Look pages for 4d58238, from the gate:
look pages (named): this pull changes src/web/studio/feed.ts, src/web/style/base.ts; a commit names /
The gate's note on 4d58238 only says which page it will look at: /, because the pull touches src/web/studio/feed.ts and src/web/style/base.ts and the commit names it. It asks for no change, so I made none and pushed nothing. bun scripts/design-lint.ts passes on the branch.
What changed: a feed post now says how long ago its run finished in plain words. The age label sits in a fixed-width slot, and the stylesheet reads that width from AGE_SLOT_CH. A refresh that changes the words, for example "2 minutes ago" to "3 minutes ago", therefore doesn't shift the layout.
Not done: the other pages that import the age module show no age label, so I added no look for them. Only feed cards, which / renders, show it.
Try it: open / and look at the age label on each feed card. Refresh it and check that nothing around the label moves.
[{"go":"/","look":"the age text on a feed card","expect":"plain words such as '3 minutes ago', and the card layout does not shift when it changes on refresh"}]Earlier asks are met: the age keeps a 10ch slot (.age, documented in docs/design/areas/feed.md), the label is elapsed time only, "yesterday" is now "Nd ago", the permalink aria-label carries the age, and the edge cases (23h50m, 47h, 49h, 59 min, 999 d) are tested. It is server-rendered with the full UTC time in title, so it works with JavaScript off. Next, I would do two things (non-blocking): 1) check the byline at 360px in the preview, since the slot is nowrap; 2) fold finishedLabel and queuedPhrase into one implementation if the wording can be shared.
Run posts in the feed now say how long ago the run finished, in plain words, in the first paint. The tests for the feed card pass (137 across 21 files), and
tsc,scripts/gate.ts --fixanddesign-lintare clean. I didn't take before/after screenshots or run the app.What changed
src/feed/finished_label.tsbuilds the label from the run's end time and the request clock. It reads "finished 30 s ago", "finished 4 min ago", "finished 3 h ago", "finished yesterday", "finished 2 d ago" and "finished 40 d ago". An unreadable time gives no label.feedCardinsrc/web/studio/feed.tsuses it for run posts that link to a run page. It reuses the existing<time>element, so the exact UTC time stays intitleanddatetime.test/feed-run-time.test.tsbuilds runs ending 30 s, 4 min, 3 h, 1 d, 2 d and 40 d ago and asserts each label and its title. It also checks that headline and actor text are escaped, and that a non-run post keeps "3h ago".test/feed-age.test.ts: it used a run post to test the short "3h ago" age, which run posts no longer show. It now uses a tell post.Not done
<time>element, which only reserves 7 characters. The words are longer than that, so the line can still shift slightly when a post moves from seconds to minutes, minutes to hours, or hours to days. I leftsrc/web/style/base.tsalone because the issue limits the change to the feed card.agoinrank.ts,agoWordsinfollow_words.tsandtimeAgoinui.tsuse different wording, so a small run-specific module was simpler.Try it Open
/signed in and read a run post's time. Hover it to see the full UTC time.🤖 Generated with Claude Code
Closes #14704