✨ Enable stroke-per-side flag (#11942)

* ✨ Enable stroke-per-side flag

* 🐛 Fix stroke per side tests for the enabled flag

The default flags now include :enable-stroke-per-side, so
frontend tests and Playwright specs that assumed the flag
was off need to turn it off explicitly.

Update the token context menu test expectations: rects and
boards now expose the stroke-width submenu, and force the
flag off in the "per-side is disabled" cases.

Pass disable-stroke-per-side in the two Playwright specs
that check the flag-off behavior, since app.config always
merges the default flags.

AI-assisted-by: deepseek-v4.1-flash
This commit is contained in:
Luis de Dios 2026-09-28 14:39:18 +02:00 committed by GitHub
parent 77c4072b43
commit 8f1100d0f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 13 deletions

View File

@ -228,10 +228,12 @@
:enable-available-viewer-wasm
:enable-background-blur
:enable-stroke-path
:enable-stroke-per-side
:enable-token-combobox
:enable-custom-shortcuts
:enable-token-lib-sync
:enable-link-unfurl])
(defn parse
[& flags]
(loop [flags (apply concat flags)

View File

@ -59,7 +59,10 @@ test.describe("Tokens: stroke per side", () => {
page,
}) => {
const workspace = new WasmWorkspacePage(page);
await workspace.mockConfigFlags(["enable-feature-token-input"]);
await workspace.mockConfigFlags([
"enable-feature-token-input",
"disable-stroke-per-side",
]);
await workspace.setupEmptyFile();
await workspace.mockGetFile("workspace/get-file-layout-stroke-token-json");
await workspace.goToWorkspace();
@ -452,7 +455,10 @@ test.describe("Tokens: stroke per side", () => {
page,
}) => {
const workspace = new WasmWorkspacePage(page);
await workspace.mockConfigFlags(["enable-feature-token-input"]);
await workspace.mockConfigFlags([
"enable-feature-token-input",
"disable-stroke-per-side",
]);
await workspace.setupEmptyFile();
await workspace.mockGetFile("workspace/get-file-layout-stroke-token-json");
await workspace.goToWorkspace();

View File

@ -16,6 +16,7 @@
(def ^:private all-label (i18n/tr "labels.all"))
(def ^:private per-side-flags (conj cf/flags :stroke-per-side))
(def ^:private no-per-side-flags (disj cf/flags :stroke-per-side))
(defn setup-file []
(-> (tht/sample-file-with-tokens
@ -164,7 +165,7 @@
:separator
{:title "Border Radius", :submenu :border-radius}
:separator
{:title "Stroke Width"}
{:title "Stroke Width", :submenu :stroke-width}
:separator
{:title "X"}
{:title "Y"}]))))
@ -177,7 +178,7 @@
:separator
{:title "Border Radius", :submenu :border-radius}
:separator
{:title "Stroke Width"}
{:title "Stroke Width", :submenu :stroke-width}
:separator
{:title "X"}
{:title "Y"}]))))
@ -208,16 +209,17 @@
(t/is (= action-titles ["Rotation"])))))
(t/deftest stroke-width-items
(t/testing "shows a single global item when per-side is disabled"
(doseq [shape [:rect1 :frame1 :text1]]
(let [actions (token-menu-actions [shape] "token-stroke-width")
action-titles (mapv :title actions)]
(t/is (= action-titles ["Stroke Width"])))))
(with-redefs [cf/flags no-per-side-flags]
(t/testing "shows a single global item when per-side is disabled"
(doseq [shape [:rect1 :frame1 :text1]]
(let [actions (token-menu-actions [shape] "token-stroke-width")
action-titles (mapv :title actions)]
(t/is (= action-titles ["Stroke Width"])))))
(t/testing "shows a single global item for mixed selections when per-side is disabled"
(let [actions (token-menu-actions [:rect1 :text1] "token-stroke-width")
action-titles (mapv :title actions)]
(t/is (= action-titles ["Stroke Width"])))))
(t/testing "shows a single global item for mixed selections when per-side is disabled"
(let [actions (token-menu-actions [:rect1 :text1] "token-stroke-width")
action-titles (mapv :title actions)]
(t/is (= action-titles ["Stroke Width"]))))))
(t/deftest stroke-width-items-per-side
(with-redefs [cf/flags per-side-flags]