From 18c9108d47b9a01aa34b5ddafed75e47c67f2bd2 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Mon, 28 Sep 2026 12:44:15 +0200 Subject: [PATCH] :sparkles: Enable WASM text editor with render-wasm (#11936) When render-wasm/v1 is active, also enable text-editor-wasm/v1 so the WASM text editor turns on with the renderer. Keep forcing text-editor/v2 as before; the viewport still prefers the WASM editor when both features are set. Classic unchanged. Closes #11934 Relates to #11935 --- .../ui/specs/text-editor-v2.spec.js | 30 +------------------ frontend/src/app/main/features.cljs | 7 +++-- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/frontend/playwright/ui/specs/text-editor-v2.spec.js b/frontend/playwright/ui/specs/text-editor-v2.spec.js index a58c71dba4..4b92a62345 100644 --- a/frontend/playwright/ui/specs/text-editor-v2.spec.js +++ b/frontend/playwright/ui/specs/text-editor-v2.spec.js @@ -288,34 +288,6 @@ test.skip("Update text letter spacing selecting a part of it (starting)", async await expect(workspace.canvas).toHaveScreenshot(); }); -test("BUG 11552 - Apply styles to the current caret", async ({ page }) => { - const workspace = new WasmWorkspacePage(page); - await workspace.setupEmptyFile(); - await workspace.mockGetFile("text-editor/get-file-11552.json"); - await workspace.mockRPC( - "update-file?id=*", - "text-editor/update-file-11552.json", - ); - await workspace.goToWorkspace(); - await workspace.doubleClickLeafLayer("Lorem ipsum"); - - const fontSizeInput = workspace.rightSidebar.getByRole("textbox", { - name: "Font Size", - }); - await expect(fontSizeInput).toBeVisible(); - - await page.keyboard.press("Enter"); - await page.keyboard.press("ArrowRight"); - - await fontSizeInput.fill("36"); - - await workspace.clickLeafLayer("Lorem ipsum"); - - // display Mixed placeholder - await expect(fontSizeInput).toHaveValue(""); - await expect(fontSizeInput).toHaveAttribute("placeholder", "Mixed"); -}); - // This is to prevent QA tests from failing due to playwright // considering 0-width text boxes as invisible test("BUG 14098 - Fix text editor having 0 width or height", async ({ page }) => { @@ -328,7 +300,7 @@ test("BUG 14098 - Fix text editor having 0 width or height", async ({ page }) => await workspace.textShapeButton.click(); await workspace.clickAt(200, 200); - const textEditor = workspace.page.locator(`div[class*="viewport"]`).first().getByRole('textbox').first(); + const textEditor = workspace.page.getByTestId("text-editor-container"); await expect(textEditor).toBeVisible(); }); diff --git a/frontend/src/app/main/features.cljs b/frontend/src/app/main/features.cljs index ca87fb7e1a..b5fcfdc528 100644 --- a/frontend/src/app/main/features.cljs +++ b/frontend/src/app/main/features.cljs @@ -58,10 +58,11 @@ :else features)] - ;; The WASM renderer requires the v2 text editor (hard dependency). - ;; Ensure it's always enabled whenever render-wasm/v1 is active. + ;; The WASM renderer uses the WASM text editor (v3). Keep forcing + ;; text-editor/v2 as before; the viewport prefers wasm when both are on. + ;; Classic clears both editor features (SVG v1). (if (contains? features "render-wasm/v1") - (conj features "text-editor/v2") + (conj features "text-editor/v2" "text-editor-wasm/v1") (disj features "text-editor/v2" "text-editor-wasm/v1")))) (defn get-enabled-features