mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 19:28:12 +00:00
🐛 Fix search shortcut
This commit is contained in:
parent
a51fd009bc
commit
9e8cdc8a3f
@ -17,6 +17,8 @@
|
||||
- Fix nested variant in a component doesn't keep inherited overrides [Taiga #12299](https://tree.taiga.io/project/penpot/issue/12299)
|
||||
- Fix on copy instance inside a components chain touched are missing [Taiga #12371](https://tree.taiga.io/project/penpot/issue/12371)
|
||||
- Fix problem with multiple selection and shadows [Github #7437](https://github.com/penpot/penpot/issues/7437)
|
||||
- Fix search shortcut [Taiga #10265](https://tree.taiga.io/project/penpot/issue/10265)
|
||||
|
||||
|
||||
## 2.11.0 (Unreleased)
|
||||
|
||||
|
||||
@ -13,13 +13,16 @@
|
||||
[app.main.data.shortcuts :as ds]
|
||||
[app.main.store :as st]))
|
||||
|
||||
;; Shortcuts definitions
|
||||
(def shortcuts
|
||||
{:go-to-search {:tooltip (ds/meta "F")
|
||||
:command (ds/c-mod "f")
|
||||
:subsections [:navigation-dashboard]
|
||||
:fn #(st/emit! (dcm/go-to-dashboard-search))}
|
||||
{:toggle-theme {:tooltip (ds/alt "M")
|
||||
:command (ds/a-mod "m")
|
||||
:subsections [:general-dashboard]
|
||||
:fn #(st/emit! (with-meta (du/toggle-theme)
|
||||
{::ev/origin "dashboard:shortcuts"}))}})
|
||||
|
||||
:go-to-drafts {:tooltip "G D"
|
||||
(def shortcuts-sidebar-navigation
|
||||
{:go-to-drafts {:tooltip "G D"
|
||||
:command "g d"
|
||||
:subsections [:navigation-dashboard]
|
||||
:fn #(st/emit! (dcm/go-to-dashboard-files :project-id :default))}
|
||||
@ -27,20 +30,35 @@
|
||||
:go-to-libs {:tooltip "G L"
|
||||
:command "g l"
|
||||
:subsections [:navigation-dashboard]
|
||||
:fn #(st/emit! (dcm/go-to-dashboard-libraries))}
|
||||
:fn #(st/emit! (dcm/go-to-dashboard-libraries))}})
|
||||
|
||||
:create-new-project {:tooltip "+"
|
||||
(def shortcut-search
|
||||
{:go-to-search {:tooltip (ds/meta "F")
|
||||
:command (ds/c-mod "f")
|
||||
:subsections [:navigation-dashboard]
|
||||
:fn #(st/emit! (dcm/go-to-dashboard-search))}})
|
||||
|
||||
(def shortcut-create-new-project
|
||||
{:create-new-project {:tooltip "+"
|
||||
:command "+"
|
||||
:subsections [:general-dashboard]
|
||||
:fn #(st/emit! (dd/create-element))}
|
||||
:fn #(st/emit! (dd/create-element))}})
|
||||
|
||||
:toggle-theme {:tooltip (ds/alt "M")
|
||||
:command (ds/a-mod "m")
|
||||
:subsections [:general-dashboard]
|
||||
:fn #(st/emit! (with-meta (du/toggle-theme)
|
||||
{::ev/origin "dashboard:shortcuts"}))}})
|
||||
;; Shortcuts combinations for files, drafts, libraries and fonts sections
|
||||
(def shortcuts-dashboard
|
||||
(merge shortcuts
|
||||
shortcuts-sidebar-navigation))
|
||||
|
||||
(def shortcuts-projects
|
||||
(merge shortcuts
|
||||
shortcuts-sidebar-navigation
|
||||
shortcut-search
|
||||
shortcut-create-new-project))
|
||||
|
||||
(def shortcuts-drafts-libraries
|
||||
(merge shortcuts
|
||||
shortcuts-sidebar-navigation
|
||||
shortcut-search))
|
||||
|
||||
(defn get-tooltip [shortcut]
|
||||
(assert (contains? shortcuts shortcut) (str shortcut))
|
||||
|
||||
@ -267,7 +267,7 @@
|
||||
(filter :is-default)
|
||||
(first)))]
|
||||
|
||||
(hooks/use-shortcuts ::dashboard sc/shortcuts)
|
||||
(hooks/use-shortcuts ::dashboard sc/shortcuts-dashboard)
|
||||
|
||||
(mf/with-effect [team-id]
|
||||
(st/emit! (dd/initialize team-id))
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
(:require
|
||||
[app.main.data.common :as dcm]
|
||||
[app.main.data.dashboard :as dd]
|
||||
[app.main.data.dashboard.shortcuts :as sc]
|
||||
[app.main.data.event :as ev]
|
||||
[app.main.data.project :as dpj]
|
||||
[app.main.refs :as refs]
|
||||
@ -183,6 +184,8 @@
|
||||
(st/emit! (dpj/fetch-files project-id)
|
||||
(dd/clear-selected-files)))
|
||||
|
||||
(hooks/use-shortcuts ::dashboard sc/shortcuts-drafts-libraries)
|
||||
|
||||
[:*
|
||||
[:> header* {:team team
|
||||
:can-edit can-edit?
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
(:require-macros [app.main.style :as stl])
|
||||
(:require
|
||||
[app.main.data.dashboard :as dd]
|
||||
[app.main.data.dashboard.shortcuts :as sc]
|
||||
[app.main.data.team :as dtm]
|
||||
[app.main.refs :as refs]
|
||||
[app.main.store :as st]
|
||||
@ -60,6 +61,8 @@
|
||||
(st/emit! (dtm/fetch-shared-files team-id)
|
||||
(dd/clear-selected-files)))
|
||||
|
||||
(hooks/use-shortcuts ::dashboard sc/shortcuts-drafts-libraries)
|
||||
|
||||
[:*
|
||||
[:header {:class (stl/css :dashboard-header) :data-testid "dashboard-header"}
|
||||
[:div#dashboard-libraries-title {:class (stl/css :dashboard-title)}
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
[app.common.time :as ct]
|
||||
[app.main.data.common :as dcm]
|
||||
[app.main.data.dashboard :as dd]
|
||||
[app.main.data.dashboard.shortcuts :as sc]
|
||||
[app.main.data.event :as ev]
|
||||
[app.main.data.modal :as modal]
|
||||
[app.main.data.project :as dpj]
|
||||
@ -352,6 +353,8 @@
|
||||
(st/emit! (dd/fetch-recent-files team-id)
|
||||
(dd/clear-selected-files)))
|
||||
|
||||
(hooks/use-shortcuts ::dashboard sc/shortcuts-projects)
|
||||
|
||||
(when (seq projects)
|
||||
[:*
|
||||
[:> header* {:can-edit can-edit}]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user