Fase B2: give Contents root semantics alongside Library

Adds a shared common-config/contents-page-name constant and
ldb/contents?/get-contents-page, mirroring the existing Library
helpers. Contents already qualifies as an internal page, so the
existing namespace-title split mechanism (e.g. "Contents/Proyectos")
already parents pages under it via :block/parent, coexisting with
Library rather than replacing it as the default root.
This commit is contained in:
2026-08-26 19:02:49 +02:00
parent c50511a7b5
commit fcf41c7b41
6 changed files with 18 additions and 3 deletions

View File

@@ -577,6 +577,11 @@
[db]
(get-built-in-page db common-config/library-page-name))
(def contents? db-db/contents?)
(defn get-contents-page
[db]
(get-built-in-page db common-config/contents-page-name))
(defn get-case-page
"Case sensitive version of get-page. For use with DB graphs"
[db page-name-or-uuid]

View File

@@ -431,7 +431,7 @@
structured-datoms (get-structured-datoms db)
user-datoms (get-all-user-datoms db)
list-style-datoms (get-list-style-values db)
pages-datoms (let [contents-id (get-first-page-by-title db "Contents")
pages-datoms (let [contents-id (get-first-page-by-title db common-config/contents-page-name)
capture-page-id (:db/id (db-db/get-built-in-page db common-config/quick-add-page-name))
views-id (get-first-page-by-title db common-config/views-page-name)
recycle-id (get-first-page-by-title db "Recycle")]

View File

@@ -139,3 +139,11 @@
[page]
(and (entity-util/built-in? page)
(= common-config/library-page-name (:block/title page))))
(defn contents?
"Whether `page` is the built-in Contents page, the other hierarchical
root pages can be explicitly organized under (coexists with Library,
which remains the default root for namespaced pages)."
[page]
(and (entity-util/built-in? page)
(= common-config/contents-page-name (:block/title page))))

View File

@@ -130,7 +130,7 @@
(def built-in-pages-names
#{common-config/library-page-name
common-config/quick-add-page-name
"Contents"})
common-config/contents-page-name})
(defn- validate-tx-for-duplicate-idents [tx]
(when-let [conflicting-idents