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.
This commit is contained in:
1 parent
5868f045bc
commit
adb3bde4ee
2 files changed
+63
-26
No files matched your search
@@ -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;
|
||||
}
|
||||
@@ -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 (
|
||||
<div style={{ fontFamily: "system-ui, sans-serif", padding: 24, maxWidth: 480 }}>
|
||||
<h1 style={{ fontSize: 18 }}>Admin: manual seed entry</h1>
|
||||
<p style={{ color: "#555", fontSize: 13 }}>
|
||||
<div className={styles.container}>
|
||||
<h1 className={styles.title}>Admin: manual seed entry</h1>
|
||||
<p className={styles.description}>
|
||||
Writes starting configuration (population, resource pools, baseline
|
||||
readings) as signed events into the Event Log. Not for outcome data.
|
||||
</p>
|
||||
@@ -258,33 +259,24 @@ export function AdminSeedPanel({ assemblyDbName, aggregateEndpoint }: AdminSeedP
|
||||
</form>
|
||||
|
||||
{error && (
|
||||
<p role="alert" style={{ color: "#b00020" }}>
|
||||
<p role="alert" className={styles.error}>
|
||||
{error}
|
||||
</p>
|
||||
)}
|
||||
{lastSubmitted && (
|
||||
<p data-testid="seed-success" style={{ color: "#1a7a1a" }}>
|
||||
<p data-testid="seed-success" className={styles.success}>
|
||||
Appended {lastSubmitted} to the Event Log.
|
||||
</p>
|
||||
)}
|
||||
|
||||
<section style={{ marginTop: 24, borderTop: "1px solid #ddd", paddingTop: 16 }}>
|
||||
<h2 style={{ fontSize: 16 }}>
|
||||
<section className={styles.section}>
|
||||
<h2 className={styles.heading}>
|
||||
Load Hollow demo{" "}
|
||||
<span
|
||||
data-testid="demo-data-label"
|
||||
style={{
|
||||
fontSize: 11,
|
||||
color: "#fff",
|
||||
background: "#555",
|
||||
padding: "2px 6px",
|
||||
borderRadius: 4,
|
||||
}}
|
||||
>
|
||||
<span data-testid="demo-data-label" className={styles.demoBadge}>
|
||||
Demo data
|
||||
</span>
|
||||
</h2>
|
||||
<p style={{ color: "#555", fontSize: 13 }}>
|
||||
<p className={styles.description}>
|
||||
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
|
||||
</p>
|
||||
<p
|
||||
data-testid="assembly-demo-fixture-disclaimer"
|
||||
style={{ color: "#8a6d00", fontSize: 12 }}
|
||||
className={styles.disclaimer}
|
||||
>
|
||||
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 && <p data-testid="demo-load-status">{demoStatus}</p>}
|
||||
</section>
|
||||
|
||||
<section style={{ marginTop: 24, borderTop: "1px solid #ddd", paddingTop: 16 }}>
|
||||
<h2 style={{ fontSize: 16 }}>Fair Share: set a survival floor</h2>
|
||||
<p style={{ color: "#555", fontSize: 13 }}>
|
||||
<section className={styles.section}>
|
||||
<h2 className={styles.heading}>Fair Share: set a survival floor</h2>
|
||||
<p className={styles.description}>
|
||||
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
|
||||
</button>
|
||||
</form>
|
||||
{floorError && (
|
||||
<p role="alert" style={{ color: "#b00020" }}>
|
||||
<p role="alert" className={styles.error}>
|
||||
{floorError}
|
||||
</p>
|
||||
)}
|
||||
{floorStatus && <p data-testid="fairshare-floor-status">{floorStatus}</p>}
|
||||
</section>
|
||||
|
||||
<section style={{ marginTop: 24, borderTop: "1px solid #ddd", paddingTop: 16 }}>
|
||||
<h2 style={{ fontSize: 16 }}>Run housing assignment cycle</h2>
|
||||
<p style={{ color: "#555", fontSize: 13 }}>
|
||||
<section className={styles.section}>
|
||||
<h2 className={styles.heading}>Run housing assignment cycle</h2>
|
||||
<p className={styles.description}>
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user