From ee422e87ba788abd568617a1daa2ab19e186abbe Mon Sep 17 00:00:00 2001 From: Xavier Julian Date: Tue, 9 Dec 2025 14:17:27 +0100 Subject: [PATCH] :recycle: Cleanup pull request --- common/src/app/common/path_names.cljc | 10 ++--- frontend/playwright/ui/specs/tokens.spec.js | 1 - .../app/main/ui/ds/layers/layer_button.scss | 37 ------------------- .../ui/workspace/tokens/management/group.cljs | 1 - .../tokens/management/token_tree.cljs | 10 ++--- 5 files changed, 6 insertions(+), 53 deletions(-) diff --git a/common/src/app/common/path_names.cljc b/common/src/app/common/path_names.cljc index c83b129b89..74774c0044 100644 --- a/common/src/app/common/path_names.cljc +++ b/common/src/app/common/path_names.cljc @@ -147,18 +147,16 @@ Some naming conventions: [{:name 'one' :path 'one' :depth 0 - :is-leaf false - :has-children true + :leaf nil :children-fn (fn [] [{:name 'two' :path 'one.two' :depth 1 - :is-leaf false - :has-children true + :leaf nil :children-fn (fn [] [{... :name 'three'} {... :name 'four'}])} {:name 'five' :path 'one.five' :depth 1 - :is-leaf true + :leaf {... :name 'five'} ...}])}]" (defn- sort-by-children @@ -209,9 +207,7 @@ Some naming conventions: node {:name segment-name :path current-path :depth depth - :is-leaf is-leaf? :leaf leaf-segment - :has-children (not is-leaf?) :children-fn (when-not is-leaf? (fn [] (let [grouped-elements (sort-and-group-segments remaining-segments separator)] diff --git a/frontend/playwright/ui/specs/tokens.spec.js b/frontend/playwright/ui/specs/tokens.spec.js index d2adfb769a..3ad2dd2b67 100644 --- a/frontend/playwright/ui/specs/tokens.spec.js +++ b/frontend/playwright/ui/specs/tokens.spec.js @@ -254,7 +254,6 @@ const unfoldTokenTree = async (tokensTabPanel, type, tokenName) => { }) .first(); - console.log(await typeSectionButton.getAttribute("aria-expanded")); const isSectionExpanded = await typeSectionButton.getAttribute("aria-expanded"); diff --git a/frontend/src/app/main/ui/ds/layers/layer_button.scss b/frontend/src/app/main/ui/ds/layers/layer_button.scss index e1a10ff218..56e59e8acf 100644 --- a/frontend/src/app/main/ui/ds/layers/layer_button.scss +++ b/frontend/src/app/main/ui/ds/layers/layer_button.scss @@ -54,40 +54,3 @@ background-color: var(--color-background-tertiary); border-radius: $br-6; } - -// .layer-button-name { -// margin-inline-start: var(--sp-xs); -// } - -// .button { -// @extend %base-button; - -// @include use-typography("headline-small"); -// padding: 0 var(--sp-m); - -// display: inline-flex; -// align-items: center; -// column-gap: var(--sp-xs); -// } - -// .button-primary { -// @extend %base-button-primary; -// } - -// .button-secondary { -// @extend %base-button-secondary; -// } - -// .button-ghost { -// @extend %base-button-ghost; -// } - -// .button-destructive { -// @extend %base-button-destructive; -// } - -// .button-link { -// &:hover { -// text-decoration: none; -// } -// } diff --git a/frontend/src/app/main/ui/workspace/tokens/management/group.cljs b/frontend/src/app/main/ui/workspace/tokens/management/group.cljs index 0e04bd96bc..0d038a2324 100644 --- a/frontend/src/app/main/ui/workspace/tokens/management/group.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/management/group.cljs @@ -144,7 +144,6 @@ (when is-expanded [:> token-tree* {:tokens tokens :id (dm/str "token-tree-" (name type)) - :type type :tokens-lib tokens-lib :selected-shapes selected-shapes :active-theme-tokens active-theme-tokens diff --git a/frontend/src/app/main/ui/workspace/tokens/management/token_tree.cljs b/frontend/src/app/main/ui/workspace/tokens/management/token_tree.cljs index 5feb2496a8..5a31dbcd54 100644 --- a/frontend/src/app/main/ui/workspace/tokens/management/token_tree.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/management/token_tree.cljs @@ -4,7 +4,6 @@ ;; ;; Copyright (c) KALEIDOS INC - (ns app.main.ui.workspace.tokens.management.token-tree (:require-macros [app.main.style :as stl]) (:require @@ -14,8 +13,6 @@ [app.main.ui.workspace.tokens.management.token-pill :refer [token-pill*]] [rumext.v2 :as mf])) - - (def ^:private schema:folder-node [:map [:node :any] @@ -38,7 +35,7 @@ :expanded expanded :aria-expanded expanded :aria-controls (str "folder-children-" (:path node)) - :is-expandable (:has-children node) + :is-expandable (not (:leaf node)) :on-toggle-expand swap-folder-expanded}] (when expanded (let [children-fn (:children-fn node)] @@ -47,7 +44,7 @@ (when children-fn (let [children (children-fn)] (for [child children] - (if (not (:is-leaf child)) + (if (not (:leaf child)) [:ul {:class (stl/css :node-parent)} [:> folder-node* {:key (:path child) :node child @@ -72,7 +69,6 @@ (def ^:private schema:token-tree [:map [:tokens :any] - [:type :keyword] [:selected-shapes :any] [:is-selected-inside-layout {:optional true} :boolean] [:active-theme-tokens {:optional true} :any] @@ -94,7 +90,7 @@ [:ul {:class (stl/css :node-parent) :key (:path node) :style {:--node-depth (inc (:depth node))}} - (if (:is-leaf node) + (if (:leaf node) (let [token (ctob/get-token tokens-lib selected-token-set-id (get-in node [:leaf :id]))] [:> token-pill* {:token token