feat: add ui.seamColor accent
This commit is contained in:
@@ -346,6 +346,10 @@ export type ClawdisConfig = {
|
||||
};
|
||||
logging?: LoggingConfig;
|
||||
browser?: BrowserConfig;
|
||||
ui?: {
|
||||
/** Accent color for Clawdis UI chrome (hex). */
|
||||
seamColor?: string;
|
||||
};
|
||||
skillsLoad?: SkillsLoadConfig;
|
||||
skillsInstall?: SkillsInstallConfig;
|
||||
models?: ModelsConfig;
|
||||
@@ -494,6 +498,10 @@ const TranscribeAudioSchema = z
|
||||
})
|
||||
.optional();
|
||||
|
||||
const HexColorSchema = z
|
||||
.string()
|
||||
.regex(/^#?[0-9a-fA-F]{6}$/, "expected hex color (RRGGBB)");
|
||||
|
||||
const SessionSchema = z
|
||||
.object({
|
||||
scope: z.union([z.literal("per-sender"), z.literal("global")]).optional(),
|
||||
@@ -672,6 +680,11 @@ const ClawdisSchema = z.object({
|
||||
attachOnly: z.boolean().optional(),
|
||||
})
|
||||
.optional(),
|
||||
ui: z
|
||||
.object({
|
||||
seamColor: HexColorSchema.optional(),
|
||||
})
|
||||
.optional(),
|
||||
models: ModelsConfigSchema,
|
||||
agent: z
|
||||
.object({
|
||||
|
||||
20
src/config/ui-seam-color.test.ts
Normal file
20
src/config/ui-seam-color.test.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { validateConfigObject } from "./config.js";
|
||||
|
||||
describe("ui.seamColor", () => {
|
||||
it("accepts hex colors", () => {
|
||||
const res = validateConfigObject({ ui: { seamColor: "#FF4500" } });
|
||||
expect(res.ok).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects non-hex colors", () => {
|
||||
const res = validateConfigObject({ ui: { seamColor: "lobster" } });
|
||||
expect(res.ok).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects invalid hex length", () => {
|
||||
const res = validateConfigObject({ ui: { seamColor: "#FF4500FF" } });
|
||||
expect(res.ok).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user