From 4e2d060cedbcc2fe481ef80ebebca1ab735b7e32 Mon Sep 17 00:00:00 2001 From: DANNY NA Date: Thu, 3 Sep 2026 16:27:28 +0900 Subject: [PATCH 1/9] feat(dashboard): apply G2 Barrier Membrane redesign to all routes Redesign Overview, Audit, Policies, and Approvals on top of the existing components, API client, polling hooks, and routing; no new routes. - index.css: oklch design tokens (dark primary, light secondary with reduced depth), Tailwind @theme bridge, double-bezel Panel, mono verdict pills with glyphs (checkmark ALLOWED/APPROVED, pause PAUSED, cross DENIED/REJECTED), cyan primary Approve + red-outline Deny actions, global :focus-visible, reduced-motion-aware reveal - App shell: lowercase mono "honmoon" wordmark + cyan mark, right command capsule (nav, live pending badge, gateway reachability derived from the approvals poll, account area) - Overview: status hero derived from live data, pending-approval strip with shared per-id busy actions, KPI tiles, latest 8 decisions, decision mix; API errors stay explicit and never look like a healthy empty state - Audit: same Time/Decision/Request/Rule columns; loading/error/empty/ populated states; request truncation keeps the full value in title - Policies: keeps Prism + react-simple-code-editor (and the CJS unwrap workaround), adds gutter line numbers and G2 Prism token colours (prism-tomorrow theme dropped), local-only edits, "Reset to active" only when dirty, Phase 5 hot-reload note; no save/deploy actions - Approvals: useApprovalActions hook (Set-based per-id busy) shared with Overview; approve/reject + refresh, empty/error states preserved - Nav label "Audit Log" renamed to "Audit" Verified: typecheck, build, build:demo, and eslint all pass; manual dark/light browser verification of all states. --- apps/dashboard/AGENTS.md | 5 +- apps/dashboard/src/App.tsx | 103 +++-- .../src/components/ApprovalActions.tsx | 54 +++ apps/dashboard/src/components/Approvals.tsx | 199 +++++----- apps/dashboard/src/components/AuditLog.tsx | 131 ++++--- .../src/components/DecisionBadge.tsx | 25 +- apps/dashboard/src/components/Overview.tsx | 328 +++++++++++++--- apps/dashboard/src/components/PolicyView.tsx | 168 +++++--- apps/dashboard/src/components/ui.tsx | 94 +++++ apps/dashboard/src/hooks.ts | 33 ++ apps/dashboard/src/index.css | 367 ++++++++++++++++++ 11 files changed, 1225 insertions(+), 282 deletions(-) create mode 100644 apps/dashboard/src/components/ApprovalActions.tsx create mode 100644 apps/dashboard/src/components/ui.tsx diff --git a/apps/dashboard/AGENTS.md b/apps/dashboard/AGENTS.md index c25a04c..64895b9 100644 --- a/apps/dashboard/AGENTS.md +++ b/apps/dashboard/AGENTS.md @@ -39,8 +39,9 @@ rust-embed handler needs a rewrite rule). Unknown hashes fall back to Overview: | Path | What | |------|------| | `src/main.tsx` / `src/App.tsx` | Entry point; hash router + shell over the four views. | -| `src/components/` | `Overview`, `AuditLog`, `PolicyView`, `Approvals`, `DecisionBadge`. | -| `src/api.ts` / `src/hooks.ts` / `src/format.ts` | Typed management-API client, `usePolling`, formatters. | +| `src/components/` | `Overview`, `AuditLog`, `PolicyView`, `Approvals`, plus shared pieces: `DecisionBadge` (glyph + mono verdict pill), `ApprovalActions` (Deny / Approve pair), `ui` (`Panel` double bezel, `PageHead`, `ErrorNote`, `PanelState`). | +| `src/api.ts` / `src/hooks.ts` / `src/format.ts` | Typed management-API client, `usePolling` + `useApprovalActions` (per-id busy set), formatters. | +| `src/index.css` | G2 "Barrier Membrane" tokens (oklch, dark primary / light secondary), Tailwind `@theme` bridge, and the few component classes (`bezel`/`glass`, `verdict-*`, `action-*`, Prism YAML token colors). | | `demo/demo-mode.js` | Demo shim: patches `window.fetch` with in-memory fixtures, runs a scripted timeline, mounts the "demo" badge. Plain browser JS, no bundler. | | `demo/build.ts` | Copies `dist/` → `dist-demo/` and injects the shim's `