From 275c93e63628ab4935d2750dd11ef3bc04c7df85 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Wed, 29 Jul 2026 12:33:44 +0200 Subject: [PATCH] :bug: Cancel shortcut is not appearing on disabled tab --- .../data/workspace/grid_layout/shortcuts.cljs | 10 ++++++- .../main/data/workspace/path/shortcuts.cljs | 26 +++++++++++++++++++ .../app/main/data/workspace/shortcuts.cljs | 4 +++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/data/workspace/grid_layout/shortcuts.cljs b/frontend/src/app/main/data/workspace/grid_layout/shortcuts.cljs index e1ca153f48..326ffe93c3 100644 --- a/frontend/src/app/main/data/workspace/grid_layout/shortcuts.cljs +++ b/frontend/src/app/main/data/workspace/grid_layout/shortcuts.cljs @@ -34,38 +34,46 @@ (def shortcuts {:escape {:tooltip (ds/esc) :command ["escape" "enter" "v"] + :section [:workspace] :fn #(st/emit! (esc-pressed))} :undo {:tooltip (ds/meta "Z") :command (ds/c-mod "z") + :section [:workspace] :fn #(st/emit! dwu/undo)} :redo {:tooltip (ds/meta "Y") :command [(ds/c-mod "shift+z") (ds/c-mod "y")] + :section [:workspace] :fn #(st/emit! dwu/redo)} ;; ZOOM :increase-zoom {:tooltip "+" :command "+" + :section [:workspace] :fn #(st/emit! (dw/increase-zoom nil))} :decrease-zoom {:tooltip "-" :command "-" + :section [:workspace] :fn #(st/emit! (dw/decrease-zoom nil))} :reset-zoom {:tooltip (ds/shift "0") :command "shift+0" + :section [:workspace] :fn #(st/emit! dw/reset-zoom)} :fit-all {:tooltip (ds/shift "1") :command "shift+1" + :section [:workspace] :fn #(st/emit! dw/zoom-to-fit-all)} :zoom-selected {:tooltip (ds/shift "2") :command "shift+2" + :section [:workspace] :fn #(st/emit! dw/zoom-to-selected-shape)}}) (defn get-tooltip [shortcut] (assert (contains? shortcuts shortcut) (str shortcut)) - (get-in shortcuts [shortcut :tooltip])) \ No newline at end of file + (get-in shortcuts [shortcut :tooltip])) diff --git a/frontend/src/app/main/data/workspace/path/shortcuts.cljs b/frontend/src/app/main/data/workspace/path/shortcuts.cljs index 24444d711d..fe35b33e40 100644 --- a/frontend/src/app/main/data/workspace/path/shortcuts.cljs +++ b/frontend/src/app/main/data/workspace/path/shortcuts.cljs @@ -30,120 +30,146 @@ {:move-nodes {:tooltip "M" :command "m" :subsections [:path-editor] + :section [:workspace] :fn #(st/emit! (drp/change-edit-mode :move))} :draw-nodes {:tooltip "P" :command "p" :subsections [:path-editor] + :section [:workspace] :fn #(st/emit! (drp/change-edit-mode :draw))} :add-node {:tooltip (ds/shift "+") :command "shift++" :subsections [:path-editor] + :section [:workspace] :fn #(st/emit! (drp/add-node))} :delete-node {:tooltip (ds/supr) :command ["del" "backspace"] :subsections [:path-editor] + :section [:workspace] :fn #(st/emit! (drp/remove-node))} :merge-nodes {:tooltip (ds/meta "J") :command (ds/c-mod "j") :subsections [:path-editor] + :section [:workspace] :fn #(st/emit! (drp/merge-nodes))} :join-nodes {:tooltip "J" :command "j" :subsections [:path-editor] + :section [:workspace] :fn #(st/emit! (drp/join-nodes))} :separate-nodes {:tooltip "K" :command "k" :subsections [:path-editor] + :section [:workspace] :fn #(st/emit! (drp/separate-nodes))} :make-corner {:tooltip "X" :command "x" :subsections [:path-editor] + :section [:workspace] :fn #(st/emit! (drp/make-corner))} :make-curve {:tooltip "C" :command "c" :subsections [:path-editor] + :section [:workspace] :fn #(st/emit! (drp/make-curve))} :snap-nodes {:tooltip (ds/meta "'") ;;https://github.com/ccampbell/mousetrap/issues/85 :command [(ds/c-mod "'") (ds/c-mod "219")] :subsections [:path-editor] + :section [:workspace] :fn #(st/emit! (drp/toggle-snap))} :escape {:tooltip (ds/esc) :command ["escape" "enter" "v"] + :section [:workspace] :fn #(st/emit! (esc-pressed))} :undo {:tooltip (ds/meta "Z") :command (ds/c-mod "z") + :section [:workspace] :fn #(st/emit! (drp/undo-path))} :redo {:tooltip (ds/meta "Y") :command [(ds/c-mod "shift+z") (ds/c-mod "y")] + :section [:workspace] :fn #(st/emit! (drp/redo-path))} ;; ZOOM :increase-zoom {:tooltip "+" :command "+" + :section [:workspace] :fn #(st/emit! (dw/increase-zoom nil))} :decrease-zoom {:tooltip "-" :command "-" + :section [:workspace] :fn #(st/emit! (dw/decrease-zoom nil))} :reset-zoom {:tooltip (ds/shift "0") :command "shift+0" + :section [:workspace] :fn #(st/emit! dw/reset-zoom)} :fit-all {:tooltip (ds/shift "1") :command "shift+1" + :section [:workspace] :fn #(st/emit! dw/zoom-to-fit-all)} :zoom-selected {:tooltip (ds/shift "2") :command "shift+2" + :section [:workspace] :fn #(st/emit! dw/zoom-to-selected-shape)} ;; Arrow movement :move-fast-up {:tooltip (ds/shift ds/up-arrow) :command "shift+up" + :section [:workspace] :fn #(st/emit! (drp/move-selected :up true))} :move-fast-down {:tooltip (ds/shift ds/down-arrow) :command "shift+down" + :section [:workspace] :fn #(st/emit! (drp/move-selected :down true))} :move-fast-right {:tooltip (ds/shift ds/right-arrow) :command "shift+right" + :section [:workspace] :fn #(st/emit! (drp/move-selected :right true))} :move-fast-left {:tooltip (ds/shift ds/left-arrow) :command "shift+left" + :section [:workspace] :fn #(st/emit! (drp/move-selected :left true))} :move-unit-up {:tooltip ds/up-arrow :command "up" + :section [:workspace] :fn #(st/emit! (drp/move-selected :up false))} :move-unit-down {:tooltip ds/down-arrow :command "down" + :section [:workspace] :fn #(st/emit! (drp/move-selected :down false))} :move-unit-left {:tooltip ds/right-arrow :command "right" + :section [:workspace] :fn #(st/emit! (drp/move-selected :right false))} :move-unit-right {:tooltip ds/left-arrow :command "left" + :section [:workspace] :fn #(st/emit! (drp/move-selected :left false))}}) (defn get-tooltip [shortcut] diff --git a/frontend/src/app/main/data/workspace/shortcuts.cljs b/frontend/src/app/main/data/workspace/shortcuts.cljs index 0379d46017..c548bcd184 100644 --- a/frontend/src/app/main/data/workspace/shortcuts.cljs +++ b/frontend/src/app/main/data/workspace/shortcuts.cljs @@ -158,6 +158,7 @@ :escape {:tooltip (ds/esc) :command "escape" :subsections [:edit] + :section [:workspace] :fn #(st/emit! :interrupt (dwdc/clear-drawing) (dw/deselect-all true))} :find {:tooltip (ds/meta "F") :command (ds/c-mod "f") :subsections [:edit] @@ -184,6 +185,7 @@ :ungroup {:tooltip (ds/shift "G") :command "shift+g" :subsections [:modify-layers] + :section [:workspace] :fn #(emit-when-no-readonly (dw/ungroup-selected))} :mask {:tooltip (ds/meta "M") @@ -356,11 +358,13 @@ :draw-line {:tooltip "L" :command "l" :subsections [:tools] + :section [:workspace] :fn #(emit-when-no-readonly (dwd/select-for-drawing :line))} :draw-arrow {:tooltip (ds/shift "L") :command "shift+l" :subsections [:tools] + :section [:workspace] :fn #(emit-when-no-readonly (dwd/select-for-drawing :arrow))} :draw-curve {:tooltip (ds/shift "C")