feat: db auto backup on desktop (#12275)

* feat: db auto backup on desktop
* fix: press delete closes right sidebar

fix https://github.com/logseq/db-test/issues/670

* disable git backup for db graphs since it's confusing

Users can still use external Git for version control.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Tienson Qin
2025-12-25 10:40:59 +08:00
committed by GitHub
parent afd4210906
commit cf80caebf6
10 changed files with 237 additions and 93 deletions

View File

@@ -1301,12 +1301,21 @@ Similar to re-frame subscriptions"
[item]
(update-state! [:ui/navigation-item-collapsed? item] not))
(declare sidebar-add-block!)
(defn- sidebar-add-content-when-open!
[]
(when (empty? (:sidebar/blocks @state))
(sidebar-add-block! (get-current-repo) "contents" :contents)))
(defn toggle-sidebar-open?!
[]
(when-not (:ui/sidebar-open? @state)
(sidebar-add-content-when-open!))
(swap! state update :ui/sidebar-open? not))
(defn open-right-sidebar!
[]
(sidebar-add-content-when-open!)
(swap! state assoc :ui/sidebar-open? true))
(defn hide-right-sidebar!