From f76391ecbbc911c3a02ba66a961269be67020134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elena=20Torr=C3=B3?= Date: Thu, 24 Jul 2025 08:43:03 +0200 Subject: [PATCH] :bug: Enable switch to system theme on options menu (#6946) --- CHANGES.md | 1 + frontend/src/app/main/data/profile.cljs | 7 ++----- frontend/src/app/main/ui/workspace/main_menu.cljs | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 8c1d5b8430..d50713d56e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -53,6 +53,7 @@ ### :bug: Bugs fixed - Fix unexpected exception on processing old texts [Github #6889](https://github.com/penpot/penpot/pull/6889) +- Fix UI theme selection from main menu [Taiga #11567](https://tree.taiga.io/project/penpot/issue/11567) ## 2.8.0 diff --git a/frontend/src/app/main/data/profile.cljs b/frontend/src/app/main/data/profile.cljs index f8521484af..75a42c0e26 100644 --- a/frontend/src/app/main/data/profile.cljs +++ b/frontend/src/app/main/data/profile.cljs @@ -20,7 +20,6 @@ [app.plugins.register :as plugins.register] [app.util.i18n :as i18n :refer [tr]] [app.util.storage :as storage] - [app.util.theme :as theme] [beicon.v2.core :as rx] [potok.v2.core :as ptk])) @@ -159,9 +158,6 @@ (update-in state [:profile :theme] (fn [current] (let [current (cond - (= current "system") - (theme/get-system-theme) - ;; NOTE: this is a workaround for ;; the old data on the database ;; where whe have `default` value @@ -172,7 +168,8 @@ current)] (case current "dark" "light" - "light" "dark" + "light" "system" + "system" "dark" ; Failsafe for missing data "dark"))))) diff --git a/frontend/src/app/main/ui/workspace/main_menu.cljs b/frontend/src/app/main/ui/workspace/main_menu.cljs index 2c9be80e5e..3ea6523e64 100644 --- a/frontend/src/app/main/ui/workspace/main_menu.cljs +++ b/frontend/src/app/main/ui/workspace/main_menu.cljs @@ -280,8 +280,8 @@ :data-testid "toggle-theme" :id "file-menu-toggle-theme"} [:span {:class (stl/css :item-name)} - (case (:theme profile) ;; default = dark -> light -> system -> dark and so on - "default" (tr "workspace.header.menu.toggle-light-theme") + (case (:theme profile) ;; dark -> light -> system -> dark and so on + "dark" (tr "workspace.header.menu.toggle-light-theme") "light" (tr "workspace.header.menu.toggle-system-theme") "system" (tr "workspace.header.menu.toggle-dark-theme") (tr "workspace.header.menu.toggle-light-theme"))]