Derive the gem-blue palette with OKLCH tonal and complementary-color rules while preserving acrylic opacity, blur and surface hierarchy. Darker focus tokens exposed stacked field rings, fallback outlines and persistent basemap selection rings. Keep fallback focus styles in the base layer and use one themed field boundary or inset card stroke. Preserve keyboard focus, invalid states and native input semantics. Add browser regression coverage for pointer and keyboard focus, all basemap presentations, narrow layouts and rendered contrast. Validation in an isolated checkout: pnpm lint, pnpm typecheck, pnpm test (393 tests), focused browser suites and pnpm build.
43 lines
1.6 KiB
TypeScript
43 lines
1.6 KiB
TypeScript
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
|
|
const statusTones = ["neutral", "info", "success", "warning", "danger"] as const;
|
|
|
|
describe("semantic status language", () => {
|
|
it("defines the complete semantic token set", () => {
|
|
const styles = readFileSync(join(process.cwd(), "src/styles.css"), "utf8");
|
|
|
|
statusTones.forEach((tone) => {
|
|
expect(styles).toContain(`--status-${tone}-soft:`);
|
|
expect(styles).toContain(`--status-${tone}-border:`);
|
|
expect(styles).toContain(`--status-${tone}-foreground:`);
|
|
expect(styles).toContain(`--status-${tone}-mark:`);
|
|
expect(styles).toContain(`.status-tone-${tone}`);
|
|
});
|
|
});
|
|
|
|
it("stops shared status motion when reduced motion is requested", () => {
|
|
const styles = readFileSync(join(process.cwd(), "src/styles.css"), "utf8");
|
|
|
|
expect(styles).toMatch(
|
|
/@media \(prefers-reduced-motion: reduce\)[\s\S]*?\.status-dot\[data-activity="live"\][\s\S]*?animation:\s*none/
|
|
);
|
|
});
|
|
|
|
it("does not derive Agent connection styling from localized copy", () => {
|
|
const agentHook = readFileSync(
|
|
join(process.cwd(), "src/features/workbench/hooks/use-workbench-agent.ts"),
|
|
"utf8"
|
|
);
|
|
const agentPanel = readFileSync(
|
|
join(process.cwd(), "src/features/agent/components/agent-command-panel.tsx"),
|
|
"utf8"
|
|
);
|
|
|
|
expect(agentPanel).not.toMatch(/statusLabel\.(?:includes|match|startsWith)/);
|
|
expect(agentPanel).not.toContain("getAgentConnection");
|
|
expect(agentHook).not.toContain("runtimeAvailability");
|
|
expect(agentPanel).toContain("AgentConnectionStatus");
|
|
});
|
|
});
|