statistics block last event should be relative time (e.g. "2s", "3d4h") with timestamp in hover tooltip #567

Open
opened 2026-10-26 13:35:48 +01:00 by sneak · 1 comment
Owner
No description provided.
clawbot self-assigned this 2026-10-26 13:50:44 +01:00
Collaborator

Definition of done.

  • Where: the "Last event" figure in the Statistics block at the top of the webhook page (templates/webhook_stats.html). Nothing else changes.
  • Format: the time since the last event, cut to whole seconds, as its two largest units from d, h, m, s, with no spaces: under a minute 0s to 59s, then 1m1s to 59m59s, 1h to 23h59m, 1d and up (3d4h, 400d3h; days are the largest unit). A second unit that is zero is left off: 5m, 2h, 1d. An event time ahead of the server clock shows 0s. It is worked out when the page is served and does not tick, like the other figures in the block.
  • No event: none, as now, with no tooltip.
  • Tooltip: the title of the figure is the event time in UTC as 2006-01-02 15:04:05 UTC, the format the block shows today.
  • Tests: a unit test of the formatting at each unit boundary (0s, 59.9s, 60s, 61s, 3599s, 3600s, 3660s, 86399s, 86400s, 90000s, and a future time), and the headless-browser test in its container showing the page renders the relative figure with that tooltip.

Judgement call: leaving off a zero second unit (5m, not 5m0s).

Model: opus-5-5

Definition of done. - **Where:** the "Last event" figure in the Statistics block at the top of the webhook page (`templates/webhook_stats.html`). Nothing else changes. - **Format:** the time since the last event, cut to whole seconds, as its two largest units from `d`, `h`, `m`, `s`, with no spaces: under a minute `0s` to `59s`, then `1m1s` to `59m59s`, `1h` to `23h59m`, `1d` and up (`3d4h`, `400d3h`; days are the largest unit). A second unit that is zero is left off: `5m`, `2h`, `1d`. An event time ahead of the server clock shows `0s`. It is worked out when the page is served and does not tick, like the other figures in the block. - **No event:** `none`, as now, with no tooltip. - **Tooltip:** the `title` of the figure is the event time in UTC as `2006-01-02 15:04:05 UTC`, the format the block shows today. - **Tests:** a unit test of the formatting at each unit boundary (0s, 59.9s, 60s, 61s, 3599s, 3600s, 3660s, 86399s, 86400s, 90000s, and a future time), and the headless-browser test in its container showing the page renders the relative figure with that tooltip. Judgement call: leaving off a zero second unit (`5m`, not `5m0s`). Model: opus-5-5
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#567