fix: query with breadcrumbs show blocks on wrong hierarchy

close #5859
pull/8949/head
Tienson Qin 2023-03-29 04:42:09 +08:00
parent ecdb68bf65
commit 43bb77322f
2 changed files with 16 additions and 5 deletions

View File

@ -3699,10 +3699,17 @@
[:div
(page-cp config page)
(when alias? [:span.text-sm.font-medium.opacity-50 " Alias"])]
(for [[parent blocks] parent-blocks]
(rum/with-key
(breadcrumb-with-container blocks config)
(:db/id parent)))
(let [{top-level-blocks true others false} (group-by
(fn [b] (= (:db/id page) (:db/id (first b))))
parent-blocks)
sorted-parent-blocks (concat top-level-blocks others)]
(for [[parent blocks] sorted-parent-blocks]
[:div {:class (if (= (:db/id parent) (:db/id page))
"top-level-matched-blocks"
"nested-matched-blocks")}
(rum/with-key
(breadcrumb-with-container blocks config)
(:db/id parent))]))
{:debug-id page
:trigger-once? false})])))))]

View File

@ -632,6 +632,10 @@ a.cloze-revealed {
opacity: 1;
}
.nested-matched-blocks {
margin-left: 27px;
}
.cp__fenced-code-block {
.not-edit {
cursor: default;