From d6b341c05374887ba4e12e10d2038db0d3d5267f Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Thu, 23 Apr 2026 10:51:30 +0200 Subject: [PATCH] :bug: Fix color token (#9095) --- .../sidebar/options/menus/color_selection.cljs | 12 +++++------- .../ui/workspace/sidebar/options/rows/color_row.cljs | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/color_selection.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/color_selection.cljs index eac46af116..0ecd41be07 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/color_selection.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/color_selection.cljs @@ -69,12 +69,11 @@ ;; Unique color attribute maps all-colors (distinct (mapv :attrs data)) - ;; Split into: library colors, token colors, and plain colors - library-colors (filterv :ref-id all-colors) + ;; Split into mutually exclusive groups: + ;; token-colors take priority; library-colors and plain colors exclude tokens token-colors (filterv :token-name all-colors) - colors (filterv #(and (nil? (:ref-id %)) - (not (:token-name %))) - all-colors)] + library-colors (filterv (fn [c] (and (some? (:ref-id c)) (nil? (:token-name c)))) all-colors) + colors (filterv (fn [c] (and (nil? (:ref-id c)) (nil? (:token-name c)))) all-colors)] {:groups groups :all-colors all-colors :colors colors @@ -242,8 +241,7 @@ [:div {:class (stl/css :selected-color-group)} (let [token-color-extract (cond->> token-colors (not @expand-token-color) (take 3))] (for [[index token-color] (d/enumerate token-color-extract)] - (let [color {:color (:color token-color) - :opacity (:opacity token-color)}] + (let [color (dissoc token-color :token-name :has-token-applied)] [:> color-row* {:key index :color color diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/rows/color_row.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/rows/color_row.cljs index b7d7bed534..cc8dbb866c 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/rows/color_row.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/rows/color_row.cljs @@ -453,4 +453,5 @@ [:> icon-button* {:variant "ghost" :aria-label (tr "settings.select-this-color") :on-click handle-select + :tooltip-position "top-left" :icon i/move}])]))