From cd84ca2fa6bf03f00aa45a58c210eadb49b0c32e Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 10 Jan 2026 12:28:20 -0500 Subject: [PATCH] feat: Add keyboard shortcut to toggle theme (#11127) closes #11122 --- app/actions/definitions/settings.tsx | 17 ++++++++++++++++- shared/i18n/locales/en_US/translation.json | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/actions/definitions/settings.tsx b/app/actions/definitions/settings.tsx index 9a76c42f65..9b6eed0e62 100644 --- a/app/actions/definitions/settings.tsx +++ b/app/actions/definitions/settings.tsx @@ -25,6 +25,21 @@ export const changeToLightTheme = createAction({ perform: ({ stores }) => stores.ui.setTheme(Theme.Light), }); +export const toggleTheme = createAction({ + name: ({ t }) => t("Toggle theme"), + analyticsName: "Change theme", + iconInContextMenu: false, + icon: ({ stores }) => + stores.ui.resolvedTheme === "light" ? : , + keywords: "theme light day", + section: SettingsSection, + shortcut: ["Meta+Shift+l"], + perform: ({ stores }) => + stores.ui.setTheme( + stores.ui.resolvedTheme === "light" ? Theme.Dark : Theme.Light + ), +}); + export const changeToSystemTheme = createAction({ name: ({ t }) => t("System"), analyticsName: "Change to system theme", @@ -47,4 +62,4 @@ export const changeTheme = createActionWithChildren({ children: [changeToLightTheme, changeToDarkTheme, changeToSystemTheme], }); -export const rootSettingsActions = [changeTheme]; +export const rootSettingsActions = [changeTheme, toggleTheme]; diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 48d1e91d7e..03d32cd05a 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -147,6 +147,7 @@ "Download revision": "Download revision", "Dark": "Dark", "Light": "Light", + "Toggle theme": "Toggle theme", "System": "System", "Appearance": "Appearance", "Change theme": "Change theme",