diff --git a/common/src/app/common/types/shape.cljc b/common/src/app/common/types/shape.cljc index 93e4db19e3..cef77122d8 100644 --- a/common/src/app/common/types/shape.cljc +++ b/common/src/app/common/types/shape.cljc @@ -525,7 +525,7 @@ :fills [] :strokes [{:stroke-style :solid :stroke-alignment :inner - :stroke-width 2 + :stroke-width 1 :stroke-color clr/black :stroke-opacity 1}]}) diff --git a/frontend/playwright/data/workspace/update-file-14239.json b/frontend/playwright/data/workspace/update-file-14239.json new file mode 100644 index 0000000000..04c5bc3893 --- /dev/null +++ b/frontend/playwright/data/workspace/update-file-14239.json @@ -0,0 +1,133 @@ +{ + "~:revn": 2, + "~:lagged": [ + { + "~:id": "~u7f0e4986-db88-8130-8008-1573f690be15", + "~:revn": 2, + "~:file-id": "~u7f0e4986-db88-8130-8008-1573e577911a", + "~:session-id": "~u71a5dd44-23e8-8036-8008-1573e19c6190", + "~:changes": [ + { + "~:type": "~:mod-page", + "~:id": "~u7f0e4986-db88-8130-8008-1573e577911b", + "~:background": "#e8e9ea" + } + ] + }, + { + "~:id": "~u7f0e4986-db88-8130-8008-1573ff5a4706", + "~:revn": 3, + "~:file-id": "~u7f0e4986-db88-8130-8008-1573e577911a", + "~:session-id": "~u71a5dd44-23e8-8036-8008-1573e19c6190", + "~:changes": [ + { + "~:ignore-touched": false, + "~:index": null, + "~:type": "~:add-obj", + "~:page-id": "~u7f0e4986-db88-8130-8008-1573e577911b", + "~:id": "~u71a5dd44-23e8-8036-8008-1573f8419e2f", + "~:parent-id": "~u00000000-0000-0000-0000-000000000000", + "~:frame-id": "~u00000000-0000-0000-0000-000000000000", + "~:obj": { + "~#shape": { + "~:y": null, + "~:transform": { + "~#matrix": { + "~:a": 1.0, + "~:b": 0.0, + "~:c": 0.0, + "~:d": 1.0, + "~:e": 0.0, + "~:f": 0.0 + } + }, + "~:rotation": 0, + "~:grow-type": "~:fixed", + "~:content": { + "~#penpot/path-data": "~bAQAAAAAAAAAAAAAAAAAAAAAAAAAAwEJEAAAjQwIAAAAAAAAAAAAAAAAAAAAAAAAAAMBtRAAAgUM=" + }, + "~:name": "Path", + "~:width": null, + "~:type": "~:path", + "~:points": [ + { + "~#point": { + "~:x": 779, + "~:y": 163 + } + }, + { + "~#point": { + "~:x": 951, + "~:y": 163 + } + }, + { + "~#point": { + "~:x": 951, + "~:y": 258 + } + }, + { + "~#point": { + "~:x": 779, + "~:y": 258 + } + } + ], + "~:proportion-lock": false, + "~:transform-inverse": { + "~#matrix": { + "~:a": 1.0, + "~:b": 0.0, + "~:c": 0.0, + "~:d": 1.0, + "~:e": 0.0, + "~:f": 0.0 + } + }, + "~:id": "~u71a5dd44-23e8-8036-8008-1573f8419e2f", + "~:parent-id": "~u00000000-0000-0000-0000-000000000000", + "~:frame-id": "~u00000000-0000-0000-0000-000000000000", + "~:strokes": [ + { + "~:stroke-style": "~:solid", + "~:stroke-alignment": "~:inner", + "~:stroke-width": 1, + "~:stroke-color": "#000000", + "~:stroke-opacity": 1 + } + ], + "~:x": null, + "~:proportion": 1, + "~:selrect": { + "~#rect": { + "~:x": 779, + "~:y": 163, + "~:width": 172, + "~:height": 95, + "~:x1": 779, + "~:y1": 163, + "~:x2": 951, + "~:y2": 258 + } + }, + "~:fills": [], + "~:flip-x": null, + "~:height": null, + "~:flip-y": null + } + } + }, + { + "~:type": "~:mov-objects", + "~:parent-id": "~u00000000-0000-0000-0000-000000000000", + "~:page-id": "~u7f0e4986-db88-8130-8008-1573e577911b", + "~:shapes": [ + "~u71a5dd44-23e8-8036-8008-1573f8419e2f" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/frontend/playwright/data/workspace/update-file-empty.json b/frontend/playwright/data/workspace/update-file-empty.json index 671fef98f7..da650d368c 100644 --- a/frontend/playwright/data/workspace/update-file-empty.json +++ b/frontend/playwright/data/workspace/update-file-empty.json @@ -1,9 +1,4 @@ -[ - { - "~:id": "~u088df3d4-d383-80f6-8004-527e50ea4f1f", - "~:revn": 21, - "~:file-id": "~uc7ce0794-0992-8105-8004-38f280443849", - "~:session-id": "~u1dc6d4fa-7bd3-803a-8004-527dd9df2c62", - "~:changes": [] - } -] +{ + "~:revn": 2, + "~:lagged": [] +} diff --git a/frontend/playwright/ui/pages/WorkspacePage.js b/frontend/playwright/ui/pages/WorkspacePage.js index e8e3a062b6..891b2a4e31 100644 --- a/frontend/playwright/ui/pages/WorkspacePage.js +++ b/frontend/playwright/ui/pages/WorkspacePage.js @@ -175,6 +175,7 @@ export class WorkspacePage extends BaseWebSocketPage { this.textShapeButton = page.getByRole("button", { name: "Text (T)" }); this.moveButton = page.getByRole("button", { name: "Move (V)" }); this.boardButton = page.getByRole("button", { name: "Board (B)" }); + this.pathButton = page.getByRole("button", { name: "Path (P)" }); this.toggleToolbarButton = page.getByRole("button", { name: "Toggle toolbar", }); diff --git a/frontend/playwright/ui/specs/workspace.spec.js b/frontend/playwright/ui/specs/workspace.spec.js index 6006d888ab..402988186a 100644 --- a/frontend/playwright/ui/specs/workspace.spec.js +++ b/frontend/playwright/ui/specs/workspace.spec.js @@ -532,7 +532,7 @@ test("BUG 13415 - Grid layout overlay is not removed when deleting a board", asy await expect(workspacePage.canvas).toHaveScreenshot(); }); -test("BUG 13822 - Problems with z-index", async({ +test("BUG 13822 - Problems with z-index", async ({ page }) => { const workspacePage = new WasmWorkspacePage(page); @@ -547,3 +547,24 @@ test("BUG 13822 - Problems with z-index", async({ await workspacePage.waitForFirstRenderWithoutUI(); await expect(workspacePage.canvas).toHaveScreenshot(); }); + +test("BUG 14239 - Fix default path thickness", async ({ + page +}) => { + const workspacePage = new WasmWorkspacePage(page); + await workspacePage.setupEmptyFile(); + await workspacePage.mockRPC("update-file?id=*", "workspace/update-file-empty.json"); + await workspacePage.goToWorkspace(); + + // (Workaround a bug in which mouse position can be nil and path editor crashes + // if we click on the Path tool without hovering over the viewport first) + await workspacePage.viewport.hover(); + // 1. Draw a path + await workspacePage.pathButton.click(); + await workspacePage.clickAt(779, 163); + await workspacePage.clickAt(951, 258); + // 2. Close it + await page.keyboard.press("Escape"); + + await expect(workspacePage.rightSidebar.getByRole("textbox", { name: "Stroke width" })).toHaveValue("1"); +}); \ No newline at end of file