The Age column on the AS and prefix pages printed Go's duration format for every plural age, such as "360h0m0s ago". The templates now register humanize.Time from go-humanize as the timeSince function, and the hand-written function is gone. The page templates are unchanged.
What the diff does not show:
The test is with the server's handler tests. It stores routes in a test database and reads the AS page and the prefix pages, as the other page tests there do.
humanize.Time writes a time ahead of the server's clock as "N seconds from now". A route's time comes from the collector, so a collector whose clock runs ahead would show that. The old function said "just now".
Disclosures:
Judgement call: an age under a minute reads "now" or "N seconds ago" instead of "just now". Both are plain words, so I kept no special case and registered humanize.Time directly.
Behaviour change: an age over 30 days used to read as a date. It now reads "1 month ago" or "2 years ago". The Last Updated column beside it still gives the date.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/routewatch/issues/163.
The Age column on the AS and prefix pages printed Go's duration format for every plural age, such as "360h0m0s ago". The templates now register `humanize.Time` from `go-humanize` as the `timeSince` function, and the hand-written function is gone. The page templates are unchanged.
What the diff does not show:
- The test is with the server's handler tests. It stores routes in a test database and reads the AS page and the prefix pages, as the other page tests there do.
- `humanize.Time` writes a time ahead of the server's clock as "N seconds from now". A route's time comes from the collector, so a collector whose clock runs ahead would show that. The old function said "just now".
Disclosures:
- Judgement call: an age under a minute reads "now" or "N seconds ago" instead of "just now". Both are plain words, so I kept no special case and registered `humanize.Time` directly.
- Behaviour change: an age over 30 days used to read as a date. It now reads "1 month ago" or "2 years ago". The Last Updated column beside it still gives the date.
Model: opus-5-5
The Age column printed Go's duration format for every plural age, such
as "5m0s ago" or "360h0m0s ago".
The templates now register humanize.Time from go-humanize, which the
server already uses, as the timeSince function, and the hand-written
function is gone. Ages read "5 minutes ago", "3 hours ago" or "2 weeks
ago". An age under a minute reads "now" or in seconds instead of "just
now". An age over a month reads in months or years instead of a date.
Model: opus-5-5
PASS: the AS and prefix pages now give ages in words through humanize.Time, which meets the definition of done in #163, and the new test fails on the code before the change.
Model: opus-5-5
PASS: the AS and prefix pages now give ages in words through `humanize.Time`, which meets the definition of done in https://git.eeqj.de/sneak/routewatch/issues/163, and the new test fails on the code before the change.
Model: opus-5-5
clawbot
merged commit 86e1f20e11 into next2026-10-27 01:23:51 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #163.
The Age column on the AS and prefix pages printed Go's duration format for every plural age, such as "360h0m0s ago". The templates now register
humanize.Timefromgo-humanizeas thetimeSincefunction, and the hand-written function is gone. The page templates are unchanged.What the diff does not show:
humanize.Timewrites a time ahead of the server's clock as "N seconds from now". A route's time comes from the collector, so a collector whose clock runs ahead would show that. The old function said "just now".Disclosures:
humanize.Timedirectly.Model: opus-5-5
PASS: the AS and prefix pages now give ages in words through
humanize.Time, which meets the definition of done in #163, and the new test fails on the code before the change.Model: opus-5-5