From f1dac45145f021f0d869fac5321c55d59635f9da Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Wed, 5 Aug 2026 09:29:18 +0200 Subject: [PATCH] :bug: Fix paste as non customizable shortcut --- .../src/app/main/data/workspace/shortcuts.cljs | 1 + frontend/src/app/main/ui/settings/shortcuts.cljs | 2 ++ frontend/src/app/main/ui/shortcuts.cljs | 15 ++++++++++----- frontend/src/app/main/ui/shortcuts.scss | 4 ++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/main/data/workspace/shortcuts.cljs b/frontend/src/app/main/data/workspace/shortcuts.cljs index 192258f0d7..2cada6a3c5 100644 --- a/frontend/src/app/main/data/workspace/shortcuts.cljs +++ b/frontend/src/app/main/data/workspace/shortcuts.cljs @@ -110,6 +110,7 @@ :command (ds/c-mod "v") :subsections [:edit] :section [:workspace] + :customizable false :fn (constantly nil)} :paste-replace {:tooltip (ds/meta (ds/shift "V")) diff --git a/frontend/src/app/main/ui/settings/shortcuts.cljs b/frontend/src/app/main/ui/settings/shortcuts.cljs index 7534b57ea9..e01c57dada 100644 --- a/frontend/src/app/main/ui/settings/shortcuts.cljs +++ b/frontend/src/app/main/ui/settings/shortcuts.cljs @@ -393,6 +393,7 @@ customized? (and (contains? group-map shortcut-key) (not (str/blank? (get group-map shortcut-key))))] (and customized? + (not (false? (:customizable shortcut))) (or (str/blank? search-term) (matches-search (:translation shortcut) search-term)))))) @@ -406,6 +407,7 @@ in-group? (contains? group-map shortcut-key) blank? (str/blank? (get group-map shortcut-key))] (and in-group? blank? + (not (false? (:customizable shortcut))) (or (str/blank? search-term) (matches-search (:translation shortcut) search-term)))))) diff --git a/frontend/src/app/main/ui/shortcuts.cljs b/frontend/src/app/main/ui/shortcuts.cljs index 5db911b625..cb223d0dc0 100644 --- a/frontend/src/app/main/ui/shortcuts.cljs +++ b/frontend/src/app/main/ui/shortcuts.cljs @@ -612,8 +612,9 @@ (get custom-shortcuts section-key)) group-map (if (map? group-map) group-map {}) customized? (contains? group-map command) - has-conflict? (contains? conflicts command)] - (if editable? + has-conflict? (contains? conflicts command) + customizable? (not (false? (:customizable command-info)))] + (if (and editable? customizable?) [:> shortcut-row-editable* {:elements elements :custom-shortcuts custom-shortcuts :section-key section-key @@ -626,9 +627,13 @@ :data-conflict (str has-conflict?) :aria-label command-translate :key command-translate} - [:span {:class (stl/css :command-name) - :id (dm/str command-translate "-label")} - command-translate] + [:span + [:span {:class (stl/css-case :command-name true + :not-customizable-label (not customizable?)) + :id (dm/str command-translate "-label")} + command-translate] + (when (not customizable?) + [:span {:class (stl/css :not-customizable-label)} "(not customizable)"])] [:div {:class (stl/css :shortcut-actions) :aria-labelledby (dm/str command-translate "-label")} (if (and customized? (str/blank? content)) diff --git a/frontend/src/app/main/ui/shortcuts.scss b/frontend/src/app/main/ui/shortcuts.scss index 7d582e4e71..ac444a0fda 100644 --- a/frontend/src/app/main/ui/shortcuts.scss +++ b/frontend/src/app/main/ui/shortcuts.scss @@ -77,6 +77,10 @@ text-align: start; } +.not-customizable-label { + padding-inline-start: px2rem(6); +} + // Editable rows .shortcuts-name-editable {