diff --git a/apps/desktop-tauri/src/surfaces/settings/tabs/GeneralTab.test.tsx b/apps/desktop-tauri/src/surfaces/settings/tabs/GeneralTab.test.tsx index d5a75202f4..73639873a9 100644 --- a/apps/desktop-tauri/src/surfaces/settings/tabs/GeneralTab.test.tsx +++ b/apps/desktop-tauri/src/surfaces/settings/tabs/GeneralTab.test.tsx @@ -299,3 +299,33 @@ describe("GeneralTab language picker", () => { expect(set).toHaveBeenLastCalledWith({ providerUsageThresholds: {} }); }); }); + + + it("renders the theme picker with auto/light/dark options in general mode", () => { + render(); + + const select = screen.getByRole("combobox", { name: "ThemeLabel" }); + expect(select).toBeInTheDocument(); + expect(select.querySelectorAll("option")).toHaveLength(3); + expect(select.querySelector('option[value="light"]')).not.toBeNull(); + expect(select.querySelector('option[value="dark"]')).not.toBeNull(); + expect(select.querySelector('option[value="auto"]')).not.toBeNull(); + }); + + it("persists a light theme choice via updateSettings", () => { + const set = vi.fn(); + render(); + + const select = screen.getByRole("combobox", { name: "ThemeLabel" }); + fireEvent.change(select, { target: { value: "light" } }); + + expect(set).toHaveBeenCalledWith({ theme: "light" }); + }); + + it("does not render the theme picker in notifications mode", () => { + render( + , + ); + + expect(screen.queryByRole("combobox", { name: "ThemeLabel" })).toBeNull(); + }); \ No newline at end of file diff --git a/apps/desktop-tauri/src/surfaces/settings/tabs/GeneralTab.tsx b/apps/desktop-tauri/src/surfaces/settings/tabs/GeneralTab.tsx index 1b89f68285..e0c4aa0eed 100644 --- a/apps/desktop-tauri/src/surfaces/settings/tabs/GeneralTab.tsx +++ b/apps/desktop-tauri/src/surfaces/settings/tabs/GeneralTab.tsx @@ -10,6 +10,7 @@ import type { NotificationSoundEvent, NotificationSoundPaths, NotificationSoundTheme, + ThemePreference, UsageThresholdOverride, } from "../../../types/bridge"; import type { LocaleKey } from "../../../i18n/keys"; @@ -99,6 +100,13 @@ const NOTIFICATION_SOUND_EVENTS: { const NOTIFICATION_SOUND_THEME_SELECT_MIN_WIDTH = 180; const NOTIFICATION_SOUND_PREVIEW_DURATION_MS = 1500; + +const THEME_OPTIONS: { value: ThemePreference; labelKey: LocaleKey }[] = [ + { value: "auto", labelKey: "ThemeAutoOption" }, + { value: "light", labelKey: "ThemeLightOption" }, + { value: "dark", labelKey: "ThemeDarkOption" }, +] + function fileName(path: string): string { return path.split(/[\\/]/).pop() ?? path; } @@ -261,6 +269,23 @@ export default function GeneralTab({ } + {mode === "general" &&
+

{t("SectionTheme")}

+
+ +