From 84affc15c0869196bc4f55e8cdc3eeac66a7938e Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 23 Oct 2026 14:53:20 +0200 Subject: [PATCH] :bug: Queue moved component copies before syncing their new dependents A copy moved from a rotated parent can need its own component's sync even when that main did not change. Include the moved heads among the sync inputs so the new parent's copies receive the settled geometry. Fix F135. The minimal regression failed before the fix. Geometry suite: 6 tests, 55 assertions, green; the shrunk seed 712 case also passes. Benchmark ratios against Phase 1e: main 10/100/1000 0.46/0.52/0.53; three levels 0.47; chain 0.51; library 0.51; many shapes 0.49; variant switch 0.61. No regression flag. AI-assisted-by: GPT-6 --- common/src/app/common/files/changes.cljc | 3 ++- .../logic/comp_expected_geometry_test.cljc | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/common/src/app/common/files/changes.cljc b/common/src/app/common/files/changes.cljc index 9703f68f32..333cbd82cb 100644 --- a/common/src/app/common/files/changes.cljc +++ b/common/src/app/common/files/changes.cljc @@ -1200,7 +1200,8 @@ (into #{} xform all-parents)))] (reduce #(set/union %1 (check-shape %2 [])) - (check-shape parent-id [parent-id]) + (into (check-shape parent-id [parent-id]) + (keep #(get-in page [:objects % :component-id])) shapes) shapes)) (when component-id #{component-id}))) diff --git a/common/test/common_tests/logic/comp_expected_geometry_test.cljc b/common/test/common_tests/logic/comp_expected_geometry_test.cljc index 0399ae1719..0fff701619 100644 --- a/common/test/common_tests/logic/comp_expected_geometry_test.cljc +++ b/common/test/common_tests/logic/comp_expected_geometry_test.cljc @@ -189,3 +189,14 @@ (t/is (gsh/close-attrs? :points (:points text) (:points synced) 0.01)) (t/is (mth/close? (:x text) (:x synced) 0.01)) (t/is (mth/close? (:y text) (:y synced) 0.01))))) + +(t/deftest nesting-a-copy-settles-its-derived-orientation-before-its-new-main + (let [initial (-> (setup/nested-component-with-copy) + (r/step (n/rotate :main2-root 45)) r/settle + (r/step (n/detach :copy-root)) r/settle + (as-> s (tm/apply-to (n/create-component "destination" setup/labeled-fill :size 100) s))) + moved (-> initial + (r/step (n/nest-copy :copy-instance (n/main-head-of "destination"))) r/settle) + file (tm/file moved) + full (:file (r/sync-cascade file {} (keys (get-in file [:data :components]))))] + (t/is (= (thn/normalize-file file) (thn/normalize-file full)))))