Home

boring / v2

publicBoring-Software-Inc/v2
Overview Code History Branches Pull requestsIssuesInsights Campfire Docs
main
HomeOverview Code PRsIssues

fix(web): home stat cards — number and series tell one story

4 months ago

cb4771e
Authored
grim7/13/2026, 3:48:15 AM
the three home cards contradicted themselves: a card read "0" over a
spiking sparkline (number and series computed over different windows),
series bucketed by clock-hour so "now" was never the right edge, and a
zero delta rendered red ▼0.

- sentToReview: current queue depth + a 24h queue-DEPTH series whose last
  point IS the number (depth(t) = items created ≤ t and not decided by t).
- blocked / passed: 24h verdict flow, series over the same window.
- series bucket by hours-ago (index 23 = now), on home AND /rules.
- retire dead cards (automod · 24h, banned); ship 3, no vanity fourth.
- sent-to-review is the actionable card: first, ringed, scrolls to queue.
- delta colour is explicit per metric (goodDirection up|down|neutral);
  blocked is neutral grey, zero delta omitted. invertDelta prop retired.
- all-zero window renders "not enough data", never a faked flat line.
- /analytics drill-down (moderationMetrics + activity) moved in sync.
- lock the queue-depth invariant with a getHomeStats integration test.

dither chart primitives untouched. checks: typecheck, biome, boundaries,
206 tests.

Parent8884568

12 files changed
  • DECISIONS.md+38−0
  • all-summaries.md+25−0
  • apps/web/src/components/charts/dither-stat-card.tsx+49−25
  • apps/web/src/components/rules/rule-header-stats.tsx+1−1
  • apps/web/src/lib/analytics-activity.functions.ts+14−20
  • apps/web/src/lib/analytics.ts+23−25
  • apps/web/src/lib/moderation.functions.ts+3−4
  • apps/web/src/routes/analytics.tsx
+19
−8
  • apps/web/src/routes/index.tsx+45−47
  • packages/contracts/src/moderation.ts+9−4
  • packages/db/src/services/insights.integration.test.ts+58−0
  • packages/db/src/services/insights.ts+86−61