🐛 Re-enable adding layout to a variant container (#12879)

This commit is contained in:
Andrés Moya 2026-11-06 12:11:48 +01:00 committed by GitHub
parent 0333410482
commit 4f02995a3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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))))