From d8b3b216e9f87dae6eef8c3df3a68d7c825f484e Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 30 Apr 2025 10:37:14 +0200 Subject: [PATCH 1/6] :bug: Fix import modal style problem --- frontend/src/app/main/ui/dashboard/import.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/dashboard/import.scss b/frontend/src/app/main/ui/dashboard/import.scss index 34bb378fa..0ce6ae41a 100644 --- a/frontend/src/app/main/ui/dashboard/import.scss +++ b/frontend/src/app/main/ui/dashboard/import.scss @@ -198,7 +198,7 @@ } .import-error-disclaimer { - color: var(--color-foreground-primary); + color: var(--color-foreground-secondary); } .import-error-list { From e52fd90963e757d5c53faeba1ee11d18e59a4fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 1 May 2025 10:06:17 +0200 Subject: [PATCH 2/6] :lipstick: Add copyright header to all tokens source files (#6389) --- common/src/app/common/files/tokens.cljc | 6 ++++++ common/test/common_tests/logic/token_test.cljc | 6 ++++++ frontend/src/app/main/data/style_dictionary.cljs | 6 ++++++ frontend/src/app/main/data/tinycolor.cljs | 6 ++++++ frontend/src/app/main/data/workspace/tokens/errors.cljs | 6 ++++++ frontend/src/app/main/data/workspace/tokens/warnings.cljs | 6 ++++++ frontend/test/frontend_tests/tokens/helpers/state.cljs | 6 ++++++ frontend/test/frontend_tests/tokens/helpers/tokens.cljs | 6 ++++++ .../frontend_tests/tokens/logic/token_actions_test.cljs | 6 ++++++ .../test/frontend_tests/tokens/logic/token_data_test.cljs | 6 ++++++ .../test/frontend_tests/tokens/style_dictionary_test.cljs | 6 ++++++ 11 files changed, 66 insertions(+) diff --git a/common/src/app/common/files/tokens.cljc b/common/src/app/common/files/tokens.cljc index eb0991445..3a0a632a7 100644 --- a/common/src/app/common/files/tokens.cljc +++ b/common/src/app/common/files/tokens.cljc @@ -1,3 +1,9 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + (ns app.common.files.tokens (:require [app.common.data :as d] diff --git a/common/test/common_tests/logic/token_test.cljc b/common/test/common_tests/logic/token_test.cljc index 93548f39a..a68a96b2a 100644 --- a/common/test/common_tests/logic/token_test.cljc +++ b/common/test/common_tests/logic/token_test.cljc @@ -1,3 +1,9 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + (ns common-tests.logic.token-test (:require [app.common.files.changes-builder :as pcb] diff --git a/frontend/src/app/main/data/style_dictionary.cljs b/frontend/src/app/main/data/style_dictionary.cljs index f9c39c0d0..101c0fc85 100644 --- a/frontend/src/app/main/data/style_dictionary.cljs +++ b/frontend/src/app/main/data/style_dictionary.cljs @@ -1,3 +1,9 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + (ns app.main.data.style-dictionary (:require ["@tokens-studio/sd-transforms" :as sd-transforms] diff --git a/frontend/src/app/main/data/tinycolor.cljs b/frontend/src/app/main/data/tinycolor.cljs index 2ec94fece..13fea42e0 100644 --- a/frontend/src/app/main/data/tinycolor.cljs +++ b/frontend/src/app/main/data/tinycolor.cljs @@ -1,3 +1,9 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + (ns app.main.data.tinycolor "Bindings for tinycolor2 which supports a wide range of css compatible colors. diff --git a/frontend/src/app/main/data/workspace/tokens/errors.cljs b/frontend/src/app/main/data/workspace/tokens/errors.cljs index 48457a49a..025b7e791 100644 --- a/frontend/src/app/main/data/workspace/tokens/errors.cljs +++ b/frontend/src/app/main/data/workspace/tokens/errors.cljs @@ -1,3 +1,9 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + (ns app.main.data.workspace.tokens.errors (:require [app.util.i18n :refer [tr]] diff --git a/frontend/src/app/main/data/workspace/tokens/warnings.cljs b/frontend/src/app/main/data/workspace/tokens/warnings.cljs index 193eafecd..1849f824a 100644 --- a/frontend/src/app/main/data/workspace/tokens/warnings.cljs +++ b/frontend/src/app/main/data/workspace/tokens/warnings.cljs @@ -1,3 +1,9 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + (ns app.main.data.workspace.tokens.warnings (:require [app.util.i18n :refer [tr]] diff --git a/frontend/test/frontend_tests/tokens/helpers/state.cljs b/frontend/test/frontend_tests/tokens/helpers/state.cljs index 4a6972a9a..c5a7f864d 100644 --- a/frontend/test/frontend_tests/tokens/helpers/state.cljs +++ b/frontend/test/frontend_tests/tokens/helpers/state.cljs @@ -1,3 +1,9 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + (ns frontend-tests.tokens.helpers.state (:require [app.common.types.tokens-lib :as ctob] diff --git a/frontend/test/frontend_tests/tokens/helpers/tokens.cljs b/frontend/test/frontend_tests/tokens/helpers/tokens.cljs index f9f97f7ef..d97089a00 100644 --- a/frontend/test/frontend_tests/tokens/helpers/tokens.cljs +++ b/frontend/test/frontend_tests/tokens/helpers/tokens.cljs @@ -1,3 +1,9 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + (ns frontend-tests.tokens.helpers.tokens (:require [app.common.files.tokens :as cft] 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 d38e8cb08..8bccd46fb 100644 --- a/frontend/test/frontend_tests/tokens/logic/token_actions_test.cljs +++ b/frontend/test/frontend_tests/tokens/logic/token_actions_test.cljs @@ -1,3 +1,9 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + (ns frontend-tests.tokens.logic.token-actions-test (:require [app.common.test-helpers.compositions :as ctho] diff --git a/frontend/test/frontend_tests/tokens/logic/token_data_test.cljs b/frontend/test/frontend_tests/tokens/logic/token_data_test.cljs index b518f2296..0329d05f1 100644 --- a/frontend/test/frontend_tests/tokens/logic/token_data_test.cljs +++ b/frontend/test/frontend_tests/tokens/logic/token_data_test.cljs @@ -1,3 +1,9 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + (ns frontend-tests.tokens.logic.token-data-test (:require [app.common.test-helpers.files :as cthf] diff --git a/frontend/test/frontend_tests/tokens/style_dictionary_test.cljs b/frontend/test/frontend_tests/tokens/style_dictionary_test.cljs index 428c5bdbd..09d298678 100644 --- a/frontend/test/frontend_tests/tokens/style_dictionary_test.cljs +++ b/frontend/test/frontend_tests/tokens/style_dictionary_test.cljs @@ -1,3 +1,9 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + (ns frontend-tests.tokens.style-dictionary-test (:require [app.common.transit :as tr] From a2c9d307df93b26c5d1d05b9fa6d316ee3251e57 Mon Sep 17 00:00:00 2001 From: Alonso Torres Date: Mon, 5 May 2025 08:54:05 +0200 Subject: [PATCH 3/6] :bug: Fix problem in viewer with the back button (#6385) --- CHANGES.md | 1 + frontend/src/app/main/ui/viewer.scss | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 459417162..049808978 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ - Duplicate token sets [Taiga #10694](https://tree.taiga.io/project/penpot/issue/10694) - Add set selection in create Token themes flow [Taiga #10746](https://tree.taiga.io/project/penpot/issue/10746) - Display indicator on not active sets [Taiga #10668](https://tree.taiga.io/project/penpot/issue/10668) +- Fix problem in viewer with the back button [Taiga #10907](https://tree.taiga.io/project/penpot/issue/10907) ### :bug: Bugs fixed diff --git a/frontend/src/app/main/ui/viewer.scss b/frontend/src/app/main/ui/viewer.scss index 31194da31..2ece31cd8 100644 --- a/frontend/src/app/main/ui/viewer.scss +++ b/frontend/src/app/main/ui/viewer.scss @@ -127,6 +127,7 @@ width: $s-28; margin-left: $s-8; background-color: var(--viewer-controls-background-color); + pointer-events: all; svg { @extend .button-icon; stroke: var(--icon-foreground); From 36b78e5e216d51789d2dba40ddd31484e0fec3f8 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 30 Apr 2025 11:49:08 +0200 Subject: [PATCH 4/6] :bug: Fix restore component restore layout --- frontend/src/app/main/data/workspace/libraries.cljs | 5 ++++- .../src/app/main/data/workspace/shape_layout.cljs | 13 ++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/main/data/workspace/libraries.cljs b/frontend/src/app/main/data/workspace/libraries.cljs index 53a70f4bf..d433cc133 100644 --- a/frontend/src/app/main/data/workspace/libraries.cljs +++ b/frontend/src/app/main/data/workspace/libraries.cljs @@ -581,11 +581,14 @@ changes (-> (pcb/empty-changes it) (cll/generate-restore-component ldata component-id library-id page objects)) + page-id + (->> changes :redo-changes (keep :page-id) first) + frames (->> changes :redo-changes (keep :frame-id))] (rx/of (dch/commit-changes changes) - (ptk/data-event :layout/update {:ids frames})))))) + (ptk/data-event :layout/update {:page-id page-id :ids frames})))))) (defn restore-components diff --git a/frontend/src/app/main/data/workspace/shape_layout.cljs b/frontend/src/app/main/data/workspace/shape_layout.cljs index 6436596b1..61b07c159 100644 --- a/frontend/src/app/main/data/workspace/shape_layout.cljs +++ b/frontend/src/app/main/data/workspace/shape_layout.cljs @@ -97,15 +97,17 @@ ;; Never call this directly but through the data-event `:layout/update` ;; Otherwise a lot of cycle dependencies could be generated (defn- update-layout-positions - [{:keys [ids undo-group]}] + [{:keys [page-id ids undo-group]}] (ptk/reify ::update-layout-positions ptk/WatchEvent (watch [_ state _] - (let [objects (dsh/lookup-page-objects state) + (let [page-id (or page-id (:current-page-id state)) + objects (dsh/lookup-page-objects state page-id) ids (->> ids (filter #(contains? objects %)))] (if (d/not-empty? ids) (let [modif-tree (dwm/create-modif-tree ids (ctm/reflow-modifiers))] - (rx/of (dwm/apply-modifiers {:modifiers modif-tree + (rx/of (dwm/apply-modifiers {:page-id page-id + :modifiers modif-tree :stack-undo? true :undo-group undo-group}))) (rx/empty)))))) @@ -127,8 +129,9 @@ (rx/filter #(d/not-empty? %)) (rx/map (fn [data] - (let [ids (reduce #(into %1 (:ids %2)) #{} data)] - (update-layout-positions {:ids ids})))) + (let [page-id (->> data (keep :page-id) first) + ids (reduce #(into %1 (:ids %2)) #{} data)] + (update-layout-positions {:page-id page-id :ids ids})))) (rx/take-until stopper)))))) (defn finalize-shape-layout From c3e76817cd186c0a6e0d19daabaf47165cd5b687 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 7 May 2025 13:45:57 +0200 Subject: [PATCH 5/6] :bug: Add event to power up link from workspace menu --- .../src/app/main/ui/workspace/main_menu.cljs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/main_menu.cljs b/frontend/src/app/main/ui/workspace/main_menu.cljs index 5da0b952c..45a661265 100644 --- a/frontend/src/app/main/ui/workspace/main_menu.cljs +++ b/frontend/src/app/main/ui/workspace/main_menu.cljs @@ -786,6 +786,7 @@ on-power-up-click (mf/use-fn (fn [] + (st/emit! (ptk/event ::ev/event {::ev/name "explore-pricing-click" ::ev/origin "workspace-menu"})) (dom/open-new-window "https://penpot.app/pricing"))) toggle-flag @@ -900,14 +901,16 @@ :id "file-menu-help-info"} [:span {:class (stl/css :item-name)} (tr "workspace.header.menu.option.help-info")] [:span {:class (stl/css :open-arrow)} i/arrow]] - [:> dropdown-menu-item* {:class (stl/css-case :menu-item true) - :on-click on-power-up-click - :on-key-down (fn [event] - (when (kbd/enter? event) - (on-power-up-click))) - :on-pointer-enter close-sub-menu - :id "file-menu-power-up"} - [:span {:class (stl/css :item-name)} (tr "workspace.header.menu.option.power-up")]]] + ;; TODO remove this block when subscriptions is full implemented + (when (contains? cf/flags :subscriptions-old) + [:> dropdown-menu-item* {:class (stl/css-case :menu-item true) + :on-click on-power-up-click + :on-key-down (fn [event] + (when (kbd/enter? event) + (on-power-up-click))) + :on-pointer-enter close-sub-menu + :id "file-menu-power-up"} + [:span {:class (stl/css :item-name)} (tr "workspace.header.menu.option.power-up")]])] (case sub-menu :file From 3fe16bd8f9d7a808f3ec97e834e8d4a13952f946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Albeza?= Date: Wed, 7 May 2025 16:49:54 +0200 Subject: [PATCH 6/6] :bug: Fix history panel shortcut (#6420) * :sparkles: Remove duplicate ID in file menu * :bug: Fix shortcut for Show Version History * :sparkles: Add regression test --- CHANGES.md | 1 + frontend/playwright/ui/specs/versions.spec.js | 21 ++++++++++++++++++- .../app/main/data/workspace/shortcuts.cljs | 6 +++--- .../src/app/main/ui/workspace/main_menu.cljs | 7 +++++-- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 049808978..2a0b99a74 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,6 +21,7 @@ ### :bug: Bugs fixed +- Fix shortcut for history version panel [Taiga #11006](https://tree.taiga.io/project/penpot/issue/11006) - Fix positioning of comment drafts when near the right / bottom edges of viewport [Taiga #10534](https://tree.taiga.io/project/penpot/issue/10534) - Fix path having a wrong selrect [Taiga #10257](https://tree.taiga.io/project/penpot/issue/10257) - Fix SVG `stroke-linecap` property when importing SVGs [Taiga #9489](https://tree.taiga.io/project/penpot/issue/9489) diff --git a/frontend/playwright/ui/specs/versions.spec.js b/frontend/playwright/ui/specs/versions.spec.js index edd8fc9ea..dd28a74c5 100644 --- a/frontend/playwright/ui/specs/versions.spec.js +++ b/frontend/playwright/ui/specs/versions.spec.js @@ -4,11 +4,13 @@ import { presenceFixture } from "../../data/workspace/ws-notifications"; test.beforeEach(async ({ page }) => { await WorkspacePage.init(page); + const workspacePage = new WorkspacePage(page); + await workspacePage.setupEmptyFile(page); }); test("Save and restore version", async ({ page }) => { const workspacePage = new WorkspacePage(page); - await workspacePage.setupEmptyFile(page); + await workspacePage.mockRPC(/get\-file\?/, "workspace/versions-init.json"); await workspacePage.mockRPC( "get-file-fragment?file-id=*&fragment-id=406b7b01-d3e2-80e4-8005-3138b7cc5f0b", @@ -87,3 +89,20 @@ test("Save and restore version", async ({ page }) => { // check that the history panel is closed after restore await expect(page.getByRole("tab", { name: "design" })).toBeVisible(); }); + +test("BUG 11006 - Fix history panel shortcut", async ({ page }) => { + const workspacePage = new WorkspacePage(page); + await workspacePage.mockRPC(/get\-file\?/, "workspace/versions-init.json"); + await workspacePage.mockRPC( + "get-file-snapshots?file-id=*", + "workspace/versions-snapshot-1.json", + ); + + await workspacePage.goToWorkspace(); + + await page.keyboard.press("Control+Alt+h"); + + await expect( + workspacePage.rightSidebar.getByText("There are no versions yet"), + ).toBeVisible(); +}); diff --git a/frontend/src/app/main/data/workspace/shortcuts.cljs b/frontend/src/app/main/data/workspace/shortcuts.cljs index a54e14cf0..e1535516b 100644 --- a/frontend/src/app/main/data/workspace/shortcuts.cljs +++ b/frontend/src/app/main/data/workspace/shortcuts.cljs @@ -464,11 +464,11 @@ :subsections [:panels] :fn #(st/emit! (dcm/go-to-workspace :layout :assets))} - :toggle-history {:tooltip (ds/alt "H") - :command (ds/a-mod "h") + :toggle-history {:tooltip (ds/meta-alt "H") + :command (ds/ca-mod "h") :subsections [:panels] :fn #(emit-when-no-readonly - (dcm/go-to-workspace :layout :document-history))} + (dw/toggle-layout-flag :document-history))} :toggle-colorpalette {:tooltip (ds/alt "P") :command (ds/a-mod "p") diff --git a/frontend/src/app/main/ui/workspace/main_menu.cljs b/frontend/src/app/main/ui/workspace/main_menu.cljs index 45a661265..149bb5dcd 100644 --- a/frontend/src/app/main/ui/workspace/main_menu.cljs +++ b/frontend/src/app/main/ui/workspace/main_menu.cljs @@ -618,7 +618,7 @@ [:> dropdown-menu-item* {:class (stl/css :submenu-item) :on-click on-pin-version :on-key-down on-pin-version-key-down - :id "file-menu-show-version-history"} + :id "file-menu-create-version"} [:span {:class (stl/css :item-name)} (tr "dashboard.create-version-menu")]] @@ -627,7 +627,10 @@ :on-key-down on-show-version-history-key-down :id "file-menu-show-version-history"} [:span {:class (stl/css :item-name)} - (tr "dashboard.show-version-history")]] + (tr "dashboard.show-version-history")] + [:span {:class (stl/css :shortcut)} + (for [sc (scd/split-sc (sc/get-tooltip :toggle-history))] + [:span {:class (stl/css :shortcut-key) :key sc} sc])]] [:div {:class (stl/css :separator)}]])