From adb3bde4ee2d4fe08192096bed05e295dec1a78f Mon Sep 17 00:00:00 2001 From: OmO Orchestrator Date: Fri, 20 Nov 2026 19:57:12 -0500 Subject: [PATCH] refactor(admin): migrate AdminSeedPanel inline styles to a CSS module AdminSeedPanel.tsx was 100% inline-styled with hardcoded hex colors that didn't match the app's real design tokens (e.g. error #b00020 vs the real --color-negative #d4380d). Extract every static style={{...}} into AdminSeedPanel.module.css, mapping each value to the matching token: - #555 text -> var(--color-ink-soft) - #b00020 error -> var(--color-negative) - #1a7a1a success -> var(--color-positive) - #8a6d00 disclaimer -> var(--color-warning-strong) - #ddd section border -> var(--color-border) - 24px/16px spacing -> var(--space-6)/var(--space-4) - system-ui font stack -> var(--sans) Follows the exact class-naming/value convention already used by the sibling AdminAggregatePanel.module.css (container, section, heading, description, error). No layout/structure change; visual proportions are preserved except for the off-brand colors being corrected. Verified: vitest run src/admin/AdminSeedPanel.test.tsx (11/11 passing), npm run build (clean), npx oxlint on both changed files (clean), and a Playwright before/after screenshot comparison of the live /admin route. --- src/admin/AdminSeedPanel.module.css | 45 +++++++++++++++++++++++++++++ src/admin/AdminSeedPanel.tsx | 44 ++++++++++++---------------- 2 files changed, 63 insertions(+), 26 deletions(-) create mode 100644 src/admin/AdminSeedPanel.module.css diff --git a/src/admin/AdminSeedPanel.module.css b/src/admin/AdminSeedPanel.module.css new file mode 100644 index 0000000..313c545 --- /dev/null +++ b/src/admin/AdminSeedPanel.module.css @@ -0,0 +1,45 @@ +.container { + font-family: var(--sans); + padding: var(--space-6); + max-width: 480px; +} + +.title { + font-size: 1.125rem; +} + +.description { + color: var(--color-ink-soft); + font-size: 0.8125rem; +} + +.error { + color: var(--color-negative); +} + +.success { + color: var(--color-positive); +} + +.section { + margin-top: var(--space-6); + border-top: 1px solid var(--color-border); + padding-top: var(--space-4); +} + +.heading { + font-size: 1rem; +} + +.demoBadge { + font-size: 0.6875rem; + color: #fff; + background: var(--color-ink-soft); + padding: 2px 6px; + border-radius: 4px; +} + +.disclaimer { + color: var(--color-warning-strong); + font-size: 0.75rem; +} diff --git a/src/admin/AdminSeedPanel.tsx b/src/admin/AdminSeedPanel.tsx index 8b4ccd8..728ebc4 100644 --- a/src/admin/AdminSeedPanel.tsx +++ b/src/admin/AdminSeedPanel.tsx @@ -1,5 +1,6 @@ import { useState } from "react"; import { append } from "../lib/eventlog"; +import styles from "./AdminSeedPanel.module.css"; import { init as initIdentity } from "../lib/identity"; import { recordHousingAssignmentCycle } from "../lib/housing"; import { @@ -165,9 +166,9 @@ export function AdminSeedPanel({ assemblyDbName, aggregateEndpoint }: AdminSeedP } return ( -
-

Admin: manual seed entry

-

+

+

Admin: manual seed entry

+

Writes starting configuration (population, resource pools, baseline readings) as signed events into the Event Log. Not for outcome data.

@@ -258,33 +259,24 @@ export function AdminSeedPanel({ assemblyDbName, aggregateEndpoint }: AdminSeedP {error && ( -

+

{error}

)} {lastSubmitted && ( -

+

Appended {lastSubmitted} to the Event Log.

)} -
-

+
+

Load Hollow demo{" "} - + Demo data

-

+

One-click bundled starting configuration (population, resource pools, baseline readings) for a cold visitor, appended as signed seed.* events through the exact same Event Log path as manual entry @@ -292,7 +284,7 @@ export function AdminSeedPanel({ assemblyDbName, aggregateEndpoint }: AdminSeedP

Note: any seeded Assembly roster, QV credits, and ballots are demo-fixture data signed by this one device's single identity. They @@ -307,9 +299,9 @@ export function AdminSeedPanel({ assemblyDbName, aggregateEndpoint }: AdminSeedP {demoStatus &&

{demoStatus}

}
-
-

Fair Share: set a survival floor

-

+

+

Fair Share: set a survival floor

+

Guarantees every agent at least this much of a resource before the CEEI market solves the remaining pool - clamped down automatically if it would otherwise exceed what the pool can guarantee everyone. @@ -339,16 +331,16 @@ export function AdminSeedPanel({ assemblyDbName, aggregateEndpoint }: AdminSeedP {floorError && ( -

+

{floorError}

)} {floorStatus &&

{floorStatus}

}
-
-

Run housing assignment cycle

-

+

+

Run housing assignment cycle

+

Cycle-level civic action, not resident-facing: solves one Housing room-slot assignment cycle against the current fairness-debt ledger and signs/appends the result through the real Event Log