mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-10-23 14:52:33 +00:00
## Frontend: Timestamp Display Enhancement Refs #286 — implements P0 frontend scope from the [final spec](https://github.com/Kpa-clawbot/CoreScope/issues/286#issuecomment-4158891089). ### What changed **Shared formatter (`public/app.js`)** - `formatTimestamp(isoString, mode)` — returns formatted string ("ago" or absolute) - `formatTimestampWithTooltip(isoString, mode)` — returns `{ text, tooltip, isFuture }` for dual-format hover - `timeAgo()` fixed: null → `"—"`, future timestamps shown with actual value (not clamped) **All surfaces updated** - `public/packets.js` — table rows + detail pane use shared formatter, hover shows opposite format - `public/live.js` — fixed inconsistency (`toLocaleTimeString` → shared formatter), same tooltip treatment - `public/nodes.js` — node timestamps use shared formatter **Future clock skew** - ⚠️ icon shown when timestamp is in the future, tooltip: "Timestamp is in the future — node clock may be skewed" **Customizer (`public/customize.js`)** - New "UI Settings" section with timestamp mode toggle (ago ↔ absolute) - Labeled as global setting - Persists to localStorage (`meshcore-timestamp-mode`), falls back to server default **CSS (`public/style.css`)** - `col-time`: min-width + nowrap for ISO timestamps - Mobile: shorter format (time only) instead of hiding column ### Testing - `node test-frontend-helpers.js` — formatter unit tests (null, ago, absolute, future skew) - `node test-packet-filter.js` — existing tests pass - `node test-aging.js` — existing tests pass Cache busters bumped in `public/index.html`. Co-authored-by: Kpa-clawbot <259247574+Kpa-clawbot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>