From cd51e1c0d8b9f1535b663f180c794c2a3d33cfa2 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Tue, 21 Jul 2026 23:03:35 -0700 Subject: [PATCH] FN-8471: add color theme filtering Add a searchable shared color-theme picker for Settings and Command Center. - Filter translated theme labels case- and diacritic-insensitively - Preserve keyboard navigation, focus management, and selection behavior - Document the picker and add a minor release changeset Files changed: .changeset/fn-8471-theme-filter.md | 7 + docs/dashboard-guide.md | 3 +- .../dashboard/app/components/ThemeDropdown.css | 32 ++++ .../dashboard/app/components/ThemeDropdown.tsx | 172 +++++++++++++++------ .../components/__tests__/ThemeDropdown.test.tsx | 106 +++++++++++++ .../components/__tests__/ThemeSelector.test.tsx | 1 + .../__tests__/CommandCenterControls.test.tsx | 1 + 7 files changed, 277 insertions(+), 45 deletions(-) Fusion-Task-Id: FN-8471 Fusion-Task-Lineage: 1f73dfb8-18bb-48e6-a3ed-0ee3a200cf03 Co-authored-by: Fusion (runfusion.ai) --- .changeset/fn-8471-theme-filter.md | 7 + docs/dashboard-guide.md | 3 +- .../app/components/ThemeDropdown.css | 32 ++++ .../app/components/ThemeDropdown.tsx | 176 +++++++++++++----- .../__tests__/ThemeDropdown.test.tsx | 106 +++++++++++ .../__tests__/ThemeSelector.test.tsx | 1 + .../__tests__/CommandCenterControls.test.tsx | 1 + 7 files changed, 279 insertions(+), 47 deletions(-) create mode 100644 .changeset/fn-8471-theme-filter.md diff --git a/.changeset/fn-8471-theme-filter.md b/.changeset/fn-8471-theme-filter.md new file mode 100644 index 0000000000..8ba4f1641f --- /dev/null +++ b/.changeset/fn-8471-theme-filter.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": minor +--- + +summary: Filter dashboard color themes by name in Settings and Command Center. +category: feature +dev: Uses the shared ThemeDropdown filter without changing persisted theme IDs or selection behavior. diff --git a/docs/dashboard-guide.md b/docs/dashboard-guide.md index 9a4b2c0a95..cf281f4f23 100644 --- a/docs/dashboard-guide.md +++ b/docs/dashboard-guide.md @@ -1961,10 +1961,11 @@ 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. 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. +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 use the same filterable list: type a visible theme name to narrow the displayed labels and color-chip swatches, then select an option to change the theme. Filtering alone never changes the chosen theme. 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. - **Base tokens** (`--bg`, `--surface`, etc.) — redefine in `:root`, `[data-theme="light"]`, and every theme block. - **Semantic tokens** (`--autopilot-pulse`, `--event-error-text`, `--badge-mission-*`, `--fab-*`) — `:root` + `[data-theme="light"]` only; no per-color-theme overrides. diff --git a/packages/dashboard/app/components/ThemeDropdown.css b/packages/dashboard/app/components/ThemeDropdown.css index e73037ce4d..1d7ca67d29 100644 --- a/packages/dashboard/app/components/ThemeDropdown.css +++ b/packages/dashboard/app/components/ThemeDropdown.css @@ -108,6 +108,10 @@ FN-8200 gives the Settings-only current-theme selector breathing room before the color: var(--accent); } +/* +FNXC:DashboardTheming 2026-07-21-12:10: +FN-8471 keeps the shared filter inside the existing popover so the Settings and Command Center variants retain identical desktop and mobile containment. The global input primitive supplies the tokenized field baseline; these selectors add only component layout, focus, and empty-state behavior. +*/ .theme-dropdown-popover { position: absolute; z-index: 10002; @@ -118,6 +122,33 @@ FN-8200 gives the Settings-only current-theme selector breathing room before the border-radius: var(--radius-md); background: var(--surface-1); box-shadow: var(--shadow-lg); + display: grid; + gap: var(--space-sm); + min-inline-size: 0; +} + +.theme-dropdown-filter { + display: block; + min-inline-size: 0; +} + +.theme-dropdown-filter .input { + inline-size: 100%; + min-inline-size: 0; +} + +.theme-dropdown-filter .input:focus-visible { + border-color: var(--accent); + box-shadow: var(--focus-ring); +} + +.theme-dropdown-no-results { + margin: 0; + padding: var(--space-sm); + border-radius: var(--radius-sm); + background: var(--surface); + color: var(--text-muted); + font-size: var(--font-size-sm); } .theme-dropdown-list { @@ -126,6 +157,7 @@ FN-8200 gives the Settings-only current-theme selector breathing room before the max-block-size: min(60vh, calc(var(--space-2xl) * 12)); overflow-y: auto; overscroll-behavior: contain; + min-inline-size: 0; } .theme-dropdown-option { diff --git a/packages/dashboard/app/components/ThemeDropdown.tsx b/packages/dashboard/app/components/ThemeDropdown.tsx index 07f3f61c3b..155c768dd5 100644 --- a/packages/dashboard/app/components/ThemeDropdown.tsx +++ b/packages/dashboard/app/components/ThemeDropdown.tsx @@ -22,6 +22,10 @@ export function resolveColorTheme(colorTheme: ColorTheme) { return COLOR_THEMES.find((theme) => theme.value === colorTheme) ?? COLOR_THEMES[0]; } +function normalizeThemeQuery(value: string) { + return value.trim().normalize("NFD").replace(/\p{Diacritic}/gu, "").toLocaleLowerCase(); +} + function ThemeSwatch({ className }: { className: string }) { return (