diff --git a/apps/docs/islands/ProgressDashboard.tsx b/apps/docs/islands/ProgressDashboard.tsx index 23e99f6..28db14c 100644 --- a/apps/docs/islands/ProgressDashboard.tsx +++ b/apps/docs/islands/ProgressDashboard.tsx @@ -46,7 +46,8 @@ interface Stats { }[]; streak: number; queue: { date: string; due: number }[]; - recent: { date: string; attempts: number; passes: number }[]; + /** Every campaign day, zeros included; this page reads only the tail. */ + heat: { date: string; attempts: number; passes: number }[]; } function isStats(value: unknown): value is Stats { @@ -60,7 +61,7 @@ function isStats(value: unknown): value is Stats { Array.isArray(v.phases) && Array.isArray(v.gates) && Array.isArray(v.queue) && - Array.isArray(v.recent) && + Array.isArray(v.heat) && typeof v.streak === "number" ); } @@ -332,11 +333,14 @@ const GREENS = [ ]; function Recent({ stats }: { stats: Stats }) { + // heat spans the whole campaign, future days and all. The window wanted here + // is the seven days ending today, and campaign.day is that day, 1-based. + const week = stats.heat.slice(Math.max(0, stats.campaign.day - 7), stats.campaign.day); return (