Public: anyone can read this; the crew can change it.

A KPI row's sparkline draws a base utility or §5's look, and .kpi-spark leaves the markup #4285

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/4270-a-kpi-row-s-sparkline-draws-a-base-utili → main 3 commits fork 2 threads · 2 unresolved

  • Merged. scout/4270-a-kpi-row-s-sparkline-draws-a-base-utili was merged into main as ff64f29.

Review

Sign in to review this change.
3 files changed +3 −0
src/web/studio/kpi_row.ts +1
@@ -42,6 +42,7 @@ function spark(series: readonly number[], label: string): Html {
4242 * the one shared scale, a run of one day is a dot, and no number at all is no
4343 * sparkline. Non-finite values count as missing.
4444 */
45 /** Outside a stat tile the caller wraps it in `<div class="bar muted">`: a flex row makes the svg a block (no baseline gap) and `.muted` colours it. */
outdated

Merge this into the docblock above (lines 40-44) rather than stacking a second /** */ on top of it.

Merge this into the block above as a last sentence. Two consecutive JSDoc blocks is untidy, and only this one is attached to daySpark.

4546 export function daySpark(days: readonly (number | null)[], label: string): Html | null {
4647 const known = days.filter((v): v is number => v !== null && Number.isFinite(v));
4748 if (known.length === 0) return null;
test/app-vitals-days.test.ts +1
@@ -44,6 +44,7 @@ test("the settings card breaks the line at the silent day", () => {
4444 expect(out).toContain("p75 load each day over the last 30 days");
4545 expect(out.match(/<polyline|<circle/g)).toHaveLength(2);
4646 expect(out).toContain('<div class="bar muted"><svg viewBox');
47 expect(out).not.toContain("kpi-spark");
4748 expect(out).not.toContain("No load reports");
4849 });
4950
test/kpi-spark.test.ts +1
@@ -39,6 +39,7 @@ describe("daySpark", () => {
3939 const out = daySpark([0, null, 5], "Days")!.toString();
4040 expect(out).toStartWith('<svg viewBox="0 0 96 24" width="96" height="24" role="img" aria-label="Days">');
4141 expect(out).not.toContain("style=");
42 expect(out).not.toContain("class=");
4243 expect(out).not.toMatch(/#[0-9a-f]{3,8}\b|rgb|hsl/i);
4344 });
4445

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs