Design system: dual-theme audit-grade frontend + /dashboard/kpis#16
Merged
Conversation
Four operational KPIs (docs ingested, auto-approved rate, avg confidence, SLA-at-risk) derived entirely from real rows. 24h-vs-prior deltas are emitted only when a comparison window has data, otherwise null/flat — no fabricated numbers. Server-formats display/delta strings so the UI renders verbatim, and exposes raw value/delta for tests. Adds 4 tests + extends the frontend-contract shape test. https://claude.ai/code/session_01Q6uP1XdiuNcMiHmtXCJfed
Replace the flat light-only theme with the audit-grade token layer (:root dark default + [data-theme="light"]). Self-host IBM Plex Sans/Mono via @fontsource (latin subset, offline-safe), add lucide-react, and a useTheme hook persisting localStorage["sentinel-theme"]. An inline pre-paint script in index.html sets data-theme before first paint to avoid a flash. Brand wordmarks/mark added under public/brand. https://claude.ai/code/session_01Q6uP1XdiuNcMiHmtXCJfed
Header shell (themed wordmark, icon nav as router links, theme toggle), Query (eyebrow/card/chips, cited|refused result cards with citation rails), Review (queue bar, code-chip rows, approve/reject, audit-id flash, empty state), and Dashboard (KPI grid + footnote). Recharts kept and restyled with token var() fills + per-bar <Cell> colors (confidence by bucket, SLA by age band) so charts re-theme live. api.ts gains the typed getKpis client. https://claude.ai/code/session_01Q6uP1XdiuNcMiHmtXCJfed
Query: heading matchers relaxed to substrings (headings now lead with a status badge). App: add a /dashboard/kpis fetch-stub branch for the new endpoint. Review: assert the real audit-event id surfaces in the decision flash. https://claude.ai/code/session_01Q6uP1XdiuNcMiHmtXCJfed
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Applies the Sentinel design system (dual-theme, audit-grade) to the existing
frontend/, and adds a real backend endpoint to power the dashboard KPI row. The product's real IA, react-router routes, typed API client, and Recharts are unchanged — only the visual layer changes (plus the new KPI feed). All sample data is synthetic.Implemented from a design handoff after a plan-first review; the KPI row was explicitly scoped to a real endpoint rather than hardcoded numbers.
Backend —
GET /dashboard/kpisA new endpoint returning four operational KPIs, all derived from real rows:
/sla).24h deltas are emitted only when a comparison window has data (otherwise
null/flat) — no fabricated numbers or deltas, per the project's no-fabrication rule.generated_atis a real UTC timestamp so the dashboard footnote shows an honest refresh time. The endpoint server-formatsdisplay/delta_displaystrings (UI renders verbatim) and also exposes rawvalue/deltafor stable assertions.Frontend — design system
styles.css::root(dark, default) +[data-theme="light"]. Every surface/text role is a CSS variable, so switching theme only remaps tokens.localStorage["sentinel-theme"], with an inline pre-paint script inindex.htmlto avoid a flash. Default dark.@fontsource(latin subset → offline-safe, CI-friendly);lucide-reactfor the small fixed icon set.cited/refusedresult cards, code-chip review rows with an audit-id flash, KPI grid + footnote).var()fills + per-bar<Cell>colors (confidence by bucket, SLA by age band), so charts re-theme live with the toggle.Data-honesty notes
/reviewpayload returns. The prototype'sschema.field/value/confidenceare extraction-level details absent from the queue API, so they're not invented.reasoninstead of a hardcoded threshold string.Test impact
/dashboard/kpisfetch-stub branch; Review test asserts the audit-event id surfaces in the flash.Verification
make checkis green locally:tsc -b --noEmitclean;vite buildsucceeds. Dashboard stays lazy-loaded (Recharts in its own vendor chunk).Notes / out of scope
https://claude.ai/code/session_01Q6uP1XdiuNcMiHmtXCJfed
Generated by Claude Code