From d659ab3b9e09a933992e235fa7d78c83c6245fd9 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Sat, 14 Nov 2026 23:49:21 +0100 Subject: [PATCH] :bug: Lay out the parents of an unmasked group again Unmasking a group gives it the bounds of all its children instead of its mask's, but the event did not update the layout the group is in, so in a flex or grid board it kept the place of its old bounds and overlapped its neighbours. It now updates the layouts of the groups' parents, as group, mask and ungroup do. 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/groups.cljs | 11 +++++++---- .../composable_tests/generated_test.cljs | 7 +++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/main/data/workspace/groups.cljs b/frontend/src/app/main/data/workspace/groups.cljs index acdf92f462..056b9b9c7d 100644 --- a/frontend/src/app/main/data/workspace/groups.cljs +++ b/frontend/src/app/main/data/workspace/groups.cljs @@ -119,8 +119,11 @@ (watch [it state _] (let [page-id (:current-page-id state) objects (dsh/lookup-page-objects state page-id) + ids (d/nilv ids (dsh/lookup-selected state)) + ;; an unmasked group takes the bounds of all its children, which + ;; the layout it is in places again + parents (into #{} (keep #(:parent-id (get objects %))) ids) + changes (clg/generate-unmask-changes it page-id objects ids)] - changes (clg/generate-unmask-changes it page-id objects - (d/nilv ids (dsh/lookup-selected state)))] - - (rx/of (dch/commit-changes changes))))))) + (rx/of (dch/commit-changes changes) + (ptk/data-event :layout/update {:ids parents}))))))) diff --git a/frontend/test/frontend_tests/composable_tests/generated_test.cljs b/frontend/test/frontend_tests/composable_tests/generated_test.cljs index 6047f3a1f5..137cd40950 100644 --- a/frontend/test/frontend_tests/composable_tests/generated_test.cljs +++ b/frontend/test/frontend_tests/composable_tests/generated_test.cljs @@ -1102,3 +1102,10 @@ [:delete 8 0 0 0] [:swap 15 0 0 0] [:edit 14 0 0 0] [:resize 4 0 0 0] [:resize 0 0 0 0] [:nest 4 0 0 0] [:rotate 5 0 0 0] [:update-main 14 0 0 0] [:duplicate 0 0 0 0]]}))) + +(t/deftest ^:async generated-an-unmask-in-a-flex-main-places-the-group-again + ;; an unmasked group takes the bounds of all its children, which the flex + ;; it is in places again + (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]]})))