From 0b90722d5a62b97638ec35ddd5c2b48064cc704b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marina=20L=C3=B3pez?= Date: Wed, 5 Feb 2025 15:25:00 +0100 Subject: [PATCH 1/5] :bug: Fix change flex direction using plugins API --- CHANGES.md | 1 + frontend/src/app/plugins/shape.cljs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 000c41513..75bdfabc6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -59,6 +59,7 @@ is a number of cores) - Fix problem in plugins with renaming components [Taiga #10060](https://tree.taiga.io/project/penpot/issue/10060) - Added upload svg with images method [#5489](https://github.com/penpot/penpot/issues/5489) - Fix problem with root frame parent reference [Taiga #9437](https://tree.taiga.io/project/penpot/issue/9437) +- Fix change flex direction using plugins API [Taiga #9407](https://tree.taiga.io/project/penpot/issue/9407) ## 2.4.3 diff --git a/frontend/src/app/plugins/shape.cljs b/frontend/src/app/plugins/shape.cljs index 687d741c5..4f78b16b2 100644 --- a/frontend/src/app/plugins/shape.cljs +++ b/frontend/src/app/plugins/shape.cljs @@ -954,7 +954,7 @@ :else (do (st/emit! (dwsl/create-layout-from-id id :flex :from-frame? true :calculate-params? false)) - (grid/grid-layout-proxy plugin-id file-id page-id id))))) + (flex/flex-layout-proxy plugin-id file-id page-id id))))) :addGridLayout (fn [] From 8aae928796a5f75cf20b6fc5e11aa2b70ac7206c Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 5 Feb 2025 12:31:40 +0100 Subject: [PATCH 2/5] :bug: Fix create new layers in component copy --- CHANGES.md | 1 + common/src/app/common/types/container.cljc | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 75bdfabc6..f7796dab3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -55,6 +55,7 @@ is a number of cores) - Fix error when reseting stroke cap - Fix problem with strokes not refreshing in Safari [Taiga #9040](https://tree.taiga.io/project/penpot/issue/9040) - Fix problem with multiple color changes [Taiga #9631](https://tree.taiga.io/project/penpot/issue/9631) +- Fix create new layers in a component copy [Taiga #10037](https://tree.taiga.io/project/penpot/issue/10037) - Fix problem in plugins with zoomIntoView [Plugins #189](https://github.com/penpot/penpot-plugins/issues/189) - Fix problem in plugins with renaming components [Taiga #10060](https://tree.taiga.io/project/penpot/issue/10060) - Added upload svg with images method [#5489](https://github.com/penpot/penpot/issues/5489) diff --git a/common/src/app/common/types/container.cljc b/common/src/app/common/types/container.cljc index bdd62bcef..ae9ac3648 100644 --- a/common/src/app/common/types/container.cljc +++ b/common/src/app/common/types/container.cljc @@ -535,10 +535,11 @@ (letfn [(get-frame [parent-id] (if (cfh/frame-shape? objects parent-id) parent-id (get-in objects [parent-id :frame-id])))] (let [parent (get objects parent-id) - ;; We can always move the children to the parent they already have + ;; We can always move the children to the parent they already have. no-changes? (->> children (every? #(= parent-id (:parent-id %))))] - (if (or no-changes? (not (invalid-structure-for-component? objects parent children pasting? libraries))) + ;; In case no-changes is true we must ensure we are copy pasting the children in the same position + (if (or (and no-changes? (not pasting?)) (not (invalid-structure-for-component? objects parent children pasting? libraries))) [parent-id (get-frame parent-id)] (recur (:parent-id parent) objects children pasting? libraries)))))) From cdfc0fd988e87179b43825f2b79cdd177b0cbdee Mon Sep 17 00:00:00 2001 From: Alonso Torres Date: Thu, 6 Feb 2025 10:49:42 +0100 Subject: [PATCH 3/5] :bug: Fix problem when changing colorpicker alpha (#5770) --- .../playwright/ui/specs/colorpicker.spec.js | 31 +++++++++++++++++++ .../app/main/ui/workspace/colorpicker.cljs | 3 +- .../colorpicker/slider_selector.cljs | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/frontend/playwright/ui/specs/colorpicker.spec.js b/frontend/playwright/ui/specs/colorpicker.spec.js index d65d7f407..b5d9765ff 100644 --- a/frontend/playwright/ui/specs/colorpicker.spec.js +++ b/frontend/playwright/ui/specs/colorpicker.spec.js @@ -181,3 +181,34 @@ test("Bug 9900 - Color picker has no inputs for HSV values", async ({ await workspacePage.page.getByLabel("S", { exact: true }).isVisible(); await workspacePage.page.getByLabel("V", { exact: true }).isVisible(); }); + +test("Bug 10089 - Cannot change alpha", async ({ page }) => { + const workspacePage = new WorkspacePage(page); + await workspacePage.setupEmptyFile(); + await workspacePage.mockRPC( + /get\-file\?/, + "workspace/get-file-not-empty.json", + ); + await workspacePage.mockRPC( + "update-file?id=*", + "workspace/update-file-create-rect.json", + ); + + await workspacePage.goToWorkspace({ + fileId: "6191cd35-bb1f-81f7-8004-7cc63d087374", + pageId: "6191cd35-bb1f-81f7-8004-7cc63d087375", + }); + await workspacePage.clickLeafLayer("Rectangle"); + + const swatch = workspacePage.page.getByRole("button", { name: "#B1B2B5" }); + const swatchBox = await swatch.boundingBox(); + await swatch.click(); + + const alpha = workspacePage.page.getByLabel("A", { exact: true }); + await expect(alpha).toHaveValue("100"); + + const alphaSlider = workspacePage.page.getByTestId("slider-opacity"); + await alphaSlider.click(); + + await expect(alpha).toHaveValue("50"); +}); diff --git a/frontend/src/app/main/ui/workspace/colorpicker.cljs b/frontend/src/app/main/ui/workspace/colorpicker.cljs index 56731732d..d6fcbc0e0 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker.cljs @@ -181,7 +181,8 @@ (when (or (not= (str/lower (:hex color)) (str/lower (:hex current-color))) (not= (:h color) (:h current-color)) (not= (:s color) (:s current-color)) - (not= (:v color) (:v current-color))) + (not= (:v color) (:v current-color)) + (not= (:alpha color) (:alpha current-color))) (let [recent-color (merge current-color color) recent-color (dc/materialize-color-components recent-color)] (st/emit! (dc/update-colorpicker-color recent-color (not @drag?))))))) diff --git a/frontend/src/app/main/ui/workspace/colorpicker/slider_selector.cljs b/frontend/src/app/main/ui/workspace/colorpicker/slider_selector.cljs index 9a866dfc9..c69acfd70 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker/slider_selector.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker/slider_selector.cljs @@ -57,6 +57,7 @@ :hue (= type :hue) :opacity (= type :opacity) :value (= type :value))) + :data-testid (when (= type :opacity) "slider-opacity") :on-pointer-down handle-start-drag :on-pointer-up handle-stop-drag :on-lost-pointer-capture handle-stop-drag From e78100a776915c49a82fe91e80e6ecf12271ceff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bel=C3=A9n=20Albeza?= Date: Thu, 6 Feb 2025 12:12:29 +0100 Subject: [PATCH 4/5] :bug: Fix flakiness of playwright test for bug 10090 (#5787) --- frontend/playwright/ui/specs/assets-tab.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/playwright/ui/specs/assets-tab.spec.js b/frontend/playwright/ui/specs/assets-tab.spec.js index bc5d7b5a2..ad3d5d2d7 100644 --- a/frontend/playwright/ui/specs/assets-tab.spec.js +++ b/frontend/playwright/ui/specs/assets-tab.spec.js @@ -60,8 +60,8 @@ test("BUG 10090 - Local library should be expanded by default", async ({ await workspacePage.clickAssets(); - expect(workspacePage.sidebar.getByText("Local library")).toBeVisible(); - expect(workspacePage.sidebar.getByText("Components")).toBeVisible(); - expect(workspacePage.sidebar.getByText("Colors")).toBeVisible(); - expect(workspacePage.sidebar.getByText("Typographies")).toBeVisible(); + await expect(workspacePage.sidebar.getByText("Local library")).toBeVisible(); + await expect(workspacePage.sidebar.getByText("Components")).toBeVisible(); + await expect(workspacePage.sidebar.getByText("Colors")).toBeVisible(); + await expect(workspacePage.sidebar.getByText("Typographies")).toBeVisible(); }); From 09b3868b0ec779a2e2e910da2ab5ad9f19f33671 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Thu, 6 Feb 2025 12:49:58 +0100 Subject: [PATCH 5/5] :bug: Fix flakiness of playwright test for token (#5790) --- frontend/playwright/ui/specs/tokens.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/playwright/ui/specs/tokens.spec.js b/frontend/playwright/ui/specs/tokens.spec.js index 58e622135..8ed4ea87d 100644 --- a/frontend/playwright/ui/specs/tokens.spec.js +++ b/frontend/playwright/ui/specs/tokens.spec.js @@ -178,7 +178,7 @@ test.describe("Tokens: Tokens Tab", () => { const colorTokenChanged = tokensSidebar.getByRole("button", { name: "colors.blue.100.changed", }); - expect(colorTokenChanged).toBeVisible(); + await expect(colorTokenChanged).toBeVisible(); }); test("User creates grouped color token", async ({ page }) => {