Light palette, chosen from the terminal's background or the Colours setting

This commit is contained in:
Callum Alpass committed 2026-11-02 23:21:55 +11:00
1 parent 3ef67c5b50
commit 49fc25f7a2
11 files changed
+91 -42

No files matched your search

+1 -1
View File
@@ -28,7 +28,7 @@ describe("config", () => {
test("labels settings for the settings view", () => {
const rows = settingRows({ ...DEFAULT_CONFIG, followUpBehavior: "queue" });
expect(rows.map((row) => row.key)).toEqual(["followUpBehavior", "sendShortcut", "timestampFormat", "diffIgnoreWhitespace", "notificationMode", "inAppNotificationsEnabled"]);
expect(rows.map((row) => row.key)).toEqual(["followUpBehavior", "sendShortcut", "timestampFormat", "diffIgnoreWhitespace", "notificationMode", "inAppNotificationsEnabled", "theme"]);
expect(rows[0]?.value).toBe("queues");
});
});
+15
View File
@@ -0,0 +1,15 @@
import { afterEach, expect, test } from "bun:test";
import { applyTheme, colors, statusColor, toneColor } from "../src/ui/theme.ts";
afterEach(() => applyTheme("dark"));
test("the light palette replaces every colour, and the tone maps follow it", () => {
const dark = { ...colors };
applyTheme("light");
for (const key of Object.keys(dark) as (keyof typeof dark)[]) expect(colors[key]).not.toBe(dark[key]);
expect(statusColor("bad")).toBe(colors.bad);
expect(toneColor("normal")).toBe(colors.text);
applyTheme("dark");
expect(colors).toEqual(dark);
});