Browse Source

added shortcut for closing the right sidebar top item resolving issue #7275 (#7622)

* added shortcut for closing the right sidebar top item resolving issue #7275

* namespace update & binding update

* reverting git binding

* Address remaining feedback

- Use close instead of clear as it is a more general verb for future
  commands
- Use 'c t' for binding

Co-authored-by: Gabriel Horner <[email protected]>
Sebastian Sosa 2 years ago
parent
commit
5f3636a924

+ 7 - 1
src/main/frontend/modules/shortcut/config.cljs

@@ -287,6 +287,9 @@
    :sidebar/open-today-page        {:binding (if mac? "mod+shift+j" "alt+shift+j")
                                     :fn      page-handler/open-today-in-sidebar}
 
+   :sidebar/close-top              {:binding "c t"
+                                    :fn      #(state/sidebar-remove-block! 0)}
+
    :sidebar/clear                  {:binding "mod+c mod+c"
                                     :fn      #(do
                                                 (state/clear-sidebar-blocks!)
@@ -582,7 +585,9 @@
                           :ui/install-plugins-from-file
                           :editor/toggle-open-blocks
                           :ui/toggle-cards
-                          :git/commit])
+                          :git/commit
+                          :sidebar/close-top
+                          ])
      (with-meta {:before m/enable-when-not-editing-mode!}))}))
 
 ;; To add a new entry to this map, first add it here and then
@@ -703,6 +708,7 @@
     :graph/add
     :graph/save
     :graph/re-index
+    :sidebar/close-top
     :sidebar/clear
     :sidebar/open-today-page
     :search/re-index

+ 1 - 0
src/main/frontend/modules/shortcut/dicts.cljc

@@ -88,6 +88,7 @@
    :go/forward                     "Forwards"
    :search/re-index                "Rebuild search index"
    :sidebar/open-today-page        "Open today's page in the right sidebar"
+   :sidebar/close-top              "Closes the top item in the right sidebar"
    :sidebar/clear                  "Clear all in the right sidebar"
    :misc/copy                      "mod+c"
    :command-palette/toggle         "Toggle command palette"