mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
A "Popularity" item in the video ⋯ menu opens a public views-over-time chart (view data is public). Builds on the now-trustworthy view counts (#4). - buildViewCountTimeSeries buckets raw kind-30079 view events by the counter's dedupe window (one view per viewer per day) into a cumulative series. - buildViewCountChartSvg renders a token-colored (currentColor / text-accent) SVG area+line chart — no charting library, no raw colors. - The modal fetches via listVideoViewEventsWithDefaultClient, shows the total, and updates LIVE by subscribing to view events (debounced re-render); cleans up on close (Esc / backdrop / ✕). Lazy-loaded from the menu handler so it only ships when opened. New size tokens for the modal; reuses .ds-overlay-backdrop for the scrim. Tests: tests/view-count-chart.test.mjs (cumulative dedupe, junk filtering, SVG line/area + empty/single-point). Co-Authored-By: Claude Opus 4.8 <[email protected]>