From 3002b6b9f503c027b2442bf32be399d715a672d3 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Sat, 24 Oct 2026 10:09:43 +0200 Subject: [PATCH] :bug: Replay rotation nodes as relative turns in the frontend Pass delta? to increase-rotation when interpreting a Rotate node. Common turns by the node's angle; the event default instead sets an absolute rotation, so a 45-degree turn followed by 90 degrees ended at 90 (F171). The standalone async regression fails before the fix. The full frontend suite passes 1524 tests and 8683 assertions, including generated replay, undo checks and existing goldens without recording. Lint and format pass. AI-assisted-by: GPT-6 --- .../composable_tests/completion_contract_test.cljs | 9 +++++++++ .../frontend_tests/composable_tests/interpreter.cljs | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/test/frontend_tests/composable_tests/completion_contract_test.cljs b/frontend/test/frontend_tests/composable_tests/completion_contract_test.cljs index 848015d982..2ffaf2de4a 100644 --- a/frontend/test/frontend_tests/composable_tests/completion_contract_test.cljs +++ b/frontend/test/frontend_tests/composable_tests/completion_contract_test.cljs @@ -11,6 +11,7 @@ down on purpose, so a step that resolved early would see a half-synced file." (:require + [app.common.math :as mth] [app.common.test-helpers.composable.comp.nodes :as n] [app.common.test-helpers.composable.comp.setups :as setup] [app.common.test-helpers.composable.comp.undo-check :as uc] @@ -30,6 +31,14 @@ (t/use-fixtures :each ftm/fixture) +(t/deftest ^:async rotation-nodes-compose-successive-turns + (let [initial (ftm/start-generated (setup/simple-component-with-labeled-copy)) + first-turn (await (ftm/run-generated-step initial (n/rotate :copy-root 45))) + second-turn (await (ftm/run-generated-step first-turn (n/rotate :copy-root 90))) + shape (ths/get-shape (ftm/current-file) :copy-root)] + (t/is (mth/close? 135 (:rotation shape) 0.01)) + (t/is (empty? (uc/failures second-turn))))) + (def ^:private original "#abcdef") (def ^:private red "#ff0000") diff --git a/frontend/test/frontend_tests/composable_tests/interpreter.cljs b/frontend/test/frontend_tests/composable_tests/interpreter.cljs index 8ad626cb93..62757b048c 100644 --- a/frontend/test/frontend_tests/composable_tests/interpreter.cljs +++ b/frontend/test/frontend_tests/composable_tests/interpreter.cljs @@ -169,9 +169,9 @@ :original-content (:content shape))]) (instance? n/Rotate op) - ;; the sidebar rotation, which decides what it touches in copies (check-delta) + ;; A node turns by its angle, including after an earlier rotation. (let [{:keys [target angle]} op] - [(dwt/increase-rotation [(tm/target-shape-id situation target)] angle)]) + [(dwt/increase-rotation [(tm/target-shape-id situation target)] angle {:delta? true})]) (instance? n/MoveShape op) ;; the sidebar position, in page coordinates