diff --git a/src/main/frontend/components/property/value.cljs b/src/main/frontend/components/property/value.cljs index 14def66481..7bbbd6c2b6 100644 --- a/src/main/frontend/components/property/value.cljs +++ b/src/main/frontend/components/property/value.cljs @@ -512,7 +512,10 @@ options (map (fn [node] (let [id (or (:value node) (:db/id node)) [header label] (if (integer? id) - (let [title (subs (title/block-unique-title node) 0 256) + (let [node-title (if (seq (:property/schema.classes property)) + (:block/title node) + (title/block-unique-title node)) + title (subs node-title 0 256) node (or (db/entity id) node) icon (get-node-icon node) header (when-not (db/page? node) diff --git a/src/main/frontend/handler/graph.cljs b/src/main/frontend/handler/graph.cljs index 1292c6dfaf..32d0eea5f2 100644 --- a/src/main/frontend/handler/graph.cljs +++ b/src/main/frontend/handler/graph.cljs @@ -11,8 +11,7 @@ [frontend.storage :as storage] [logseq.graph-parser.db :as gp-db] [logseq.db.sqlite.create-graph :as sqlite-create-graph] - [logseq.db :as ldb] - [frontend.components.title :as title])) + [logseq.db :as ldb])) (defn- build-links [links] @@ -45,7 +44,7 @@ size (int (* 8 (max 1.0 (js/Math.cbrt n))))] (cond-> {:id (str (:db/id p)) - :label (title/block-unique-title p) + :label page-title :size size :color color :block/created-at (:block/created-at p)} @@ -72,8 +71,8 @@ (defn- normalize-page-name [{:keys [nodes links]}] (let [nodes' (->> (remove-uuids-and-files! nodes) - (util/distinct-by (fn [node] (:id node))) - (remove nil?))] + (util/distinct-by (fn [node] (:id node))) + (remove nil?))] {:nodes nodes' :links links})) @@ -207,15 +206,15 @@ (let [search-nodes (fn [forward?] (let [links (group-by (if forward? :source :target) links)] (loop [nodes nodes - level level] - (if (zero? level) - nodes - (recur (distinct (apply concat nodes - (map - (fn [id] - (->> (get links id) (map (if forward? :target :source)))) - nodes))) - (dec level)))))) + level level] + (if (zero? level) + nodes + (recur (distinct (apply concat nodes + (map + (fn [id] + (->> (get links id) (map (if forward? :target :source)))) + nodes))) + (dec level)))))) nodes (concat (search-nodes true) (search-nodes false)) nodes (set nodes)] (update graph :nodes