fix: search nodes shows title with parents

This commit also removes parents from page reference display because
1. there're bugs when clicking to edit
2. this may not be users' expected behavior
This commit is contained in:
Tienson Qin
2024-09-24 21:32:37 +08:00
parent 75f540bebc
commit cb0539ebec
15 changed files with 251 additions and 294 deletions

View File

@@ -150,8 +150,8 @@
own-order-list-type (some-> type str string/lower-case)
own-order-list-index (some->> own-order-list-type (get-idx-of-order-list-block block))]
(assoc config :own-order-list-type own-order-list-type
:own-order-list-index own-order-list-index
:own-order-number-list? (= own-order-list-type "number"))))
:own-order-list-index own-order-list-index
:own-order-number-list? (= own-order-list-type "number"))))
(defn- text-range-by-lst-fst-line [content [direction pos]]
(case direction
@@ -197,11 +197,8 @@
(state/clear-edit! {:clear-editing-block? false}))
(when-let [block-id (:block/uuid block)]
(let [repo (state/get-current-repo)
db-graph? (config/db-based-graph? repo)
block (or (db/entity [:block/uuid block-id]) block)
content (if (and db-graph? (:block/name block))
(:block/title-with-refs-parent block)
(or custom-content (:block/title-with-refs-parent block) ""))
content (or custom-content (:block/title block) "")
content-length (count content)
text-range (cond
(vector? pos)
@@ -403,7 +400,6 @@
:else
nil)))))))))))
(defn on-touch-end
[_event block uuid *show-left-menu? *show-right-menu?]
(when @*swipe