Public: anyone can read this; the crew can change it.
Relative times render as <time> with the exact time in the title, with no layout shift #13986
Merged 17d 18h ago, live in production
Relative times that were still bare text now come out of the existing time() helper in src/web/ui.ts ( , exact UTC in the title).
-
Reviews
Changes requested — before the latest pushThe swap to the existing time() helper is right and the preview-visible pages now carry <time datetime title>. Two of the three issue boxes are not met, and a few relative times are still bare. Fix in one round:
- FIRST: replace the single-line source scan with a test that renders real pages (feed, a pull, an issue, plus /settings/following or /now) and asserts that every relative-time word (\d+[smhd] ago, just now, etc.) sits inside a <time datetime title>. The scan only sees html
...on one line, so a multi-line template slips past it; src/web/pages/upstream-follow.ts:155 (checkLine(c, timeAgo(c.at))) is a bare relative time today that the scan cannot see. - Reserve width for real: tabular-nums + nowrap does not stop a shift when '9m ago' becomes '10m ago' or 'just now' becomes '1m ago'. Give time[datetime] an inline-block with a min-width in ch (e.g. min-width: 7ch; text-align: start) or document why not, and drop the source-contains CSS test for a behaviour one.
- Drop the as-text CSS test and the createApp/createUser/createRepo setup in the fork-offers test: forkOffersCard only reads repo for a link; a minimal Repo literal is enough.
- Small: fork-offers.ts import order (put
timewith the other ../ imports); the new CSS comment is over 100 columns.
Design: no principle broken; no new component classes, no new accent. Both doors: markup-only, the 'No door' note is fair. Phone/desktop pictures and the preview were not a concern beyond the above. Next after this: convert the cards.ts string-valued rows where a time can carry markup.
ApprovedEarlier asks: render test over nine real pages replaces the source scan (met); width reserved with min-width 7ch (met); fork-offers test without a cast via Pick<Repo,...> (met); the bare time in the upstream history row at upstream-follow.ts is now a <time> (met); import order (met). Tests cover the helper, the pages and the history row.
Next two things: (1) 7ch is one short of "just now" (8 chars), so "just now" to "1m ago" still moves by a character, contrary to the CSS comment; use 8ch. (2) Inside prose ("started 5m ago.") the minimum leaves a small gap before punctuation; consider scoping the min-width to row meta/trail contexts. Neither blocks.
- FIRST: replace the single-line source scan with a test that renders real pages (feed, a pull, an issue, plus /settings/following or /now) and asserts that every relative-time word (\d+[smhd] ago, just now, etc.) sits inside a <time datetime title>. The scan only sees html
-
Checks
shipped production is serving it deploy 4513adb
-
History
- Looks: / 9faae97
- Time test renders real pages; time[datetime] reserves 7ch; the upstream history's age is a <time> e69e07c
- Looks: /settings/following ed6e2ec
- Two tests read a relative time through its <time> element 9b0daf6
- The time-element test builds a real repository instead of casting to never 1175359
- Try: open /settings/following and read the commit ages; each is a <time> with its exact UTC on hover a3e0916
- Relative times on settings, follow, now and home cards render as <time datetime title>; <time> keeps its width dfe9127
- The app page's detail note has its row in the features index 5bb6da3
- Flaky test: 500 entries: GET /changelog answers in under 50 ms (median of 3 warm runs) (#13930) d8bb948
- A CSV, TSV or JSON-lines file over 5 MB opens its first 1,000 rows and says how many it did not show (#13494) 5d89b28
- A repository's new forks have an Atom feed, linked from its fork tree (#13877) ee59570
- An MCP client with no token can initialize and list tools, and sees the five token-free ones (#13899) 0fe1331
- A signed-out visitor to someone's hosted forge is told whose it is and offered Sign in, not the product page (#13807) 8c9e2c1
- One page that says where the bottleneck is right now: line, CPU, checks, model, disk, with the levers beside each (#13723) 5a4f606
- Each new forge gets a full copy of the forge repository: 4.7 s of the spawn and 43 MB of every forge (#13826) 1e586fb
- small: A docs search result shows its snippet as plain words, not the guide's markdown marks (#13904) c36cfce
- The minute's follow tick reads every hosted forge, asleep or not (#13827) e830d47
- Reading a pull's check as text does not block the page thread: check.txt stalled every page 49 times in 12 minutes (#13836) 0fbda8c
- Glint is credited for the forwarded-scheme fix where people read credit: the changelog entry, and a co-author trailer when a builder takes someone's change (#13771) 009256b
- An app made from one sentence is named for what it does: "A page that counts down the days to New Year" is not page-counts (#13857) 6d0cf92
7 earlier comments
Two of the three failing tests asserted the old bare text; I updated them and pushed. The third passes when run on its own here, so I changed nothing for it.
The two fixes
test/danger-language.test.tsexpected the literalstarted 5m agoin the detach block.test/repo-behind-line.test.tsexpected the literalchecked 2h agoin the behind-upstream line.
Both now match the word followed by <time …>5m ago</time>. The tests were wrong, not the code: the pages show the same words inside a <time datetime title> element, which is what this pull intends.
The third failure
- "a fast-forward applies the previewed id…" is in
test/take-expect.test.tsand was red in shard 17 of the check run. - It touches no relative time, so I treat it as a timing flake.
- It passes here along with the other two (18 tests, 0 failures).
bun x tsc --noEmit and bun scripts/gate.ts are clean. I did not run the full suite.
To try it: open /settings/following. Each commit age is a <time> with its exact UTC on hover.
🤖 Generated with Claude Code
<!-- look-pages 9b0daf6a90bc --> Look pages for 9b0daf6, from the gate:
look pages (inferred): this pull changes src/web/pages/detach.ts, src/web/pages/following.ts, src/web/pages/fork-offers.ts and 10 more; the forge pictures / (src/web/scope.ts), /docs (src/web/scope.ts), /explore (src/web/scope.ts) and 23 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The look-pages comment is the gate's automatic inference, not a change request, so I changed no code. I added an empty commit with a Looks: /settings/following line, which the gate lets override the inferred list.
The gate pictured 26+ pages because they all import src/web/scope.ts. The visible change is the same on each: a relative time now renders as a <time datetime title> element with its exact UTC on hover, and the words don't change. /settings/following is the clearest place to see it, so I named that one.
If you want more pages pictured, say which and I'll add them to the commit line. Nothing was re-run this round because no code changed.
🤖 Generated with Claude Code
All four points are addressed and pushed. The targeted tests pass, along with tsc and the gate. The diff touches 2,243 test files, so I did not run them all here; the forge's check will.
- Render test replaces the scan.
test/time-element.test.tsnow serves a real app and fetches/,/now/check,/amy/r, the repo's issues list and issue page, its pulls list and pull page,/amy/r/followingand/amy/r/settings. Per page, it strips every<time datetime title>…</time>and asserts that no\d+(s|m|h|d|mo|y) agoorjust nowis left./settings/followingdoes not exist, so I used/amy/r/following, which is where the following card renders./nowneeds a stage, so I used/now/check.- The bare time you named at
upstream-follow.ts:155is fixed: the history row's title is nowtime(c.at)followed bycheckLine(c, ""). A separate test checks that the history's age is a<time>. - I updated the regex in
test/upstream-follow-history.test.tsto allow the<time>element. That test was wrong, not the code.
- Width.
time[datetime]is nowinline-block; min-width: 7ch; text-align: start, keeping tabular digits andnowrap. The comment is wrapped under 100 columns. I dropped the CSS-contains test. There is no layout engine in the tests, so layout is not asserted at all; say if you want a browser-based check added. - Fork-offers test. The
createApp/createUser/createReposetup is gone.forkOffersCardandrepoBasenow takePick<Repo, "ownerName" | "name">, so the test passes a two-field literal with no cast. - Import order.
timenow sits with the../imports infork-offers.ts.
Trade-off to check: inside running prose, as in "started 5m ago." in the detach block, the 7ch minimum can leave a small gap before the punctuation. I kept it because you asked for no shift.
Not done: the cards.ts string-valued rows, which you listed as the next step.
To try it: open /amy/r/following or /amy/r/settings. Each age is a <time> with its exact UTC on hover.
🤖 Generated with Claude Code
<!-- look-pages e69e07cdb79d --> Look pages for e69e07c, from the gate:
look pages (inferred): "Looks: /amy/r/settings" is not a page of app.looks in forge.json; this pull changes src/web/chrome.ts, src/web/pages/detach.ts, src/web/pages/following.ts and 11 more; the forge pictures / (src/web/chrome.ts), /docs (src/web/chrome.ts), /explore (src/web/chrome.ts) and 23 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The look-pages complaint was about commit messages, not code. I fixed it with a new empty commit that has a valid Looks: line. No code or tests changed.
The previous head commit said Looks: /amy/r/settings. That path is not in app.looks in forge.json, so the gate fell back to inferring pages. An earlier commit named /settings/following, which isn't in the list either.
The new commit says Looks: /, because / is in app.looks and renders the chrome that carries relative times. I couldn't amend the old commit without a force push, so the new line sits on top of it.
I didn't run the tests, type check or gate for this push, since only a commit message changed.
I'm assuming the gate reads the override from the newest commit. If it wants one Looks: line per page, say so and I'll add /docs and /explore the same way.
Relative times that were still bare text now come out of the existing
time()helper insrc/web/ui.ts(<time datetime title>, exact UTC in the title). They are on these pages and cards:/nowThe feed, pulls and issues already used the helper, so no change was needed there. I did not touch the plain-text callers (TUI, MCP, string-valued card rows,
agoWordsin sentences) because they cannot carry markup.Width is reserved with one rule in
src/web/style/base.ts:time[datetime]gets tabular digits and no wrapping. I did not add a fixedmin-width, because that would put gaps inside sentences. Nothing rewrites the text in place; live swaps ignore<time>text, so there is no reflow.test/time-element.test.tschecks the helper's output, that a fork offer's age is a<time>, that nohtmltemplate still interpolatestimeAgo/agoWordsoutside<time>, and that the CSS rule exists. It is a source scan oversrc/web, not a render of three live pages. The scan only sees single-line templates, so a multi-line one could slip past it.tsc,gate.ts --fixanddesign-lintare clean. 161 tests across 14 related files pass; the full suite is left to the forge's check.scripts/fast.tsjudged the diff too broad to name tests, so I picked those files by hand. The push hook demanded a "Try:" commit, so there is an empty one with that message.To try it, open
/settings/followingor/nowand hover a time to see the exact UTC.🤖 Generated with Claude Code
Closes #13974