🐛 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 <roshanramani.dev@gmail.com>
This commit is contained in:
Roshan Ramani 2026-11-17 14:15:02 +05:30 committed by GitHub
parent 0ae02daae9
commit 32d488e162
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 17 deletions

View File

@ -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))

View File

@ -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"))

View File

@ -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"))))