Przeglądaj źródła

fix: don't show matched children blocks in view results

Tienson Qin 4 miesięcy temu
rodzic
commit
6c3e3c344d

+ 5 - 1
deps/db/src/logseq/db/common/view.cljs

@@ -451,8 +451,12 @@
           filters (or (:logseq.property.table/filters view) filters)
           feat-type (or view-feature-type (:logseq.property.view/feature-type view))
           query? (= feat-type :query-result)
+          query-entity-ids (when (seq query-entity-ids) (set query-entity-ids))
           entities-result (if query?
-                            (keep #(d/entity db %) query-entity-ids)
+                            (keep (fn [id]
+                                    (let [e (d/entity db id)]
+                                      (when-not (contains? query-entity-ids (:db/id (:block/parent e)))
+                                        e))) query-entity-ids)
                             (get-view-entities db view-id opts))
           entities (if (= feat-type :linked-references)
                      (:ref-blocks entities-result)

+ 1 - 1
src/main/frontend/components/query/result.cljs

@@ -29,7 +29,7 @@
                            form (common-util/safe-read-string {:log-error? false} q)]
                        (cond
                          (and (symbol? form)
-                 ;; Queries only containing template should trigger a query
+                              ;; Queries only containing template should trigger a query
                               (not (re-matches template/template-re (string/trim q))))
                          nil
 

+ 1 - 1
src/main/frontend/components/views.cljs

@@ -2100,7 +2100,7 @@
                                       (rum/with-key
                                         (ui/foldable
                                          [:div
-                                          {:class (when-not list-view? "my-4")}
+                                          {:class (when-not list-view? "my-2")}
                                           (cond
                                             group-by-page?
                                             (if value