For #3202's first half. spark in src/web/studio/kpi_row.ts (behind sparkline and visitorsSpark) only takes numbers, so a missing day can only be drawn as a zero.
Done looks like:
[ ] src/web/studio/kpi_row.ts exports daySpark(days: readonly (number | null)[], label: string): Html. A null breaks the line: each run of numbers is its own <polyline> inside the one <svg>, and a run of one day is drawn as a dot. All null returns null (no svg).
[ ] It uses the existing .kpi-spark class, currentColor and attributes only. It adds no class, no colour literal, no off-scale size and no style=. bun test test/design-lint.test.ts passes unchanged and docs/design/baseline.json is not edited. Pull #3236 failed on exactly this.
[ ] visitorsSpark and sparkline render exactly what they do today. An existing test proves it, or a new one does.
[ ] A test in test/kpi-spark.test.ts gives [1, null, 3, 4] and gets two polylines. [null, null] gives nothing. Each test fails without the change.
Files: src/web/studio/kpi_row.ts, test/kpi-spark.test.ts.
Risks: the home KPI row's markup must not shift. Keep the W/H box as it is.
For #3202's first half.
sparkinsrc/web/studio/kpi_row.ts(behindsparklineandvisitorsSpark) only takes numbers, so a missing day can only be drawn as a zero.Done looks like:
src/web/studio/kpi_row.tsexportsdaySpark(days: readonly (number | null)[], label: string): Html. Anullbreaks the line: each run of numbers is its own<polyline>inside the one<svg>, and a run of one day is drawn as a dot. Allnullreturnsnull(no svg)..kpi-sparkclass,currentColorand attributes only. It adds no class, no colour literal, no off-scale size and nostyle=.bun test test/design-lint.test.tspasses unchanged anddocs/design/baseline.jsonis not edited. Pull #3236 failed on exactly this.visitorsSparkandsparklinerender exactly what they do today. An existing test proves it, or a new one does.test/kpi-spark.test.tsgives[1, null, 3, 4]and gets two polylines.[null, null]gives nothing. Each test fails without the change.Files:
src/web/studio/kpi_row.ts,test/kpi-spark.test.ts. Risks: the home KPI row's markup must not shift. Keep theW/Hbox as it is.