add period comparison deltas to analytics stat cards
All checks were successful
deploy / deploy (push) Successful in 1m21s

Each stat card now shows the percentage change vs the equivalent
previous period (e.g. 30d compares last 30 days vs 30 days before).
Handles zero-baseline with "new" label and caps extreme deltas at
>999%. Seed data extended to 2 years for meaningful 12m comparisons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-23 01:01:25 +00:00
parent 08fcd60eb6
commit 6eda1de1bc
5 changed files with 244 additions and 30 deletions

View File

@@ -62,7 +62,7 @@ defmodule BerrypodWeb.Admin.AnalyticsTest do
{:ok, view, _html} = live(conn, ~p"/admin/analytics")
assert has_element?(view, "rect")
assert has_element?(view, "[data-bars]")
end
test "changes period", %{conn: conn} do