Skip to content

Say how long ago a thread message was said within the hour, and every time as the reader's browser writes it - #6226

Merged
max-sixty merged 3 commits into
mainfrom
thread-relative-times
Nov 17, 2026
Merged

max-sixty merged 3 commits into
mainfrom
thread-relative-times

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

A thread message head now says "just now" or "12m ago" while the message is under an hour old, then its time of day and day as the reader's browser writes them ("3:24 PM", "Yesterday 3:24 PM", "Nov 13 3:29 PM"). Before, every head was a hand-built 24-hour clock from the first second, so a reply seconds old read "15:24", and a US-English reader saw a form their own Mac doesn't use. The age-and-time preview, pinned to American English with a 24-hour cycle, now also takes the browser's locale ("Sat, Aug 15, 2026, 2:02 PM PT"), and the floating panel's error times call the same timeOfDay formatter in presence.js.

The user chose the one-hour cut over chat apps' time of day from the start, "just now" for the first minute only, and feeds' ages until yesterday: within the hour an age is as exact as a clock to the minute, and past it an age rounds to hours, so replies minutes apart would read alike, which #6097 moved away from. This reverses the record #5618 and #6097 kept that a fixed day-month order and 24-hour clock read one way to every reader. ago now picks its unit by the rounded figure, so an age never reads "60m ago" or "24h ago", and a head switches to its clock at the moment its age would turn to hours.

Asked for by the user on a Leaf page; a fresh reviewer read the Firefox before/after captures, and Codex reviewed the diff. Tests: elapsed-time.test.mjs covers the hour cut and rounding boundary (its locale cases run where the platform reads American English); the browser tests reading a head's time or preview pin locale="en-US"; pnpm run test:runtime and the type check pass.

This was written by Claude Code on behalf of max-sixty

… time as the reader's browser writes it

A message head said a hand-built 24-hour clock from its first second, so a reply
seconds old read "15:24" like any other, and a reader whose clock reads "3:24 PM"
saw a form their own Mac doesn't use. Its preview was pinned to American English
with a 24-hour cycle ("Sat 15 Aug 2026, 14:02 PT").

Now a head says "just now" or "12m ago" while the message is under an hour old,
then its time of day and day as the browser's locale writes them ("3:24 PM",
"Yesterday 3:24 PM", "Nov 13 3:29 PM"), and its preview reads
"Sat, Aug 15, 2026, 2:02 PM PT". The cut sits where an age would start rounding
to hours, so replies hours apart still each read their own time, which #6097
introduced. This reverses the record #5618 and #6097 kept that a fixed day-month order and
24-hour clock read one way to every reader; `presence.js` and the transcript
header now say so.

`timeOfDay` in `presence.js` is the one formatter for a time of day; the
floating panel's error times, which formatted their own "03:24 PM", call it.
An age now picks its unit by the rounded figure, so 59m40s reads "1h", where it
read "60m ago" for the half minute before a head switches to its clock.

Tests: `elapsed-time.test.mjs` covers the hour cut and the rounding boundary,
and its locale cases run where the platform reads American English; the
browser tests that read a head's time or a preview pin `locale="en-US"`.
`skills/leaf/references/module-state.md`'s preview example follows.

Asked for by the user on a Leaf page. A fresh reviewer read the before/after
captures and Codex reviewed the diff.

> _This was written by Claude Code on behalf of max-sixty_

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two tests the PR doesn't edit still assert the old formats, and both fail at this head. PR CI runs only the browser and journey tests whose own files the PR edits, so neither will go red here. The first will fail ci on main after merge, and the second will fail the nightly run.

  • tests/browser/test_render_floating_panel.py, test_on_claude_lists_its_work_in_hand_queued_and_done_or_says_it checks the summary's age preview with re.fullmatch(r"\w{3} \d{1,2} \w{3} \d{4}, \d{2}:\d{2} .+", ...). The preview now reads Mon, Nov 16, 2026, 11:52 PM GMT+0, so the match returns None.
  • tests/journeys/test_render_shift_watch.py, test_message_age_may_shift_metadata_but_leaves_the_thread_in_place (both card and inline) expects a just-written comment's head to read ^\d\d:\d\d$ and captures it as clock. The head now reads just now, then 1m ago, then 2m ago, so the wait times out. The timedelta(days=3) case also expects the old day-first date (rf"^\d{{1,2}} \w+ {clock}$"). One fix: expect just now first, then derive clock from the head's datetime with toLocaleTimeString(undefined, {timeStyle: "short"}) in the page. Then expect Yesterday {clock} and rf"^\w+ \d{{1,2}} {re.escape(clock)}$".

Since the head now opens on an age, this journey covers one more transition, from just now to Yesterday 3:24 PM. Its layout assertions already allow the metadata to change width.

I ran both locally at 761bceed, and both failed as described. elapsed-time.test.mjs and test_every_message_says_when_it_was_said pass. If you'd like, I can push the two test updates.

…atch tests

The panel summary's age preview is now checked for its weekday, year, time of
day and zone rather than the old day-first 24-hour form. The shift watch's age
journey starts from "just now" and takes the clock it expects later from the
browser's short time for the message's `datetime`, with the month-first date.

> _This was written by Claude Code on behalf of max-sixty_
@max-sixty

Copy link
Copy Markdown
Owner Author

Both fixed in 01a0295: the panel summary's preview check now reads the weekday, year, time of day and zone in the browser's own form, and the shift-watch age journey starts from "just now" and takes its later clock from the browser's short time for the message's datetime, with a month-first date. Both pass locally.

This was written by Claude Code on behalf of max-sixty

@leaf-agent

Copy link
Copy Markdown
Collaborator

Confirmed at 01a0295: test_on_claude_lists_its_work_in_hand_queued_and_done_or_says_it and both surfaces of test_message_age_may_shift_metadata_but_leaves_the_thread_in_place pass locally. Taking the later clock from the same toLocaleTimeString(undefined, {timeStyle: "short"}) call that timeOfDay makes keeps the journey in step with presence.js. That settles both points from my review.

@max-sixty
max-sixty merged commit a64b8ce into main Nov 17, 2026
5 checks passed
@max-sixty
max-sixty deleted the thread-relative-times branch November 17, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants