From d486bf49dd9b19b4e4b7ed7f238b7e0f65a14a5a Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Tue, 21 Jul 2026 18:33:22 -0700 Subject: [PATCH] FN-8456: add Dawn dashboard color theme Add a persisted Dawn indigo-and-amber color theme across dashboard and desktop first paint. - Register Dawn in theme persistence, selector metadata, and pre-hydration validation. - Define dark and light Dawn tokens plus mode-aware selector swatches. - Cover persistence, theme registries, token completeness, and selector previews with tests. Files changed: .changeset/fn-8456-dawn-theme.md | 7 ++ docs/dashboard-guide.md | 3 +- docs/settings-reference.md | 2 +- .../core/src/__tests__/global-settings.test.ts | 8 ++ packages/core/src/types/execution-and-ui.ts | 2 + .../dashboard/app/__tests__/dawn-theme.test.ts | 98 ++++++++++++++++++++++ .../dashboard/app/components/ThemeSelector.css | 14 ++++ .../components/__tests__/ThemeDropdown.test.tsx | 22 ++--- .../components/__tests__/ThemeSelector.test.tsx | 2 +- .../__tests__/CommandCenterControls.test.tsx | 7 +- packages/dashboard/app/components/themeOptions.ts | 1 + .../dashboard/app/hooks/__tests__/useTheme.test.ts | 12 +++ packages/dashboard/app/index.html | 2 +- packages/dashboard/app/public/theme-data.css | 86 ++++++++++++++++++- packages/desktop/src/renderer/index.html | 1 + 15 files changed, 248 insertions(+), 19 deletions(-) Fusion-Task-Id: FN-8456 Fusion-Task-Lineage: 44d9eb05-210d-4be8-8d35-c66ac4857194 Co-authored-by: Fusion (runfusion.ai) --- .changeset/fn-8456-dawn-theme.md | 7 ++ docs/dashboard-guide.md | 3 +- docs/settings-reference.md | 2 +- .../src/__tests__/global-settings.test.ts | 8 ++ packages/core/src/types/execution-and-ui.ts | 2 + .../app/__tests__/dawn-theme.test.ts | 98 +++++++++++++++++++ .../app/components/ThemeSelector.css | 14 +++ .../__tests__/ThemeDropdown.test.tsx | 22 ++--- .../__tests__/ThemeSelector.test.tsx | 2 +- .../__tests__/CommandCenterControls.test.tsx | 7 +- .../dashboard/app/components/themeOptions.ts | 1 + .../app/hooks/__tests__/useTheme.test.ts | 12 +++ packages/dashboard/app/index.html | 2 +- packages/dashboard/app/public/theme-data.css | 86 +++++++++++++++- packages/desktop/src/renderer/index.html | 1 + 15 files changed, 248 insertions(+), 19 deletions(-) create mode 100644 .changeset/fn-8456-dawn-theme.md create mode 100644 packages/dashboard/app/__tests__/dawn-theme.test.ts diff --git a/.changeset/fn-8456-dawn-theme.md b/.changeset/fn-8456-dawn-theme.md new file mode 100644 index 0000000000..be31dfd4bc --- /dev/null +++ b/.changeset/fn-8456-dawn-theme.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": minor +--- + +summary: Add the Dawn indigo-and-amber dashboard color theme. +category: feature +dev: Adds persisted Dawn theme tokens, first-paint support, and shared selector previews. diff --git a/docs/dashboard-guide.md b/docs/dashboard-guide.md index 9c726c6658..e9c359f176 100644 --- a/docs/dashboard-guide.md +++ b/docs/dashboard-guide.md @@ -1960,8 +1960,9 @@ Non-Command-Center dashboard CSS uses `--text` as the canonical primary text tok + -Dark/light modes via `data-theme`; fresh installs default to System mode so the resolved theme follows `prefers-color-scheme` until the user explicitly chooses Light, Dark, or System. 83 color themes via `data-color-theme` (lazy-loaded from `app/public/theme-data.css`), including Cobalt (saturated blue), Clay (warm terracotta), Moss (muted forest green), Aurora (navy/teal/violet dark surfaces with a misty blue-white light counterpart), and Calm (low-stimulation slate/sage dark surfaces with a misty blue-white light counterpart), the Shadcn zinc-neutral theme with an orange default highlight/accent, Shadcn Custom (the same base with sanitized per-token color-picker overrides), and its color family: Shadcn Blue/Green/Red/Purple/Pink/Orange/Yellow, Shadcn Mono and Shadcn Mono Red/Blue/Green/Purple/Pink/Orange/Yellow (grayscale surfaces with color-specific accents; Shadcn Mono retains its selected id), Shadcn Black (pure black and white), Shadcn Gray (fully neutral zinc-gray accent), and Shadcn Gray Blue (blue-gray slate neutral surfaces with a muted slate-blue accent). Air is the minimal, borderless, paper-like preset with near-monochrome tokens and CSS-only chrome flattening. Glass Silver preserves the Glass theme's frosted translucent surfaces and transparent modal overlay behavior while using silver and graphite accents instead of purple/pink. +Dark/light modes via `data-theme`; fresh installs default to System mode so the resolved theme follows `prefers-color-scheme` until the user explicitly chooses Light, Dark, or System. 84 color themes via `data-color-theme` (lazy-loaded from `app/public/theme-data.css`), including Cobalt (saturated blue), Clay (warm terracotta), Moss (muted forest green), Aurora (navy/teal/violet dark surfaces with a misty blue-white light counterpart), Calm (low-stimulation slate/sage dark surfaces with a misty blue-white light counterpart), and Dawn (indigo/plum dark surfaces with muted amber accents and a dawn-white light counterpart), the Shadcn zinc-neutral theme with an orange default highlight/accent, Shadcn Custom (the same base with sanitized per-token color-picker overrides), and its color family: Shadcn Blue/Green/Red/Purple/Pink/Orange/Yellow, Shadcn Mono and Shadcn Mono Red/Blue/Green/Purple/Pink/Orange/Yellow (grayscale surfaces with color-specific accents; Shadcn Mono retains its selected id), Shadcn Black (pure black and white), Shadcn Gray (fully neutral zinc-gray accent), and Shadcn Gray Blue (blue-gray slate neutral surfaces with a muted slate-blue accent). Air is the minimal, borderless, paper-like preset with near-monochrome tokens and CSS-only chrome flattening. Glass Silver preserves the Glass theme's frosted translucent surfaces and transparent modal overlay behavior while using silver and graphite accents instead of purple/pink. Choose color themes from **Settings → Appearance** or from the Command Center **Overview** theme card. Settings merges its selector into the current-theme row, which opens the full color-theme list; Command Center keeps the compact `ThemeDropdown` trigger. Both list every selectable color theme with the same labels and color-chip swatches. The left sidebar active-item highlight and resize accent use the active theme's `--accent`, so they follow the selected Shadcn accent instead of staying fixed blue. diff --git a/docs/settings-reference.md b/docs/settings-reference.md index 8d9ff43824..f44675514b 100644 --- a/docs/settings-reference.md +++ b/docs/settings-reference.md @@ -52,7 +52,7 @@ Defaults from `DEFAULT_GLOBAL_SETTINGS`; key scope from `GLOBAL_SETTINGS_KEYS`. | Setting | Type | Default | Description | |---|---|---:|---| | `themeMode` | `"dark" \| "light" \| "system"` | `"system"` | Dashboard theme mode. Fresh installs follow the operating system light/dark preference until the user chooses Light, Dark, or System. | -| `colorTheme` | `ColorTheme` | `"shadcn-ember"` | Dashboard color theme preset. Aurora is a built-in navy/teal/violet palette with a misty light counterpart; Calm is a low-stimulation slate/sage palette with a misty light counterpart. Use `"shadcn-custom"` to show the separate custom shadcn color picker in Settings → Appearance and the Command Center theme card. | +| `colorTheme` | `ColorTheme` | `"shadcn-ember"` | Dashboard color theme preset. Aurora is a built-in navy/teal/violet palette with a misty light counterpart; Calm is a low-stimulation slate/sage palette with a misty light counterpart; Dawn uses indigo/plum dark surfaces, amber accents, and dawn-white light surfaces. Use `"shadcn-custom"` to show the separate custom shadcn color picker in Settings → Appearance and the Command Center theme card. | | `shadcnCustomColors` | `Record` | `undefined` | Optional shadcn design-token override map for `"shadcn-custom"` only. Keys are CSS token names such as `--accent`, `--bg`, `--surface`, `--card`, `--border`, `--text`, `--text-muted`, workflow status tokens, and `--color-success`/`--color-warning`/`--color-error`; values must be sanitized `#RGB` or `#RRGGBB` hex colors. Missing or invalid entries fall back to the `shadcn-custom` base defaults and are not applied to other themes. | | `language` | `"en" \| "zh-CN" \| "zh-TW" \| "fr" \| "es" \| "ko"` | `undefined` | UI language for the dashboard and TUI. When unset, the dashboard detects from localStorage → browser language and the CLI from `--lang` flag → environment locale, falling back to `en`. Validated at the store write boundary (`validateLocale`); invalid values are dropped. Reset to auto-detect via the dashboard's "Auto" language option or `fn settings set language auto` (clears the persisted key). | | `dashboardFontScalePct` | `number` | `100` | Dashboard font scale percentage used by Appearance settings. Valid range: `85` to `125`; applied pre-hydration via document root font-size so board typography (column headers/counts, task cards, and quick-entry text) scales with the setting from first paint. | diff --git a/packages/core/src/__tests__/global-settings.test.ts b/packages/core/src/__tests__/global-settings.test.ts index 84e311d339..737e9b4080 100644 --- a/packages/core/src/__tests__/global-settings.test.ts +++ b/packages/core/src/__tests__/global-settings.test.ts @@ -245,6 +245,14 @@ describe("GlobalSettingsStore", () => { await expect(new GlobalSettingsStore(dir).getSettings()).resolves.toMatchObject({ colorTheme: "calm" }); }); + it("round-trips the Dawn color theme through persisted settings", async () => { + await store.init(); + await store.updateSettings({ colorTheme: "dawn" }); + + await expect(store.getSettings()).resolves.toMatchObject({ colorTheme: "dawn" }); + await expect(new GlobalSettingsStore(dir).getSettings()).resolves.toMatchObject({ colorTheme: "dawn" }); + }); + it("persists and clears the planner clarification preference", async () => { await store.init(); diff --git a/packages/core/src/types/execution-and-ui.ts b/packages/core/src/types/execution-and-ui.ts index 1837d4382f..8b99625050 100644 --- a/packages/core/src/types/execution-and-ui.ts +++ b/packages/core/src/types/execution-and-ui.ts @@ -125,6 +125,8 @@ export const COLOR_THEMES = [ "aurora", // FNXC:DashboardTheming 2026-07-20-00:00: Calm is persisted; keep its ID and order synchronized across core, selectors, and both pre-hydration validators so saved selections survive validation before React hydrates. "calm", + // FNXC:DashboardTheming 2026-07-20-00:00: Dawn is persisted immediately after Calm; keep this ID and order synchronized across core, selectors, and both first-paint validators so saved selections survive pre-hydration validation. + "dawn", "shadcn", // FNXC:DashboardTheming 2026-06-30-00:00: Shadcn Ember is the default for unset installs; keep it adjacent to the shadcn base so dashboard options and bootstrap validators preserve published theme order while explicit legacy ids remain valid. "shadcn-ember", diff --git a/packages/dashboard/app/__tests__/dawn-theme.test.ts b/packages/dashboard/app/__tests__/dawn-theme.test.ts new file mode 100644 index 0000000000..acfc470b13 --- /dev/null +++ b/packages/dashboard/app/__tests__/dawn-theme.test.ts @@ -0,0 +1,98 @@ +import { readFileSync } from "node:fs"; +import path from "node:path"; +import { describe, expect, it } from "vitest"; +import { COLOR_THEMES as CORE_COLOR_THEMES } from "@fusion/core"; +import { COLOR_THEMES as DASHBOARD_COLOR_THEMES } from "../components/themeOptions"; + +const themeDataPath = path.resolve(__dirname, "../public/theme-data.css"); +const themeSelectorPath = path.resolve(__dirname, "../components/ThemeSelector.css"); +const dashboardIndexPath = path.resolve(__dirname, "../index.html"); +const desktopIndexPath = path.resolve(__dirname, "../../../desktop/src/renderer/index.html"); + +/* +FNXC:DashboardTheming 2026-07-20-00:00: +Dawn is valid only when persistence, first-paint validators, selector metadata, tokens, and globally resolvable previews agree. This source contract catches a partial registration before a saved operator preference can flash or fall back. +*/ +describe("Dawn color theme", () => { + const themeData = readFileSync(themeDataPath, "utf-8"); + const themeSelector = readFileSync(themeSelectorPath, "utf-8"); + const dashboardIndexHtml = readFileSync(dashboardIndexPath, "utf-8"); + const desktopIndexHtml = readFileSync(desktopIndexPath, "utf-8"); + + it("keeps persisted, selector, and first-paint registries in exact order", () => { + const coreIds = [...CORE_COLOR_THEMES]; + const dashboardIds = DASHBOARD_COLOR_THEMES.map((theme) => theme.value); + const dashboardValidThemes = extractValidThemes(dashboardIndexHtml); + const desktopValidThemes = extractValidThemes(desktopIndexHtml); + + expect(CORE_COLOR_THEMES.filter((theme) => theme === "dawn")).toHaveLength(1); + expect(DASHBOARD_COLOR_THEMES).toContainEqual({ + value: "dawn", + label: "Dawn", + className: "theme-swatch-dawn", + }); + expect(dashboardIds).toEqual(coreIds); + expect(dashboardValidThemes).toEqual(coreIds); + expect(desktopValidThemes).toEqual(coreIds); + for (const ids of [coreIds, dashboardIds, dashboardValidThemes, desktopValidThemes]) { + expect(new Set(ids).size).toBe(ids.length); + } + expect(dashboardIndexHtml).toContain("colorTheme = 'shadcn-ember'"); + expect(desktopIndexHtml).toContain('colorTheme = "shadcn-ember"'); + }); + + it("defines complete readable dark and light Dawn token blocks", () => { + const darkBlock = extractSelectorBlock(themeData, '[data-color-theme="dawn"]'); + const lightBlock = extractSelectorBlock(themeData, '[data-color-theme="dawn"][data-theme="light"]'); + const requiredTokens = [ + "--bg:", "--surface:", "--card:", "--border:", "--text:", "--color-success:", + "--color-warning:", "--color-error:", "--color-info:", "--cta-bg:", "--accent:", + "--accent-text:", "--focus-ring:", "--shadow-glow:", + ]; + + for (const block of [darkBlock, lightBlock]) { + for (const token of requiredTokens) expect(block).toContain(token); + } + expect(darkBlock).toContain("--bg: #151229;"); + expect(darkBlock).toContain("--accent: #efb66a;"); + expect(lightBlock).toContain("--bg: #fff8f2;"); + expect(lightBlock).toContain("--accent: #9b5618;"); + }); + + it("uses mode-specific global Dawn preview properties for an unselected swatch", () => { + const darkGlobals = extractSelectorBlock(themeData, ":root"); + const lightGlobals = extractSelectorBlock(themeData, '[data-theme="light"]'); + const darkSwatch = extractSelectorBlock(themeSelector, ".theme-swatch-dawn"); + const lightSwatch = extractSelectorBlock(themeSelector, '[data-theme="light"] .theme-swatch-dawn'); + + for (const block of [darkGlobals, lightGlobals]) { + for (const sample of [1, 2, 3, 4]) expect(block).toContain(`--dawn-swatch-sample-${sample}:`); + } + for (const block of [darkSwatch, lightSwatch]) { + for (const sample of [1, 2, 3, 4]) { + expect(block).toContain(`--swatch-sample-${sample}: var(--dawn-swatch-sample-${sample});`); + } + expect(block).not.toContain("var(--accent)"); + expect(block).not.toContain("var(--bg)"); + } + }); +}); + +function extractValidThemes(html: string): string[] { + const match = html.match(/var validThemes = \[([\s\S]*?)\];/); + if (!match) throw new Error("Could not find pre-hydration validThemes array"); + return [...match[1].matchAll(/["']([^"']+)["']/g)].map((themeMatch) => themeMatch[1]); +} + +function extractSelectorBlock(css: string, selector: string): string { + const startIdx = css.indexOf(`${selector} {`); + if (startIdx === -1) throw new Error(`Could not find selector block: ${selector}`); + const openBraceIdx = css.indexOf("{", startIdx); + let depth = 1; + for (let index = openBraceIdx + 1; index < css.length; index++) { + if (css[index] === "{") depth++; + if (css[index] === "}") depth--; + if (depth === 0) return css.slice(startIdx, index + 1); + } + throw new Error(`Could not find closing brace for selector block: ${selector}`); +} diff --git a/packages/dashboard/app/components/ThemeSelector.css b/packages/dashboard/app/components/ThemeSelector.css index efa1952f53..97b47753af 100644 --- a/packages/dashboard/app/components/ThemeSelector.css +++ b/packages/dashboard/app/components/ThemeSelector.css @@ -326,6 +326,13 @@ --swatch-sample-4: var(--calm-swatch-sample-4); } +.theme-swatch-dawn { + --swatch-sample-1: var(--dawn-swatch-sample-1); + --swatch-sample-2: var(--dawn-swatch-sample-2); + --swatch-sample-3: var(--dawn-swatch-sample-3); + --swatch-sample-4: var(--dawn-swatch-sample-4); +} + .theme-swatch-silver { --swatch-sample-1: #27272a; --swatch-sample-2: #3f3f46; @@ -1167,6 +1174,13 @@ --swatch-sample-4: var(--calm-swatch-sample-4); } +[data-theme="light"] .theme-swatch-dawn { + --swatch-sample-1: var(--dawn-swatch-sample-1); + --swatch-sample-2: var(--dawn-swatch-sample-2); + --swatch-sample-3: var(--dawn-swatch-sample-3); + --swatch-sample-4: var(--dawn-swatch-sample-4); +} + [data-theme="light"] .theme-swatch-silver { --swatch-sample-1: #fafafa; --swatch-sample-2: #f4f4f5; diff --git a/packages/dashboard/app/components/__tests__/ThemeDropdown.test.tsx b/packages/dashboard/app/components/__tests__/ThemeDropdown.test.tsx index bdc6030704..e0d7312bfb 100644 --- a/packages/dashboard/app/components/__tests__/ThemeDropdown.test.tsx +++ b/packages/dashboard/app/components/__tests__/ThemeDropdown.test.tsx @@ -4,7 +4,7 @@ import { fireEvent, render, screen, within } from "@testing-library/react"; import { ThemeDropdown } from "../ThemeDropdown"; // FNXC:Theme 2026-07-16-14:30: FN-8146 pins the historical Settings-grid set, including restored shadcn-mono, so a removal from COLOR_THEMES cannot make the all-themes checks pass circularly. -const EXPECTED_THEME_IDS = ['default', 'ocean', 'forest', 'sunset', 'zen', 'berry', 'high-contrast', 'industrial', 'monochrome', 'slate', 'ash', 'air', 'graphite', 'silver', 'solarized', 'factory', 'factory-mono', 'ayu', 'one-dark', 'nord', 'dracula', 'gruvbox', 'tokyo-night', 'catppuccin-mocha', 'github-dark', 'everforest', 'rose-pine', 'kanagawa', 'night-owl', 'palenight', 'monokai-pro', 'slime', 'brutalist', 'neon-city', 'parchment', 'terminal', 'glass', 'glass-silver', 'horizon', 'vitesse', 'outrun', 'snazzy', 'porple', 'espresso', 'mars', 'poimandres', 'ember', 'rust', 'copper', 'foundry', 'carbon', 'sandstone', 'lagoon', 'frost', 'lavender', 'neon-bloom', 'sepia', 'cobalt', 'clay', 'moss', 'aurora', 'calm', 'shadcn', 'shadcn-ember', 'shadcn-custom', 'shadcn-blue', 'shadcn-green', 'shadcn-red', 'shadcn-purple', 'shadcn-pink', 'shadcn-orange', 'shadcn-yellow', 'shadcn-mono', 'shadcn-mono-red', 'shadcn-mono-blue', 'shadcn-mono-green', 'shadcn-mono-purple', 'shadcn-mono-pink', 'shadcn-mono-orange', 'shadcn-mono-yellow', 'shadcn-black', 'shadcn-gray', 'shadcn-gray-blue'] as const; +const EXPECTED_THEME_IDS = ['default', 'ocean', 'forest', 'sunset', 'zen', 'berry', 'high-contrast', 'industrial', 'monochrome', 'slate', 'ash', 'air', 'graphite', 'silver', 'solarized', 'factory', 'factory-mono', 'ayu', 'one-dark', 'nord', 'dracula', 'gruvbox', 'tokyo-night', 'catppuccin-mocha', 'github-dark', 'everforest', 'rose-pine', 'kanagawa', 'night-owl', 'palenight', 'monokai-pro', 'slime', 'brutalist', 'neon-city', 'parchment', 'terminal', 'glass', 'glass-silver', 'horizon', 'vitesse', 'outrun', 'snazzy', 'porple', 'espresso', 'mars', 'poimandres', 'ember', 'rust', 'copper', 'foundry', 'carbon', 'sandstone', 'lagoon', 'frost', 'lavender', 'neon-bloom', 'sepia', 'cobalt', 'clay', 'moss', 'aurora', 'calm', 'dawn', 'shadcn', 'shadcn-ember', 'shadcn-custom', 'shadcn-blue', 'shadcn-green', 'shadcn-red', 'shadcn-purple', 'shadcn-pink', 'shadcn-orange', 'shadcn-yellow', 'shadcn-mono', 'shadcn-mono-red', 'shadcn-mono-blue', 'shadcn-mono-green', 'shadcn-mono-purple', 'shadcn-mono-pink', 'shadcn-mono-orange', 'shadcn-mono-yellow', 'shadcn-black', 'shadcn-gray', 'shadcn-gray-blue'] as const; function renderedThemeIds(listbox: HTMLElement) { return within(listbox).getAllByRole("option").map((option) => { @@ -88,13 +88,13 @@ describe("ThemeDropdown", () => { it.each([ ["compact", "compact" as const, /ocean/i], ["current-row", "current-row" as const, /current theme dark \/ ocean/i], - ])("selects Calm with a non-empty preview from the shared %s trigger", (_label, triggerVariant, triggerName) => { + ])("selects Dawn with a non-empty preview from the shared %s trigger", (_label, triggerVariant, triggerName) => { document.documentElement.setAttribute("data-color-theme", "ocean"); document.documentElement.setAttribute("data-theme", "dark"); const previewTokens = document.createElement("style"); previewTokens.textContent = ` - :root { --calm-swatch-sample-1: #111d2b; --calm-swatch-sample-2: #1b2a3a; --calm-swatch-sample-3: #8fc9b5; --calm-swatch-sample-4: #7da9c4; } - [data-theme="light"] { --calm-swatch-sample-1: #f4f8fb; --calm-swatch-sample-2: #e1ebf0; --calm-swatch-sample-3: #2f7260; --calm-swatch-sample-4: #396f91; } + :root { --dawn-swatch-sample-1: #151229; --dawn-swatch-sample-2: #2a2248; --dawn-swatch-sample-3: #efb66a; --dawn-swatch-sample-4: #c8a4ff; } + [data-theme="light"] { --dawn-swatch-sample-1: #fff8f2; --dawn-swatch-sample-2: #f1ddd7; --dawn-swatch-sample-3: #9b5618; --dawn-swatch-sample-4: #704eaa; } `; document.head.appendChild(previewTokens); const onColorThemeChange = vi.fn(); @@ -109,14 +109,14 @@ describe("ThemeDropdown", () => { ); fireEvent.click(screen.getByRole("button", { name: triggerName })); - const calmOption = screen.getByRole("option", { name: "Calm" }); - expect(calmOption.querySelector(".theme-swatch-calm")).toBeTruthy(); - expect(calmOption.querySelectorAll(".theme-option-swatch-sample")).toHaveLength(4); + const dawnOption = screen.getByRole("option", { name: "Dawn" }); + expect(dawnOption.querySelector(".theme-swatch-dawn")).toBeTruthy(); + expect(dawnOption.querySelectorAll(".theme-option-swatch-sample")).toHaveLength(4); for (const sample of [1, 2, 3, 4]) { - expect(getComputedStyle(document.documentElement).getPropertyValue(`--calm-swatch-sample-${sample}`).trim()).not.toBe(""); + expect(getComputedStyle(document.documentElement).getPropertyValue(`--dawn-swatch-sample-${sample}`).trim()).not.toBe(""); } - fireEvent.click(calmOption); - expect(onColorThemeChange).toHaveBeenCalledWith("calm"); + fireEvent.click(dawnOption); + expect(onColorThemeChange).toHaveBeenCalledWith("dawn"); expect(screen.queryByRole("listbox")).toBeNull(); document.documentElement.setAttribute("data-theme", "light"); @@ -129,7 +129,7 @@ describe("ThemeDropdown", () => { />, ); for (const sample of [1, 2, 3, 4]) { - expect(getComputedStyle(document.documentElement).getPropertyValue(`--calm-swatch-sample-${sample}`).trim()).not.toBe(""); + expect(getComputedStyle(document.documentElement).getPropertyValue(`--dawn-swatch-sample-${sample}`).trim()).not.toBe(""); } previewTokens.remove(); }); diff --git a/packages/dashboard/app/components/__tests__/ThemeSelector.test.tsx b/packages/dashboard/app/components/__tests__/ThemeSelector.test.tsx index bd908520b3..9b9cfa2d90 100644 --- a/packages/dashboard/app/components/__tests__/ThemeSelector.test.tsx +++ b/packages/dashboard/app/components/__tests__/ThemeSelector.test.tsx @@ -4,7 +4,7 @@ import type { ColorTheme } from "@fusion/core"; import { ThemeSelector } from "../ThemeSelector"; // FNXC:Theme 2026-07-16-14:30: FN-8146 pins the historical Settings-grid set, including restored shadcn-mono, so a removal from COLOR_THEMES cannot make the all-themes checks pass circularly. -const EXPECTED_THEME_IDS = ['default', 'ocean', 'forest', 'sunset', 'zen', 'berry', 'high-contrast', 'industrial', 'monochrome', 'slate', 'ash', 'air', 'graphite', 'silver', 'solarized', 'factory', 'factory-mono', 'ayu', 'one-dark', 'nord', 'dracula', 'gruvbox', 'tokyo-night', 'catppuccin-mocha', 'github-dark', 'everforest', 'rose-pine', 'kanagawa', 'night-owl', 'palenight', 'monokai-pro', 'slime', 'brutalist', 'neon-city', 'parchment', 'terminal', 'glass', 'glass-silver', 'horizon', 'vitesse', 'outrun', 'snazzy', 'porple', 'espresso', 'mars', 'poimandres', 'ember', 'rust', 'copper', 'foundry', 'carbon', 'sandstone', 'lagoon', 'frost', 'lavender', 'neon-bloom', 'sepia', 'cobalt', 'clay', 'moss', 'aurora', 'calm', 'shadcn', 'shadcn-ember', 'shadcn-custom', 'shadcn-blue', 'shadcn-green', 'shadcn-red', 'shadcn-purple', 'shadcn-pink', 'shadcn-orange', 'shadcn-yellow', 'shadcn-mono', 'shadcn-mono-red', 'shadcn-mono-blue', 'shadcn-mono-green', 'shadcn-mono-purple', 'shadcn-mono-pink', 'shadcn-mono-orange', 'shadcn-mono-yellow', 'shadcn-black', 'shadcn-gray', 'shadcn-gray-blue'] as const; +const EXPECTED_THEME_IDS = ['default', 'ocean', 'forest', 'sunset', 'zen', 'berry', 'high-contrast', 'industrial', 'monochrome', 'slate', 'ash', 'air', 'graphite', 'silver', 'solarized', 'factory', 'factory-mono', 'ayu', 'one-dark', 'nord', 'dracula', 'gruvbox', 'tokyo-night', 'catppuccin-mocha', 'github-dark', 'everforest', 'rose-pine', 'kanagawa', 'night-owl', 'palenight', 'monokai-pro', 'slime', 'brutalist', 'neon-city', 'parchment', 'terminal', 'glass', 'glass-silver', 'horizon', 'vitesse', 'outrun', 'snazzy', 'porple', 'espresso', 'mars', 'poimandres', 'ember', 'rust', 'copper', 'foundry', 'carbon', 'sandstone', 'lagoon', 'frost', 'lavender', 'neon-bloom', 'sepia', 'cobalt', 'clay', 'moss', 'aurora', 'calm', 'dawn', 'shadcn', 'shadcn-ember', 'shadcn-custom', 'shadcn-blue', 'shadcn-green', 'shadcn-red', 'shadcn-purple', 'shadcn-pink', 'shadcn-orange', 'shadcn-yellow', 'shadcn-mono', 'shadcn-mono-red', 'shadcn-mono-blue', 'shadcn-mono-green', 'shadcn-mono-purple', 'shadcn-mono-pink', 'shadcn-mono-orange', 'shadcn-mono-yellow', 'shadcn-black', 'shadcn-gray', 'shadcn-gray-blue'] as const; function renderedThemeIds(listbox: HTMLElement) { return within(listbox).getAllByRole("option").map((option) => { diff --git a/packages/dashboard/app/components/command-center/__tests__/CommandCenterControls.test.tsx b/packages/dashboard/app/components/command-center/__tests__/CommandCenterControls.test.tsx index 3da08d1528..021f91a25c 100644 --- a/packages/dashboard/app/components/command-center/__tests__/CommandCenterControls.test.tsx +++ b/packages/dashboard/app/components/command-center/__tests__/CommandCenterControls.test.tsx @@ -74,7 +74,7 @@ function expectCommandCenterUseOffset(testId: string, ratio: number) { } // FNXC:Theme 2026-07-16-14:30: FN-8146 pins the historical Settings-grid set, including restored shadcn-mono, so a removal from COLOR_THEMES cannot make the all-themes checks pass circularly. -const EXPECTED_THEME_IDS = ['default', 'ocean', 'forest', 'sunset', 'zen', 'berry', 'high-contrast', 'industrial', 'monochrome', 'slate', 'ash', 'air', 'graphite', 'silver', 'solarized', 'factory', 'factory-mono', 'ayu', 'one-dark', 'nord', 'dracula', 'gruvbox', 'tokyo-night', 'catppuccin-mocha', 'github-dark', 'everforest', 'rose-pine', 'kanagawa', 'night-owl', 'palenight', 'monokai-pro', 'slime', 'brutalist', 'neon-city', 'parchment', 'terminal', 'glass', 'glass-silver', 'horizon', 'vitesse', 'outrun', 'snazzy', 'porple', 'espresso', 'mars', 'poimandres', 'ember', 'rust', 'copper', 'foundry', 'carbon', 'sandstone', 'lagoon', 'frost', 'lavender', 'neon-bloom', 'sepia', 'cobalt', 'clay', 'moss', 'aurora', 'calm', 'shadcn', 'shadcn-ember', 'shadcn-custom', 'shadcn-blue', 'shadcn-green', 'shadcn-red', 'shadcn-purple', 'shadcn-pink', 'shadcn-orange', 'shadcn-yellow', 'shadcn-mono', 'shadcn-mono-red', 'shadcn-mono-blue', 'shadcn-mono-green', 'shadcn-mono-purple', 'shadcn-mono-pink', 'shadcn-mono-orange', 'shadcn-mono-yellow', 'shadcn-black', 'shadcn-gray', 'shadcn-gray-blue'] as const; +const EXPECTED_THEME_IDS = ['default', 'ocean', 'forest', 'sunset', 'zen', 'berry', 'high-contrast', 'industrial', 'monochrome', 'slate', 'ash', 'air', 'graphite', 'silver', 'solarized', 'factory', 'factory-mono', 'ayu', 'one-dark', 'nord', 'dracula', 'gruvbox', 'tokyo-night', 'catppuccin-mocha', 'github-dark', 'everforest', 'rose-pine', 'kanagawa', 'night-owl', 'palenight', 'monokai-pro', 'slime', 'brutalist', 'neon-city', 'parchment', 'terminal', 'glass', 'glass-silver', 'horizon', 'vitesse', 'outrun', 'snazzy', 'porple', 'espresso', 'mars', 'poimandres', 'ember', 'rust', 'copper', 'foundry', 'carbon', 'sandstone', 'lagoon', 'frost', 'lavender', 'neon-bloom', 'sepia', 'cobalt', 'clay', 'moss', 'aurora', 'calm', 'dawn', 'shadcn', 'shadcn-ember', 'shadcn-custom', 'shadcn-blue', 'shadcn-green', 'shadcn-red', 'shadcn-purple', 'shadcn-pink', 'shadcn-orange', 'shadcn-yellow', 'shadcn-mono', 'shadcn-mono-red', 'shadcn-mono-blue', 'shadcn-mono-green', 'shadcn-mono-purple', 'shadcn-mono-pink', 'shadcn-mono-orange', 'shadcn-mono-yellow', 'shadcn-black', 'shadcn-gray', 'shadcn-gray-blue'] as const; function renderedThemeIds(listbox: HTMLElement) { return within(listbox).getAllByRole("option").map((option) => { @@ -113,9 +113,10 @@ describe("CommandCenterControls concurrency markers", () => { fireEvent.click(trigger); const listbox = screen.getByRole("listbox", { name: "Color theme" }); expect(renderedThemeIds(listbox)).toEqual(EXPECTED_THEME_IDS); - fireEvent.click(screen.getByRole("option", { name: "Ocean" })); + fireEvent.click(screen.getByRole("option", { name: "Dawn" })); - expect(onColorThemeChange).toHaveBeenCalledWith("ocean"); + expect(onColorThemeChange).toHaveBeenCalledWith("dawn"); + expect(screen.queryByRole("listbox")).not.toBeInTheDocument(); }); // FNXC:GlobalConcurrencyControls 2026-07-15-12:00: FN-8007 requires dashboard markers to use the exact native-thumb coordinate system when the expanded range max exceeds the persisted cap. diff --git a/packages/dashboard/app/components/themeOptions.ts b/packages/dashboard/app/components/themeOptions.ts index 2240135fad..62a6414acf 100644 --- a/packages/dashboard/app/components/themeOptions.ts +++ b/packages/dashboard/app/components/themeOptions.ts @@ -77,6 +77,7 @@ export const COLOR_THEMES: { value: ColorTheme; label: string; className: string { value: "moss", label: "Moss", className: "theme-swatch-moss" }, { value: "aurora", label: "Aurora", className: "theme-swatch-aurora" }, { value: "calm", label: "Calm", className: "theme-swatch-calm" }, + { value: "dawn", label: "Dawn", className: "theme-swatch-dawn" }, { value: "shadcn", label: "Shadcn", className: "theme-swatch-shadcn" }, { value: "shadcn-ember", label: "Shadcn Ember (Default)", className: "theme-swatch-shadcn-ember" }, { value: "shadcn-custom", label: "Shadcn Custom", className: "theme-swatch-shadcn-custom" }, diff --git a/packages/dashboard/app/hooks/__tests__/useTheme.test.ts b/packages/dashboard/app/hooks/__tests__/useTheme.test.ts index d1312c7846..70c8377fc8 100644 --- a/packages/dashboard/app/hooks/__tests__/useTheme.test.ts +++ b/packages/dashboard/app/hooks/__tests__/useTheme.test.ts @@ -198,6 +198,18 @@ describe("useTheme", () => { expect(document.documentElement.getAttribute("data-color-theme")).toBe("calm"); }); + it("hydrates, caches, and applies Dawn from backend settings", async () => { + mockFetchGlobalSettings.mockResolvedValue({ colorTheme: "dawn" }); + + const { result } = renderHook(() => useTheme()); + + await waitFor(() => { + expect(result.current.colorTheme).toBe("dawn"); + }); + expect(localStorageMock[COLOR_THEME_STORAGE_KEY]).toBe("dawn"); + expect(document.documentElement.getAttribute("data-color-theme")).toBe("dawn"); + }); + it("hydrates dashboard font scale from backend on mount", async () => { mockFetchGlobalSettings.mockResolvedValue({ dashboardFontScalePct: 110 }); diff --git a/packages/dashboard/app/index.html b/packages/dashboard/app/index.html index f87969d9c0..467535aafb 100644 --- a/packages/dashboard/app/index.html +++ b/packages/dashboard/app/index.html @@ -164,7 +164,7 @@ mode = 'system'; } var colorTheme = localStorage.getItem('kb-dashboard-color-theme') || 'shadcn-ember'; - var validThemes = ['default', 'ocean', 'forest', 'sunset', 'zen', 'berry', 'high-contrast', 'industrial', 'monochrome', 'slate', 'ash', 'air', 'graphite', 'silver', 'solarized', 'factory', 'factory-mono', 'ayu', 'one-dark', 'nord', 'dracula', 'gruvbox', 'tokyo-night', 'catppuccin-mocha', 'github-dark', 'everforest', 'rose-pine', 'kanagawa', 'night-owl', 'palenight', 'monokai-pro', 'slime', 'brutalist', 'neon-city', 'parchment', 'terminal', 'glass', 'glass-silver', 'horizon', 'vitesse', 'outrun', 'snazzy', 'porple', 'espresso', 'mars', 'poimandres', 'ember', 'rust', 'copper', 'foundry', 'carbon', 'sandstone', 'lagoon', 'frost', 'lavender', 'neon-bloom', 'sepia', 'cobalt', 'clay', 'moss', 'aurora', 'calm', 'shadcn', 'shadcn-ember', 'shadcn-custom', 'shadcn-blue', 'shadcn-green', 'shadcn-red', 'shadcn-purple', 'shadcn-pink', 'shadcn-orange', 'shadcn-yellow', 'shadcn-mono', 'shadcn-mono-red', 'shadcn-mono-blue', 'shadcn-mono-green', 'shadcn-mono-purple', 'shadcn-mono-pink', 'shadcn-mono-orange', 'shadcn-mono-yellow', 'shadcn-black', 'shadcn-gray', 'shadcn-gray-blue']; + var validThemes = ['default', 'ocean', 'forest', 'sunset', 'zen', 'berry', 'high-contrast', 'industrial', 'monochrome', 'slate', 'ash', 'air', 'graphite', 'silver', 'solarized', 'factory', 'factory-mono', 'ayu', 'one-dark', 'nord', 'dracula', 'gruvbox', 'tokyo-night', 'catppuccin-mocha', 'github-dark', 'everforest', 'rose-pine', 'kanagawa', 'night-owl', 'palenight', 'monokai-pro', 'slime', 'brutalist', 'neon-city', 'parchment', 'terminal', 'glass', 'glass-silver', 'horizon', 'vitesse', 'outrun', 'snazzy', 'porple', 'espresso', 'mars', 'poimandres', 'ember', 'rust', 'copper', 'foundry', 'carbon', 'sandstone', 'lagoon', 'frost', 'lavender', 'neon-bloom', 'sepia', 'cobalt', 'clay', 'moss', 'aurora', 'calm', 'dawn', 'shadcn', 'shadcn-ember', 'shadcn-custom', 'shadcn-blue', 'shadcn-green', 'shadcn-red', 'shadcn-purple', 'shadcn-pink', 'shadcn-orange', 'shadcn-yellow', 'shadcn-mono', 'shadcn-mono-red', 'shadcn-mono-blue', 'shadcn-mono-green', 'shadcn-mono-purple', 'shadcn-mono-pink', 'shadcn-mono-orange', 'shadcn-mono-yellow', 'shadcn-black', 'shadcn-gray', 'shadcn-gray-blue']; // FNXC:DashboardTheming 2026-06-30-00:00: Unset startup theme is Shadcn Ember; explicit stored legacy ids such as "default" and "ocean" remain valid and must not be migrated. // FNXC:DashboardTheming 2026-07-16-14:30: FN-8146 restores Shadcn Mono as a distinct persisted choice, so bootstrap must retain its stored id instead of remapping it to Mono Red. if (!validThemes.includes(colorTheme)) { diff --git a/packages/dashboard/app/public/theme-data.css b/packages/dashboard/app/public/theme-data.css index 27c72628ea..4d30bed520 100644 --- a/packages/dashboard/app/public/theme-data.css +++ b/packages/dashboard/app/public/theme-data.css @@ -8,7 +8,7 @@ Theme token translucency uses color-mix(in srgb, var(--token) N%, transparent) or exact literal color-mix values for glass surfaces. Raw RGB alpha color functions are banned outside var() fallbacks by FN-6489. ============================================================ */ -/* Aurora and Calm swatches stay globally resolvable while a different theme is active. */ +/* Aurora, Calm, and Dawn swatches stay globally resolvable while a different theme is active. */ :root { --aurora-swatch-sample-1: #0a1022; --aurora-swatch-sample-2: #162044; @@ -18,6 +18,10 @@ --calm-swatch-sample-2: #1b2a3a; --calm-swatch-sample-3: #8fc9b5; --calm-swatch-sample-4: #7da9c4; + --dawn-swatch-sample-1: #151229; + --dawn-swatch-sample-2: #2a2248; + --dawn-swatch-sample-3: #efb66a; + --dawn-swatch-sample-4: #c8a4ff; } [data-theme="light"] { @@ -29,6 +33,10 @@ --calm-swatch-sample-2: #e1ebf0; --calm-swatch-sample-3: #2f7260; --calm-swatch-sample-4: #396f91; + --dawn-swatch-sample-1: #fff8f2; + --dawn-swatch-sample-2: #f1ddd7; + --dawn-swatch-sample-3: #9b5618; + --dawn-swatch-sample-4: #704eaa; } /* OCEAN - Deep blues and cyans */ @@ -7543,3 +7551,79 @@ Calm provides low-stimulation slate-and-sage dark surfaces and misty light surfa --focus-ring: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); --focus-ring-strong: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent); } + +/* +FNXC:DashboardTheming 2026-07-20-00:00: +Dawn pairs deep indigo and plum dark surfaces with muted peach, amber, and violet accents; its light mode uses dawn-white surfaces, plum text, and readable deep amber actions. Global preview values above remain independent of the active theme so unselected Dawn rows retain all four swatch colors. +*/ +[data-color-theme="dawn"] { + --bg: #151229; + --surface: #201a38; + --card: #2a2248; + --card-hover: #352a57; + --surface-hover: color-mix(in srgb, var(--surface) 90%, var(--text) 10%); + --border: #4b3d6e; + --text: #fff1e4; + --text-muted: #d7c0c3; + --text-dim: #9f8498; + + --todo: #8ea8ff; + --in-progress: #8dbde8; + --in-progress-rgb: 141, 189, 232; + --in-review: #c8a4ff; + --triage: #efb66a; + --done: #a391aa; + --color-success: #a7d49b; + --color-warning: #efb66a; + --color-error: #f18a9c; + --color-info: #8dbde8; + + --cta-bg: #d88745; + --cta-border: #f3be7b; + --cta-text: #29150f; + --cta-bg-hover: #e89a57; + --cta-border-hover: #ffdaa3; + --cta-glow: 0 0 8px color-mix(in srgb, var(--cta-border) 30%, transparent); + --accent: #efb66a; + --accent-text: #29150f; + --logo-accent: var(--accent); + --shadow-glow: 0 0 12px color-mix(in srgb, var(--accent) 28%, transparent); + --focus-ring: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent); + --focus-ring-strong: 0 0 0 2px color-mix(in srgb, var(--accent) 36%, transparent); +} + +[data-color-theme="dawn"][data-theme="light"] { + --bg: #fff8f2; + --surface: #faeee8; + --card: #ffffff; + --card-hover: #f1ddd7; + --surface-hover: color-mix(in srgb, var(--surface) 92%, var(--text) 8%); + --border: #d9bec4; + --text: #382137; + --text-muted: #6e5265; + --text-dim: #967987; + + --todo: #4969ae; + --in-progress: #326d94; + --in-progress-rgb: 50, 109, 148; + --in-review: #704eaa; + --triage: #9b5618; + --done: #806d7b; + --color-success: #397447; + --color-warning: #9b5618; + --color-error: #b23d58; + --color-info: #326d94; + + --cta-bg: #9b5618; + --cta-border: #7b4212; + --cta-text: #ffffff; + --cta-bg-hover: #7f4614; + --cta-border-hover: #63350f; + --cta-glow: 0 0 8px color-mix(in srgb, var(--cta-border) 24%, transparent); + --accent: #9b5618; + --accent-text: #ffffff; + --logo-accent: var(--accent); + --shadow-glow: 0 0 10px color-mix(in srgb, var(--accent) 20%, transparent); + --focus-ring: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); + --focus-ring-strong: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent); +} diff --git a/packages/desktop/src/renderer/index.html b/packages/desktop/src/renderer/index.html index 0d1f14b97c..5b8ac9a8db 100644 --- a/packages/desktop/src/renderer/index.html +++ b/packages/desktop/src/renderer/index.html @@ -77,6 +77,7 @@ "moss", "aurora", "calm", + "dawn", "shadcn", "shadcn-ember", "shadcn-custom",