Move page alias formatting for list items so the text highlights properly

pull/10798/head
aurnik 2023-12-25 17:54:56 -08:00 committed by Tienson Qin
parent ca4f0d4c04
commit 2fcffcbd25
2 changed files with 12 additions and 9 deletions

View File

@ -77,7 +77,7 @@
(rum/defc root [{:keys [icon icon-theme query text info shortcut value-label value
title highlighted on-highlight on-highlight-dep header on-click
hoverable compact rounded on-mouse-enter component-opts] :as _props
hoverable compact rounded on-mouse-enter component-opts source-page] :as _props
:or {hoverable true rounded true}}
{:keys [app-config] :as context}]
(let [ref (rum/create-ref)
@ -124,7 +124,13 @@
[:div.flex.flex-1.flex-col
(when title
[:div.text-sm.pb-2.font-bold.text-gray-11 (highlight-query title)])
[:div {:class "text-sm font-medium text-gray-12"} (highlight-query text)
[:div {:class "text-sm font-medium text-gray-12"}
(if (and (= icon "page") (not= text source-page)) ;; alias
[:div.flex.flex-row.items-center.gap-2
(highlight-query text)
[:div.opacity-50.font-normal "alias of"]
source-page]
(highlight-query text))
(when info
[:span.text-xs.text-gray-11 " — " (highlight-query info)])]]
(when (or value-label value)

View File

@ -227,13 +227,10 @@
source-page (model/get-alias-source-page repo page)]
(hash-map :icon (if whiteboard? "whiteboard" "page")
:icon-theme :gray
:text (if source-page
[:div.flex.flex-row.items-center.gap-2
page
[:div.opacity-50.font-normal "alias of"]
(:block/original-name source-page)]
page)
:source-page page)))))]
:text page
:source-page (if source-page
(:block/original-name source-page)
page))))))]
(swap! !results update group merge {:status :success :items items}))))
(defmethod load-results :whiteboards [group state]