From 32d488e16256804ffcea5853adc4fb86987a53c2 Mon Sep 17 00:00:00 2001 From: Roshan Ramani <154859727+rawsun007@users.noreply.github.com> Date: Tue, 17 Nov 2026 14:15:02 +0530 Subject: [PATCH] :bug: Fix swapped Move left and Move right shortcuts (#13068) The `move-unit-left` shortcut was bound to the Right arrow and moved the selection right, and `move-unit-right` the reverse, in both the workspace and the path editor. Arrow keys behaved correctly, but the shortcuts panel and the shortcut settings showed "Move left" next to the Right arrow, and customizing "Move left" rebound the rightward move. AI-assisted-by: claude-opus-5-5 Signed-off-by: Roshan Ramani --- .../main/data/workspace/path/shortcuts.cljs | 16 ++++++++-------- .../src/app/main/data/workspace/shortcuts.cljs | 18 +++++++++--------- .../ui/shortcuts_labels_test.cljs | 8 ++++++++ 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/frontend/src/app/main/data/workspace/path/shortcuts.cljs b/frontend/src/app/main/data/workspace/path/shortcuts.cljs index fbe1483de6..e4f149f607 100644 --- a/frontend/src/app/main/data/workspace/path/shortcuts.cljs +++ b/frontend/src/app/main/data/workspace/path/shortcuts.cljs @@ -269,17 +269,17 @@ :section [:workspace] :fn #(st/emit! (drp/move-selected :down false))} - :move-unit-left {:tooltip ds/right-arrow + :move-unit-left {:tooltip ds/left-arrow :label (fn [] (tr "shortcuts.move-unit-left")) - :command "right" - :section [:workspace] - :fn #(st/emit! (drp/move-selected :right false))} - - :move-unit-right {:tooltip ds/left-arrow - :label (fn [] (tr "shortcuts.move-unit-right")) :command "left" :section [:workspace] - :fn #(st/emit! (drp/move-selected :left false))}}) + :fn #(st/emit! (drp/move-selected :left false))} + + :move-unit-right {:tooltip ds/right-arrow + :label (fn [] (tr "shortcuts.move-unit-right")) + :command "right" + :section [:workspace] + :fn #(st/emit! (drp/move-selected :right false))}}) (defn get-tooltip [shortcut] (assert (contains? shortcuts shortcut) (str shortcut)) diff --git a/frontend/src/app/main/data/workspace/shortcuts.cljs b/frontend/src/app/main/data/workspace/shortcuts.cljs index 9b8eb6bd09..5d05d6d8ba 100644 --- a/frontend/src/app/main/data/workspace/shortcuts.cljs +++ b/frontend/src/app/main/data/workspace/shortcuts.cljs @@ -326,19 +326,19 @@ :subsections [:modify-layers] :fn #(emit-when-no-readonly (dwt/move-selected :down false))} - :move-unit-left {:tooltip ds/right-arrow + :move-unit-left {:tooltip ds/left-arrow :label (fn [] (tr "shortcuts.move-unit-left")) - :command ["right" "alt+right"] - :subsections [:modify-layers] - :section [:workspace] - :fn #(emit-when-no-readonly (dwt/move-selected :right false))} - - :move-unit-right {:tooltip ds/left-arrow - :label (fn [] (tr "shortcuts.move-unit-right")) :command ["left" "alt+left"] + :subsections [:modify-layers] + :section [:workspace] + :fn #(emit-when-no-readonly (dwt/move-selected :left false))} + + :move-unit-right {:tooltip ds/right-arrow + :label (fn [] (tr "shortcuts.move-unit-right")) + :command ["right" "alt+right"] :section [:workspace] :subsections [:modify-layers] - :fn #(emit-when-no-readonly (dwt/move-selected :left false))} + :fn #(emit-when-no-readonly (dwt/move-selected :right false))} :artboard-selection {:tooltip (ds/meta (ds/alt "G")) :label (fn [] (tr "shortcuts.artboard-selection")) diff --git a/frontend/test/frontend_tests/ui/shortcuts_labels_test.cljs b/frontend/test/frontend_tests/ui/shortcuts_labels_test.cljs index 3f3715d1d7..3df04c3ccf 100644 --- a/frontend/test/frontend_tests/ui/shortcuts_labels_test.cljs +++ b/frontend/test/frontend_tests/ui/shortcuts_labels_test.cljs @@ -75,3 +75,11 @@ (ss/translation-keyname :sc :stale-id))) (t/is (= "shortcuts.preview-frame" (ss/translation-keyname :sc :preview-frame)))))) + +(t/deftest unit-move-commands-match-their-direction + (doseq [shortcuts [wsc/shortcuts psc/shortcuts] + dir ["up" "down" "left" "right"] + :let [id (keyword (str "move-unit-" dir)) + command (:command (get shortcuts id)) + commands (if (string? command) [command] command)]] + (t/is (= dir (first commands)) (str id " is bound to the " dir " arrow"))))