From e8336a401ef8b7edecc4c1b61707f2422c51585e Mon Sep 17 00:00:00 2001 From: Elena Torro Date: Wed, 15 Oct 2025 12:55:52 +0200 Subject: [PATCH] :bug: Do not show resize controls when a selected shape is blocked --- CHANGES.md | 1 + .../ui/visual-specs/workspace.spec.js | 28 +++++++++++++++---- .../main/ui/workspace/viewport/selection.cljs | 1 + 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9313cfa623..633dbddf48 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ ### :bug: Bugs fixed - Fix pan cursor not disabling viewport guides [Github #6985](https://github.com/penpot/penpot/issues/6985) +- Fix viewport resize on locked shapes [Taiga #11974](https://tree.taiga.io/project/penpot/issue/11974) ## 2.11.0 (Unreleased) diff --git a/frontend/playwright/ui/visual-specs/workspace.spec.js b/frontend/playwright/ui/visual-specs/workspace.spec.js index 418b92861d..628a7f2ebd 100644 --- a/frontend/playwright/ui/visual-specs/workspace.spec.js +++ b/frontend/playwright/ui/visual-specs/workspace.spec.js @@ -28,13 +28,29 @@ const setupFileWithAssets = async (workspace) => { return { fileId, pageId }; }; -test("Shows the workspace correctly for a blank file", async ({ page }) => { - const workspace = new WorkspacePage(page); - await workspace.setupEmptyFile(); +test.describe("Viewport", () => { + test("Shows the workspace correctly for a blank file", async ({ page }) => { + const workspace = new WorkspacePage(page); + await workspace.setupEmptyFile(); - await workspace.goToWorkspace(); + await workspace.goToWorkspace(); - await expect(workspace.page).toHaveScreenshot(); + await expect(workspace.page).toHaveScreenshot(); + }); + + test("User creates a rectangle and locks it", async ({ page }) => { + const workspace = new WorkspacePage(page); + await workspace.setupEmptyFile(page); + await workspace.goToWorkspace(); + + await workspace.rectShapeButton.click(); + await workspace.clickWithDragViewportAt(128, 128, 200, 100); + await workspace.clickLeafLayer("Rectangle"); + + await page.keyboard.press("Shift+Control+L"); + + await expect(workspace.page).toHaveScreenshot(); + }); }); test.describe("Design tab", () => { @@ -145,4 +161,4 @@ test.describe("Palette", () => { workspace.palette.getByRole("button", { name: "#7798ff" }), ).toBeVisible(); }); -}); +}); \ No newline at end of file diff --git a/frontend/src/app/main/ui/workspace/viewport/selection.cljs b/frontend/src/app/main/ui/workspace/viewport/selection.cljs index 8b304eb2b7..071233f44b 100644 --- a/frontend/src/app/main/ui/workspace/viewport/selection.cljs +++ b/frontend/src/app/main/ui/workspace/viewport/selection.cljs @@ -381,6 +381,7 @@ (and flip-y (not flip-x)))] (when (and (not ^boolean read-only?) + (not (:blocked shape)) (not (or (= transform-type :move) (= transform-type :rotate))))