-
-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Feature Monitoring: Navigation from Athena * feat: Future Monitoring Navigation, source left shortcuts * feat: Feature Monitoring Navigation, source all pages. * feat: Feature Monitoring Navigation, source App Bar * feat: Feature Monitoring Navigation, Page Header, Linked & Unlinked sections. * feat: Feature Monitoring Navigation. Block page Header, breadcrumbs & linked sections. * feat: Feature Monitoring Navigation, source graph * rfct: track navigation, `parse-renderer` usage * rfct: `router/navigate-page` usage monitoring * rfct: `router/navigate-uid` based navigation reporting * rfct: `router/nav-daily-notes` nav tracking * rfct: `router/navigate` nav tracking * style: fix * rfct: naming and review feedback * rfct: left a note about feature monitoring might be wrong * style: fix
- Loading branch information
Showing
12 changed files
with
492 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,101 @@ | ||
(ns athens.views.app-toolbar | ||
(:require | ||
["/components/AppToolbar/AppToolbar" :refer [AppToolbar]] | ||
[athens.electron.db-menu.core :refer [db-menu]] | ||
[athens.electron.db-modal :as db-modal] | ||
[athens.electron.utils :as electron.utils] | ||
[athens.router :as router] | ||
[athens.self-hosted.presence.views :refer [toolbar-presence-el]] | ||
[athens.style :refer [unzoom]] | ||
[athens.electron.db-menu.core :refer [db-menu]] | ||
[athens.electron.db-modal :as db-modal] | ||
[athens.electron.utils :as electron.utils] | ||
[athens.router :as router] | ||
[athens.self-hosted.presence.views :refer [toolbar-presence-el]] | ||
[athens.style :refer [unzoom]] | ||
[athens.subs] | ||
[athens.util :as util] | ||
[re-frame.core :refer [subscribe dispatch]] | ||
[reagent.core :as r])) | ||
[athens.util :as util] | ||
[re-frame.core :as rf] | ||
[reagent.core :as r])) | ||
|
||
|
||
(defn app-toolbar | ||
[] | ||
(let [left-open? (subscribe [:left-sidebar/open]) | ||
right-open? (subscribe [:right-sidebar/open]) | ||
route-name (subscribe [:current-route/name]) | ||
os (util/get-os) | ||
electron? electron.utils/electron? | ||
theme-dark (subscribe [:theme/dark]) | ||
win-focused? (if electron? | ||
(subscribe [:win-focused?]) | ||
(r/atom false)) | ||
win-maximized? (if electron? | ||
(subscribe [:win-maximized?]) | ||
(r/atom false)) | ||
win-fullscreen? (if electron? | ||
(subscribe [:win-fullscreen?]) | ||
(r/atom false)) | ||
merge-open? (reagent.core/atom false) | ||
|
||
selected-db (subscribe [:db-picker/selected-db])] | ||
(let [left-open? (rf/subscribe [:left-sidebar/open]) | ||
right-open? (rf/subscribe [:right-sidebar/open]) | ||
help-open? (rf/subscribe [:help/open?]) | ||
athena-open? (rf/subscribe [:athena/open]) | ||
route-name (rf/subscribe [:current-route/name]) | ||
theme-dark (rf/subscribe [:theme/dark]) | ||
selected-db (rf/subscribe [:db-picker/selected-db]) | ||
electron? electron.utils/electron? | ||
win-focused? (if electron? | ||
(rf/subscribe [:win-focused?]) | ||
(r/atom false)) | ||
win-maximized? (if electron? | ||
(rf/subscribe [:win-maximized?]) | ||
(r/atom false)) | ||
win-fullscreen? (if electron? | ||
(rf/subscribe [:win-fullscreen?]) | ||
(r/atom false)) | ||
merge-open? (r/atom false) | ||
os (util/get-os) | ||
on-left-sidebar-toggle #(rf/dispatch [:left-sidebar/toggle]) | ||
on-back #(.back js/window.history) | ||
on-forward #(.forward js/window.history) | ||
on-daily-pages (fn [_] | ||
(rf/dispatch [:reporting/navigation {:source :app-toolbar | ||
:target :home | ||
:pane :main-pane}]) | ||
(router/nav-daily-notes)) | ||
on-all-pages (fn [_] | ||
(rf/dispatch [:reporting/navigation {:source :app-toolbar | ||
:target :all-pages | ||
:pane :main-pane}]) | ||
(router/navigate :pages)) | ||
on-graph (fn [_] | ||
(rf/dispatch [:reporting/navigation {:source :app-toolbar | ||
:target :graph | ||
:pane :main-pane}]) | ||
(router/navigate :graph)) | ||
on-settings (fn [_] | ||
(rf/dispatch [:reporting/navigation {:source :app-toolbar | ||
:target :settings | ||
:pane :main-pane}]) | ||
(router/navigate :settings)) | ||
on-athena #(rf/dispatch [:athena/toggle]) | ||
on-help #(rf/dispatch [:help/toggle]) | ||
on-theme #(rf/dispatch [:theme/toggle]) | ||
on-merge #(swap! merge-open? not) | ||
on-right-sidebar #(rf/dispatch [:right-sidebar/toggle]) | ||
on-maximize #(rf/dispatch [:toggle-max-min-win]) | ||
on-minimize #(rf/dispatch [:minimize-win]) | ||
on-close #(rf/dispatch [:close-win])] | ||
(fn [] | ||
[:<> | ||
(when @merge-open? | ||
[db-modal/merge-modal merge-open?]) | ||
[:> AppToolbar {:style (unzoom) | ||
:os os | ||
:isElectron electron? | ||
:route @route-name | ||
:isWinFullscreen @win-fullscreen? | ||
:isWinMaximized @win-maximized? | ||
:isWinFocused @win-focused? | ||
:isHelpOpen @(subscribe [:help/open?]) | ||
:isThemeDark @theme-dark | ||
:isLeftSidebarOpen @left-open? | ||
:isRightSidebarOpen @right-open? | ||
:isCommandBarOpen @(subscribe [:athena/open]) | ||
:onPressLeftSidebarToggle #(dispatch [:left-sidebar/toggle]) | ||
:onPressHistoryBack #(.back js/window.history) | ||
:onPressHistoryForward #(.forward js/window.history) | ||
:onPressDailyNotes router/nav-daily-notes | ||
:onPressAllPages #(router/navigate :pages) | ||
:onPressGraph #(router/navigate :graph) | ||
:onPressCommandBar #(dispatch [:athena/toggle]) | ||
:onPressHelp #(dispatch [:help/toggle]) | ||
:onPressThemeToggle #(dispatch [:theme/toggle]) | ||
:onPressSettings #(router/navigate :settings) | ||
:onPressMerge #(swap! merge-open? not) | ||
:onPressRightSidebarToggle #(dispatch [:right-sidebar/toggle]) | ||
:onPressMaximizeRestore #(dispatch [:toggle-max-min-win]) | ||
:onPressMinimize #(dispatch [:minimize-win]) | ||
:onPressClose #(dispatch [:close-win]) | ||
:databaseMenu (r/as-element [db-menu]) | ||
:presenceDetails (when (electron.utils/remote-db? @selected-db) | ||
(r/as-element [toolbar-presence-el]))}]]))) | ||
[:> AppToolbar {:style (unzoom) | ||
:os os | ||
:isElectron electron? | ||
:route @route-name | ||
:isWinFullscreen @win-fullscreen? | ||
:isWinMaximized @win-maximized? | ||
:isWinFocused @win-focused? | ||
:isHelpOpen @help-open? | ||
:isThemeDark @theme-dark | ||
:isLeftSidebarOpen @left-open? | ||
:isRightSidebarOpen @right-open? | ||
:isCommandBarOpen @athena-open? | ||
:onPressLeftSidebarToggle on-left-sidebar-toggle | ||
:onPressHistoryBack on-back | ||
:onPressHistoryForward on-forward | ||
:onPressDailyNotes on-daily-pages | ||
:onPressAllPages on-all-pages | ||
:onPressGraph on-graph | ||
:onPressCommandBar on-athena | ||
:onPressHelp on-help | ||
:onPressThemeToggle on-theme | ||
:onPressSettings on-settings | ||
:onPressMerge on-merge | ||
:onPressRightSidebarToggle on-right-sidebar | ||
:onPressMaximizeRestore on-maximize | ||
:onPressMinimize on-minimize | ||
:onPressClose on-close | ||
:databaseMenu (r/as-element [db-menu]) | ||
:presenceDetails (when (electron.utils/remote-db? @selected-db) | ||
(r/as-element [toolbar-presence-el]))}]]))) |
Oops, something went wrong.