mc-dashboard/components
hurkicorgi 9ccd4ca772 Per-player playtime tracking + sparkline hover tooltips
- New GET /api/players/playtime (authed): reads each vanilla stats file
  under /home/minecraft/server/world/stats and maps uuid→name via
  usercache.json. Returns playtime in ticks and hours, plus file mtime
  as "last seen". Memoized 60s via lib/cache#memoAsync.
- New PlaytimeLeaderboard card in the Players tab:
    - Rank, avatar (click → PlayerDrawer), relative last-seen, hours.
    - Top 10 by default with toggle to show all; combined hours badge.
- PlayerDrawer surfaces the player's total hours + last-seen using the
  same cached playtime query, plus fills in UUID if the player is not
  in ops/whitelist/banned.
- lib/time.ts: formatHours() — minutes under 1h, "H.Hh" under a day,
  "Dd Hh" above.
- Analytics sparklines gain hover/touch tooltips:
    - Timestamps threaded through from each MetricEntry.
    - SVG overlay captures onMouseMove/onTouchMove, computes nearest
      index by x, draws a dashed guide line + focus dot.
    - Floating tooltip shows HH:MM + formatted value with unit; edge
      clamping keeps it in-frame at the extremes.
    - Per-chart formatValue so RAM shows GB, CPU 0 decimals, Players
      integer, TPS 1 decimal. Keeps the peak-player marker intact.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 06:24:13 -06:00
..
ui Initial commit: Minecraft dashboard 2026-04-13 00:46:58 -06:00
AdminTabs.tsx Expanded scheduled tasks + keyboard shortcuts 2026-04-13 05:57:39 -06:00
Analytics.tsx Per-player playtime tracking + sparkline hover tooltips 2026-04-13 06:24:13 -06:00
BackupManager.tsx UX polish pass 2: toasts, optimistic updates, mod update detection 2026-04-13 05:11:17 -06:00
ChatBridge.tsx SSE events bridge, PWA service worker, offline banner, lazy admin tabs 2026-04-13 05:48:00 -06:00
ClientOnly.tsx Initial commit: Minecraft dashboard 2026-04-13 00:46:58 -06:00
CommandPalette.tsx Pass 3 first slice: mod update action, error boundaries, a11y, palette 2026-04-13 05:30:23 -06:00
DownloadCard.tsx Initial commit: Minecraft dashboard 2026-04-13 00:46:58 -06:00
ErrorReporter.tsx Bundle analyzer, task run-now/toggle/weekly, error reporter, OG image, a11y 2026-04-13 06:08:48 -06:00
EventsBridge.tsx SSE events bridge, PWA service worker, offline banner, lazy admin tabs 2026-04-13 05:48:00 -06:00
LogViewer.tsx Bundle analyzer, task run-now/toggle/weekly, error reporter, OG image, a11y 2026-04-13 06:08:48 -06:00
ModList.tsx UX/UI/perf pass: admin tabs, theme toggle, log polish, mod search, JAR cache 2026-04-13 04:58:25 -06:00
ModManager.tsx Bundle analyzer, task run-now/toggle/weekly, error reporter, OG image, a11y 2026-04-13 06:08:48 -06:00
Navbar.tsx Pass 3 first slice: mod update action, error boundaries, a11y, palette 2026-04-13 05:30:23 -06:00
OfflineBanner.tsx SSE events bridge, PWA service worker, offline banner, lazy admin tabs 2026-04-13 05:48:00 -06:00
PlayerAvatar.tsx Pass 3 next slice: snapshot polish, analytics depth, player drawer 2026-04-13 05:39:32 -06:00
PlayerDrawer.tsx Per-player playtime tracking + sparkline hover tooltips 2026-04-13 06:24:13 -06:00
PlayerManager.tsx Per-player playtime tracking + sparkline hover tooltips 2026-04-13 06:24:13 -06:00
PlaytimeLeaderboard.tsx Per-player playtime tracking + sparkline hover tooltips 2026-04-13 06:24:13 -06:00
ScheduledTasks.tsx Bundle analyzer, task run-now/toggle/weekly, error reporter, OG image, a11y 2026-04-13 06:08:48 -06:00
ServerControls.tsx Bundle analyzer, task run-now/toggle/weekly, error reporter, OG image, a11y 2026-04-13 06:08:48 -06:00
ServiceWorkerRegister.tsx SSE events bridge, PWA service worker, offline banner, lazy admin tabs 2026-04-13 05:48:00 -06:00
StatusBadge.tsx Initial commit: Minecraft dashboard 2026-04-13 00:46:58 -06:00
StatusCard.tsx Bundle analyzer, task run-now/toggle/weekly, error reporter, OG image, a11y 2026-04-13 06:08:48 -06:00
ThemeToggle.tsx UX/UI/perf pass: admin tabs, theme toggle, log polish, mod search, JAR cache 2026-04-13 04:58:25 -06:00