From 4f02995a3cead727c28c1d84e7f320726d0dac74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Fri, 6 Nov 2026 12:11:48 +0100 Subject: [PATCH] :bug: Re-enable adding layout to a variant container (#12879) --- frontend/src/app/main/data/workspace/shape_layout.cljs | 3 +-- frontend/test/frontend_tests/logic/groups_test.cljs | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/data/workspace/shape_layout.cljs b/frontend/src/app/main/data/workspace/shape_layout.cljs index 784036857f..cbf974c929 100644 --- a/frontend/src/app/main/data/workspace/shape_layout.cljs +++ b/frontend/src/app/main/data/workspace/shape_layout.cljs @@ -299,8 +299,7 @@ ;; Refuse before undo: container or cross-boundary. Leave single ;; mains on the from-id branch (selection refuses has-variant?). - (if (or (some ctc/is-variant-container? selected-shapes) - (ctn/crosses-variant-set-boundary? objects selected-shapes)) + (if (ctn/crosses-variant-set-boundary? objects selected-shapes) (rx/empty) (rx/of (dwu/start-undo-transaction undo-id) diff --git a/frontend/test/frontend_tests/logic/groups_test.cljs b/frontend/test/frontend_tests/logic/groups_test.cljs index 33590b3bc0..f8bd0c80ae 100644 --- a/frontend/test/frontend_tests/logic/groups_test.cljs +++ b/frontend/test/frontend_tests/logic/groups_test.cljs @@ -618,7 +618,8 @@ (t/is (= (:id group) (:parent-id (cths/get-shape file' :nested-a)))) (t/is (= (:id group) (:parent-id (cths/get-shape file' :nested-b)))))))))) -(t/deftest create-layout-of-variant-container-only-does-not-commit +;; A variant container DO may have a layout +(t/deftest create-layout-of-variant-container-only-does-commit-and-works (t/async done (let [file (variant-file) @@ -634,8 +635,8 @@ (fn [state] (let [file' (ths/get-file-from-state state) board' (cths/get-shape file' :variant)] - (t/is (= 0 (count @commits))) - (t/is (not (ctl/any-layout? board'))) + (t/is (= 1 (count @commits))) + (t/is (ctl/any-layout? board')) (t/is (ctk/is-variant-container? board')) (t/is (= (:parent-id board) (:parent-id board'))))) :commits commits))))