diff --git a/CHANGES.md b/CHANGES.md index f6babf68a0..cb23de96cf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,6 +23,14 @@ - Fix problem with import errors [Taiga #10040](https://tree.taiga.io/project/penpot/issue/10040) - Fix color gradient on texts [Taiga Issue #7488](https://tree.taiga.io/project/penpot/issue/7488) +## 2.6.2 (Unreleased) + +### :bug: Bugs fixed + +- Increase the height of the right sidebar dropdowns [Taiga #10615](https://tree.taiga.io/project/penpot/issue/10615) +- Fix scroll on token themes modal [Taiga #10745](https://tree.taiga.io/project/penpot/issue/10745) +- Fix unexpected exception on path editor on merge segments when undo stack is empty + ## 2.6.1 ### :bug: Bugs fixed @@ -81,6 +89,7 @@ - Add character limitation to asset inputs [Taiga #10669](https://tree.taiga.io/project/penpot/issue/10669) - Fix Storybook link 'list of all available icons' wrong path [Taiga #10705](https://tree.taiga.io/project/penpot/issue/10705) + ## 2.5.4 ### :heart: Community contributions (Thank you!) diff --git a/common/src/app/common/data/undo_stack.cljc b/common/src/app/common/data/undo_stack.cljc index 61117cb2ee..dbcae0db14 100644 --- a/common/src/app/common/data/undo_stack.cljc +++ b/common/src/app/common/data/undo_stack.cljc @@ -47,7 +47,7 @@ (defn undo [stack] - (update stack :index dec)) + (update stack :index #(max 0 (dec %)))) (defn redo [{index :index items :items :as stack}] diff --git a/frontend/playwright/ui/specs/tokens.spec.js b/frontend/playwright/ui/specs/tokens.spec.js index 9988fe1ead..73e8488316 100644 --- a/frontend/playwright/ui/specs/tokens.spec.js +++ b/frontend/playwright/ui/specs/tokens.spec.js @@ -511,9 +511,7 @@ test.describe("Tokens: Sets Tab", () => { // Creates nesting by renaming set with double click await tokenThemesSetsSidebar .getByRole("button", { name: "light-renamed" }) - .click({ button: "right" }); - await expect(tokenContextMenuForSet).toBeVisible(); - await tokenContextMenuForSet.getByText("Rename").click(); + .dblclick(); await changeSetInput(tokenThemesSetsSidebar, "nested/light"); await assertSetsList(tokenThemesSetsSidebar, [ @@ -558,6 +556,45 @@ test.describe("Tokens: Sets Tab", () => { ]); }); + test("User can create & edit sets and set groups with an identical name", async ({ + page, + }) => { + const { tokenThemesSetsSidebar, tokenContextMenuForSet } = + await setupEmptyTokensFile(page); + + const tokensTabButton = tokenThemesSetsSidebar + .getByRole("button", { name: "Add set" }) + .click(); + + await createSet(tokenThemesSetsSidebar, "core/colors"); + await createSet(tokenThemesSetsSidebar, "core"); + await assertSetsList(tokenThemesSetsSidebar, ["core", "colors", "core"]); + await tokenThemesSetsSidebar + .getByRole("button", { name: "core" }) + .nth(0) + .dblclick(); + await changeSetInput(tokenThemesSetsSidebar, "core-group-renamed"); + await assertSetsList(tokenThemesSetsSidebar, [ + "core-group-renamed", + "colors", + "core", + ]); + + await page.keyboard.press(`ControlOrMeta+z`); + await assertSetsList(tokenThemesSetsSidebar, ["core", "colors", "core"]); + + await tokenThemesSetsSidebar + .getByRole("button", { name: "core" }) + .nth(1) + .dblclick(); + await changeSetInput(tokenThemesSetsSidebar, "core-set-renamed"); + await assertSetsList(tokenThemesSetsSidebar, [ + "core", + "colors", + "core-set-renamed", + ]); + }); + test("Fold/Unfold set", async ({ page }) => { const { tokenThemesSetsSidebar, tokenSetGroupItems } = await setupTokensFile(page); diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/measures.scss b/frontend/src/app/main/ui/workspace/sidebar/options/menus/measures.scss index 2660148083..22d3b7914b 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/measures.scss +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/measures.scss @@ -55,6 +55,7 @@ .custom-select-dropdown { @extend .dropdown-wrapper; margin-top: $s-2; + max-height: 70vh; width: $s-252; .dropdown-element { @extend .dropdown-element-base; diff --git a/frontend/src/app/main/ui/workspace/tokens/modals/themes.scss b/frontend/src/app/main/ui/workspace/tokens/modals/themes.scss index 59c1dae947..59e57a2b1c 100644 --- a/frontend/src/app/main/ui/workspace/tokens/modals/themes.scss +++ b/frontend/src/app/main/ui/workspace/tokens/modals/themes.scss @@ -191,6 +191,7 @@ border: $s-1 solid color-mix(in hsl, var(--color-foreground-secondary) 30%, transparent); border-radius: $s-8; overflow-y: auto; + max-height: $s-452; } .sets-count-empty-button { diff --git a/frontend/src/app/main/ui/workspace/tokens/sets.cljs b/frontend/src/app/main/ui/workspace/tokens/sets.cljs index dc8f5364dc..0ff9f15831 100644 --- a/frontend/src/app/main/ui/workspace/tokens/sets.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/sets.cljs @@ -65,6 +65,11 @@ (st/emit! (ptk/data-event ::ev/event {::ev/name "create-token-set" :name name}) (dt/create-token-set name)))) +(defn group-edition-id + "Prefix editing groups `edition-id` so it can be differentiated from sets with the same id." + [edition-id] + (str "group-" edition-id)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; COMPONENTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -166,16 +171,18 @@ {:position (dom/get-client-position event) :is-group true :id id + :edition-id (group-edition-id id) :path tree-path}))))) on-collapse-click (mf/use-fn (fn [event] + (dom/prevent-default event) (dom/stop-propagation event) (on-toggle-collapse tree-path))) on-double-click - (mf/use-fn (mf/deps id) #(on-start-edition id)) + (mf/use-fn (mf/deps id) #(on-start-edition (group-edition-id id))) on-checkbox-click (mf/use-fn @@ -267,6 +274,7 @@ {:position (dom/get-client-position event) :is-group false :id id + :edition-id id :path tree-path}))))) on-double-click @@ -398,7 +406,7 @@ :is-active (is-token-set-group-active path) :is-selected false :is-draggable is-draggable - :is-editing (= edition-id id) + :is-editing (= edition-id (group-edition-id id)) :is-collapsed (collapsed? path) :on-select on-select diff --git a/frontend/src/app/main/ui/workspace/tokens/sets_context_menu.cljs b/frontend/src/app/main/ui/workspace/tokens/sets_context_menu.cljs index b4b4f5015e..029244de5b 100644 --- a/frontend/src/app/main/ui/workspace/tokens/sets_context_menu.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/sets_context_menu.cljs @@ -34,7 +34,7 @@ (mf/defc menu* {::mf/private true} - [{:keys [is-group id path]}] + [{:keys [is-group id edition-id path]}] (let [create-set-at-path (mf/use-fn (mf/deps path) #(st/emit! (dt/start-token-set-creation path))) @@ -42,7 +42,7 @@ (mf/use-fn (mf/deps id) (fn [] - (st/emit! (dt/start-token-set-edition id)))) + (st/emit! (dt/start-token-set-edition edition-id)))) on-delete (mf/use-fn @@ -57,7 +57,7 @@ (mf/defc token-set-context-menu* [] - (let [{:keys [position is-group id path]} + (let [{:keys [position is-group id edition-id path]} (mf/deref ref:token-sets-context-menu) position-top @@ -78,4 +78,5 @@ :on-context-menu prevent-default} [:> menu* {:is-group is-group :id id + :edition-id edition-id :path path}]]]))