fix(ui): tick relative timestamps client-side so long-open tabs don't go stale #29

Merged
steve merged 1 commits from fix-stale-reltime into main 2026-06-15 20:19:59 +01:00
Owner

Relative timestamps ("2h ago") were computed once at server render and never updated, so a page left open drifted further from reality the longer it sat — a job-detail page rendered an hour ago kept showing "2h ago" when the truth was "3h ago".

formatRelTime now wraps its label in <time data-rel-ts=…>, and both layouts (base.html, chromeless.html) carry a small ticker that re-renders every 30s.

  • Covered by new cases in internal/server/ui/funcs_test.go
  • go vet ./... and go test ./internal/server/ui/ green
  • Tracked as NS-07 in tasks.md
Relative timestamps ("2h ago") were computed once at server render and never updated, so a page left open drifted further from reality the longer it sat — a job-detail page rendered an hour ago kept showing "2h ago" when the truth was "3h ago". `formatRelTime` now wraps its label in `<time data-rel-ts=…>`, and both layouts (`base.html`, `chromeless.html`) carry a small ticker that re-renders every 30s. - Covered by new cases in `internal/server/ui/funcs_test.go` - `go vet ./...` and `go test ./internal/server/ui/` green - Tracked as NS-07 in tasks.md
steve added 1 commit 2026-06-15 20:19:45 +01:00
docs(tasks): record NS-07 client-side relTime ticker fix
CI / Test (rest) (pull_request) Successful in 1m46s
CI / Test (store) (pull_request) Successful in 2m4s
CI / Lint (pull_request) Successful in 34s
CI / Build (windows/amd64) (pull_request) Successful in 45s
CI / Build (linux/amd64) (pull_request) Successful in 46s
CI / Test (server-http) (pull_request) Failing after 3m32s
CI / Build (linux/arm64) (pull_request) Successful in 47s
e2e / Playwright vs docker-compose (pull_request) Successful in 2m43s
55cb8909c7
steve merged commit 2dae61f678 into main 2026-06-15 20:19:59 +01:00
steve deleted branch fix-stale-reltime 2026-06-15 20:19:59 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: steve/restic-manager#29