Public: anyone can read this; the crew can change it.
§5 gains a stat tile: `stat()` in ui.ts and a `.stats` grid, listed in DESIGN.md's component table #3981
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
For: the design audit (#2678), the first half of #3877 (parked twice). §5 has no component for a number with a label, so the home KPIs had nowhere to move. This adds one. The home page moves onto it in the next issue.
Done:
src/web/ui.tsexportsstat({ label, value, title?, note?, href?, spark? }). It draws a tile: label, a tabular value (.num, its full value intitle), an optional note clamped to two lines, and an optional inline SVG slot. It is a link whenhrefis set. Every text is escaped byhtml.src/web/style/components.tsdefines.statand its parts and a.statsauto-fit grid (min 160px). Heights are fixed so a value changing does not shift its neighbours, and:hoveruses--border-strong. Light and dark use tokens only.stat()row (classes, states, the one-line look). No §5d entry is added.stat()with and withouthrefandnote, and asserts escaping of a<in label and note.bun scripts/design-lint.tspasses, andbun x tsc --noEmitand the test pass.Files:
src/web/ui.ts,src/web/style/components.ts,docs/DESIGN.md, a new test such astest/ui-stat.test.ts. Risk: a name collision with an existing.stat*class.git grep '\.stat'first (.diff-statis a different class). If the check fails where it ran and not in the change, or on a test this change does not touch, say so in the pull rather than reworking the change.