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

opened this

Merged 45d 15h ago, live in production

The day sparkline (daySpark in src/web/studio/kpirow.ts) now carries the base .muted utility from style/base.ts instead of .kpi-spark. The svg keeps its viewBox, width and height, role="img" and escaped aria-label.

Notes

opened this

The day sparkline (daySpark in src/web/studio/kpi_row.ts) now carries the base .muted utility from style/base.ts instead of .kpi-spark. The svg keeps its viewBox, width and height, role="img" and escaped aria-label. tsc, bun scripts/design-lint.ts and the five tests I ran (kpi-spark, home-kpi-page, home-kpi-row, app-vitals-days, design-lint) pass.

  • Which sparkline: daySpark is the one the app settings page uses for its visitors card. The two KPI-tile sparklines (sparkline and visitorsSpark) never carried the class.
  • Test: test/kpi-spark.test.ts now expects class="muted" and asserts kpi-spark is absent.
  • Left out (part two): the .kpi-spark rule in feed_style.ts and the §5d entry in docs/DESIGN.md, as the issue says.
  • Possible layout change: .muted sets only the colour, so the svg is no longer display:block with max-width:100%. It's inline, which could add a small baseline gap under it. Its width is fixed at 96 px, so I don't expect overflow, but I couldn't check it in a browser.

Closes #4270

commented

I took the second point and left the first for part two. tsc, bun scripts/design-lint.ts and the four test files I ran (kpi-spark, home-kpi-page, app-vitals-days, design-lint) pass.

  • Layout (taken): the svg no longer carries a class. appVisitorsView in src/web/pages/settings.ts now wraps daySpark's output in <div class="stack muted mt">. .stack is a flex column, so the svg becomes a block item with no baseline gap, and .muted supplies the colour. I didn't add a class. This is the sparkline's only caller outside a stat tile.
  • Overflow: the svg has a fixed 96 px width inside a card wider than that, so I don't expect it to overflow. I couldn't check this in a browser.
  • Tests: test/app-vitals-days.test.ts asserts the wrapper and the absence of kpi-spark. test/kpi-spark.test.ts asserts the svg itself has no class.
  • Not done: deleting the .kpi-spark rule and its docs/DESIGN.md entry. Issue #4270 says part one must not delete the rules or edit docs/DESIGN.md, and part two (the stylesheet and docs) does that. The design check stays green because the class is still defined and named. The rule has no markup users now, so part two can remove it with no other change. If you'd rather fold the deletion into this pull, say so and I'll do it.
commented

I merged main into the branch and pushed. tsc, bun scripts/design-lint.ts and the four test files I ran (kpi-spark, app-vitals-days, home-kpi-page, design-lint) pass. I did not run the full suite.

The conflicts in src/web/pages/settings.ts and test/app-vitals-days.test.ts came from main also wrapping the day sparkline, in <div class="bar muted">. I kept main's wrapper and dropped my .stack muted mt one.

I also kept my assertion that kpi-spark is absent from the settings card. The comment on daySpark in src/web/studio/kpi_row.ts now names .bar muted instead of .stack muted.

As before, the .kpi-spark rule in feed_style.ts and its docs/DESIGN.md entry stay for part two of #4270.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs