diff --git a/CHANGES.md b/CHANGES.md index 95ca3fff1..2d7ef2bcd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -68,10 +68,12 @@ 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) - 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/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)))))) 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(); }); 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/playwright/ui/specs/tokens.spec.js b/frontend/playwright/ui/specs/tokens.spec.js index 98b8f7d10..f3c613b1f 100644 --- a/frontend/playwright/ui/specs/tokens.spec.js +++ b/frontend/playwright/ui/specs/tokens.spec.js @@ -181,7 +181,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 edits theme and activates it in the sidebar", async ({ page }) => { 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 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 []