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

An app's settings page draws p75 load per day for 30 days, with gaps for silent days #3239

shipped production is serving it opened this has it
opened this

For #3202's second half. appVisitorsView in src/web/pages/settings.ts shows only today's numbers.

Done looks like:

  • [ ] src/apps/vitals.ts exports loadP75Days(db, appId, at, days = 30): (number | null)[], oldest first. A day with no reports is null. It runs one query grouped by day, not 30 queries.
  • [ ] appVisitorsView draws it with the daySpark helper, server-rendered and with no script. Its label says "p75 load each day over the last 30 days". An app with no reports in 30 days says "No load reports in the last 30 days" in words, with no svg.
  • [ ] Nothing is added outside the design system: no new class, colour literal, style= or off-scale size. bun test test/design-lint.test.ts passes before the push, with docs/design/baseline.json untouched. Run it locally: it is what failed pull #3236.
  • [ ] A test seeds fixture vital rows on days 1, 2 and 4 and checks three things: the gap on day 3 (two polylines), the empty-state sentence, and that loadP75Days returns null for the silent day.

Files: src/apps/vitals.ts, src/web/pages/settings.ts, test/app-vitals-days.test.ts. Risks: the page must stay fast. Index use on the vitals table needs checking, so add an index only if the query plan scans.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs