From a4ada6dc8a4ac99407ed23162cca87554b62598f Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Thu, 25 Sep 2025 08:47:04 +0200 Subject: [PATCH 1/3] :bug: Add default flags for tokens (#7367) --- common/src/app/common/flags.cljc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/flags.cljc b/common/src/app/common/flags.cljc index ff272afffc..7cc41c19f6 100644 --- a/common/src/app/common/flags.cljc +++ b/common/src/app/common/flags.cljc @@ -156,7 +156,9 @@ :enable-dashboard-templates-section :enable-google-fonts-provider :enable-component-thumbnails - :enable-render-wasm-dpr]) + :enable-render-wasm-dpr + :enable-token-units + :enable-token-typography-types]) (defn parse [& flags] From e184a9a8b9b7b8344aec06032bd2aa72d1579043 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Thu, 25 Sep 2025 17:28:46 +0200 Subject: [PATCH 2/3] :bug: Fix context menu on spacing tokens (#7382) --- CHANGES.md | 1 + common/src/app/common/types/token.cljc | 27 ++++++++++++------- .../data/workspace/tokens/application.cljs | 2 +- .../tokens/management/context_menu.cljs | 5 ++-- .../tokens/management/token_pill.cljs | 2 +- .../tokens/logic/token_actions_test.cljs | 8 +++--- 6 files changed, 28 insertions(+), 17 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0135f34f27..844714bfa3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -63,6 +63,7 @@ - Fix conflicting shortcuts (remove dec/inc line height and letter spacing) [Taiga #12102](https://tree.taiga.io/project/penpot/issue/12102) - Fix conflicting shortcuts (remove text-align shortcuts) [Taiga #12047](https://tree.taiga.io/project/penpot/issue/12047) - Fix export file with empty tokens library [Taiga #12137](https://tree.taiga.io/project/penpot/issue/12137) +- Fix context menu on spacing tokens [Taiga #12141](https://tree.taiga.io/project/penpot/issue/12141) ## 2.9.0 diff --git a/common/src/app/common/types/token.cljc b/common/src/app/common/types/token.cljc index 6ae0620efe..02904bdbee 100644 --- a/common/src/app/common/types/token.cljc +++ b/common/src/app/common/types/token.cljc @@ -139,6 +139,13 @@ (def spacing-keys (schema-keys schema:spacing)) +(def ^:private schema:spacing-gap-padding + (-> (reduce mu/union [schema:spacing-gap + schema:spacing-padding]) + (mu/update-properties assoc :title "SpacingGapPaddingTokenAttrs"))) + +(def spacing-gap-padding-keys (schema-keys schema:spacing-gap-padding)) + (def ^:private schema:dimensions (-> (reduce mu/union [schema:sizing schema:spacing @@ -320,9 +327,9 @@ (set/union generic-attributes border-radius-keys)) -(def frame-attributes +(def frame-with-layout-attributes (set/union rect-attributes - spacing-keys)) + spacing-gap-padding-keys)) (def text-attributes (set/union generic-attributes @@ -330,12 +337,14 @@ number-keys)) (defn shape-type->attributes - [type] + [type is-layout] (case type :bool generic-attributes :circle generic-attributes :rect rect-attributes - :frame frame-attributes + :frame (if is-layout + frame-with-layout-attributes + rect-attributes) :image rect-attributes :path generic-attributes :svg-raw generic-attributes @@ -343,14 +352,14 @@ nil)) (defn appliable-attrs - "Returns intersection of shape `attributes` for `token-type`." - [attributes token-type] - (set/intersection attributes (shape-type->attributes token-type))) + "Returns intersection of shape `attributes` for `shape-type`." + [attributes shape-type is-layout] + (set/intersection attributes (shape-type->attributes shape-type is-layout))) (defn any-appliable-attr? "Checks if `token-type` supports given shape `attributes`." - [attributes token-type] - (seq (appliable-attrs attributes token-type))) + [attributes token-type is-layout] + (seq (appliable-attrs attributes token-type is-layout))) ;; Token attrs that are set inside content blocks of text shapes, instead ;; at the shape level. diff --git a/frontend/src/app/main/data/workspace/tokens/application.cljs b/frontend/src/app/main/data/workspace/tokens/application.cljs index d650962b1f..1e2a1bc8f1 100644 --- a/frontend/src/app/main/data/workspace/tokens/application.cljs +++ b/frontend/src/app/main/data/workspace/tokens/application.cljs @@ -487,7 +487,7 @@ (or (and (ctsl/any-layout-immediate-child? objects shape) (some ctt/spacing-margin-keys attributes)) - (ctt/any-appliable-attr? attributes (:type shape)))))) + (ctt/any-appliable-attr? attributes (:type shape) (:layout shape)))))) shape-ids (d/nilv (keys shapes) []) any-variant? (->> shapes vals (some ctk/is-variant?) boolean) diff --git a/frontend/src/app/main/ui/workspace/tokens/management/context_menu.cljs b/frontend/src/app/main/ui/workspace/tokens/management/context_menu.cljs index c053f0a695..08c1c77ff0 100644 --- a/frontend/src/app/main/ui/workspace/tokens/management/context_menu.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/management/context_menu.cljs @@ -341,7 +341,7 @@ (:id token)))}])) (defn- allowed-shape-attributes [shapes] - (reduce into #{} (map #(ctt/shape-type->attributes (:type %)) shapes))) + (reduce into #{} (map #(ctt/shape-type->attributes (:type %) (:layout %)) shapes))) (defn menu-actions [{:keys [type token selected-shapes] :as context-data}] (let [context-data (assoc context-data :allowed-shape-attributes (allowed-shape-attributes selected-shapes)) @@ -445,7 +445,8 @@ (if (some? type) (submenu-actions-selection-actions context-data) (selection-actions context-data)) - (default-actions context-data))] + (default-actions context-data)) + entries (clean-separators entries)] (for [[index {:keys [title action selected? hint submenu no-selectable] :as entry}] (d/enumerate entries)] [:* {:key (dm/str title " " index)} (cond diff --git a/frontend/src/app/main/ui/workspace/tokens/management/token_pill.cljs b/frontend/src/app/main/ui/workspace/tokens/management/token_pill.cljs index b24793a1bf..561b4b17a8 100644 --- a/frontend/src/app/main/ui/workspace/tokens/management/token_pill.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/management/token_pill.cljs @@ -191,7 +191,7 @@ ;; Edge-case for allowing margin attribute on shapes inside layout parent (and selected-inside-layout? (set/subset? ctt/spacing-margin-keys attrs)) (some (fn [shape] - (ctt/any-appliable-attr? attrs (:type shape))) + (ctt/any-appliable-attr? attrs (:type shape) (:layout shape))) selected-shapes))) (def token-types-with-status-icon diff --git a/frontend/test/frontend_tests/tokens/logic/token_actions_test.cljs b/frontend/test/frontend_tests/tokens/logic/token_actions_test.cljs index 1329c9ea8b..9a694dd33c 100644 --- a/frontend/test/frontend_tests/tokens/logic/token_actions_test.cljs +++ b/frontend/test/frontend_tests/tokens/logic/token_actions_test.cljs @@ -296,10 +296,10 @@ frame-1' (cths/get-shape file' :frame-1) frame-2' (cths/get-shape file' :frame-2)] (t/testing "shape `:applied-tokens` got updated" - (t/is (= (:p1 (:applied-tokens frame-1')) (:name token-target'))) - (t/is (= (:p2 (:applied-tokens frame-1')) (:name token-target'))) - (t/is (= (:p3 (:applied-tokens frame-1')) (:name token-target'))) - (t/is (= (:p4 (:applied-tokens frame-1')) (:name token-target'))) + (t/is (= (:p1 (:applied-tokens frame-1')) nil)) + (t/is (= (:p2 (:applied-tokens frame-1')) nil)) + (t/is (= (:p3 (:applied-tokens frame-1')) nil)) + (t/is (= (:p4 (:applied-tokens frame-1')) nil)) (t/is (= (:p1 (:applied-tokens frame-2')) (:name token-target'))) (t/is (= (:p2 (:applied-tokens frame-2')) (:name token-target'))) From d4b7f231c7a8c0ea4abdd271f32531e8b5e792e0 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 29 Sep 2025 12:02:52 +0200 Subject: [PATCH 3/3] :wrench: Add missing config for `:rewind:` on commit checker --- .github/workflows/commit-checker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-checker.yml b/.github/workflows/commit-checker.yml index 60988a4daa..a5f51b7c38 100644 --- a/.github/workflows/commit-checker.yml +++ b/.github/workflows/commit-checker.yml @@ -26,7 +26,7 @@ jobs: - name: Check Commit Type uses: gsactions/commit-message-checker@v2 with: - pattern: '^(Merge|Revert|:(lipstick|globe_with_meridians|wrench|books|arrow_up|arrow_down|zap|ambulance|construction|boom|fire|whale|bug|sparkles|paperclip|tada|recycle):)\s[A-Z].*[^.]$' + pattern: '^(Merge|Revert|:(lipstick|globe_with_meridians|wrench|books|arrow_up|arrow_down|zap|ambulance|construction|boom|fire|whale|bug|sparkles|paperclip|tada|recycle|rewind):)\s[A-Z].*[^.]$' flags: 'gm' error: 'Commit should match CONTRIBUTING.md guideline' checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request