From 10cf1f09f10d1e723bf64cbc4d8ce43f11fbcf5e Mon Sep 17 00:00:00 2001 From: JSONbored <49853598+JSONbored@users.noreply.github.com> Date: Fri, 10 Jul 2026 04:54:17 -0700 Subject: [PATCH] feat(stats): add accuracy and reuse-rate sparklines to the homepage hero (#4447, #4448) Rides the two trend series already shipped in /v1/public/stats beside their stat tiles instead of a separate /stats page, per the hero-band placement call. Nulls (below-sample weeks) render as a genuine gap, not a fabricated zero. --- .../components/site/control-primitives.tsx | 9 ++- .../site/proof-of-power-stats-model.ts | 42 +++++++++++ .../site/proof-of-power-stats.test.tsx | 34 ++++++++- .../components/site/proof-of-power-stats.tsx | 20 +++++- .../src/components/site/sparkline.tsx | 71 +++++++++++++++++++ apps/gittensory-ui/vitest.setup.ts | 10 +++ 6 files changed, 183 insertions(+), 3 deletions(-) create mode 100644 apps/gittensory-ui/src/components/site/sparkline.tsx diff --git a/apps/gittensory-ui/src/components/site/control-primitives.tsx b/apps/gittensory-ui/src/components/site/control-primitives.tsx index faf6d01de1..2f61b308e7 100644 --- a/apps/gittensory-ui/src/components/site/control-primitives.tsx +++ b/apps/gittensory-ui/src/components/site/control-primitives.tsx @@ -165,17 +165,24 @@ export function Stat({ label, value, hint, + trend, className, }: { label: string; value: ReactNode; hint?: ReactNode; + /** Optional sparkline (or any small trend figure) rendered beside the value -- the "trend" slot from the + * stat-tile contract. Decoupled from any charting library: Stat only lays it out. */ + trend?: ReactNode; className?: string; }) { return (