From 8c57e7b3a996d67b3aa3c6d285a890d241224fb0 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Sat, 14 Nov 2026 23:53:20 +0100 Subject: [PATCH] :bug: Lay out the parent of a new bool again A bool takes the bounds of its result, smaller than those of the shapes it combines for an intersection, but creating it did not update the layout it is in, so in a grid board it kept a place the layout does not give it. It now updates the layout of its parent, as grouping does. The benchmark covers JVM code; this change is ClojureScript only, so it is not run. AI-assisted-by: claude-opus-5-5 --- frontend/src/app/main/data/workspace/bool.cljs | 5 ++++- .../frontend_tests/composable_tests/generated_test.cljs | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/data/workspace/bool.cljs b/frontend/src/app/main/data/workspace/bool.cljs index 0107410859..052d8f3f6f 100644 --- a/frontend/src/app/main/data/workspace/bool.cljs +++ b/frontend/src/app/main/data/workspace/bool.cljs @@ -30,7 +30,10 @@ (dsh/process-selected objects))] (when-let [[shape changes] (clb/generate-create-bool it page-id objects ids type force-shape-id)] (rx/of (dch/commit-changes changes) - (dws/select-shapes (d/ordered-set (:id shape))))))))) + (dws/select-shapes (d/ordered-set (:id shape))) + ;; the bool takes the bounds of its result, which the layout it + ;; is in places again + (ptk/data-event :layout/update {:ids [(:parent-id shape)]}))))))) (defn group-to-bool [shape-id type] diff --git a/frontend/test/frontend_tests/composable_tests/generated_test.cljs b/frontend/test/frontend_tests/composable_tests/generated_test.cljs index 137cd40950..e5d25cc7c5 100644 --- a/frontend/test/frontend_tests/composable_tests/generated_test.cljs +++ b/frontend/test/frontend_tests/composable_tests/generated_test.cljs @@ -1109,3 +1109,10 @@ (await (replay {:world [2 0 {:variants false :rich-variants false :text true :layout :flex :layout-copies false :layout-children true}] :ops [[:structure 11 1 13] [:structure 0 3]]}))) + +(t/deftest ^:async generated-a-bool-in-a-grid-is-placed-by-it + ;; a bool takes the bounds of its result, which the grid it is in places + (await (replay {:world [3 0 {:variants true :rich-variants true :text true :layout :grid + :layout-copies true :layout-children true}] + :ops [[:rotate 16 0 7 0] [:grid-direction 0 0 0 1] [:grid-cell 0 10 0 1] [:add-child 0] + [:structure 3 6 15] [:grid-direction 0 0 0 1] [:grid-cell 0 4 2 1]]})))