mirror of
https://github.com/logseq/logseq.git
synced 2026-05-28 06:34:34 +00:00
refactor(cmdk): drop dead :ignore-current-icon? flag from 4 call sites
The flag was introduced upstream by Tienson Qin (4c6c3322fe, Nov 2025,
"enhance(ux): show node icon in search results") to make cmdk skip the
block's own :logseq.property/icon and fall through to the class's icon
or fallback, keeping search rows visually consistent at the class level.
During this branch's icon-picker refactor, get-node-icon was rewritten
to a new own → tag-default → type-default inheritance model and lost
the opts map entirely. The four cmdk callers kept passing
{:ignore-current-icon? true} but get-node-icon-cp silently ignores it.
The new behavior (show the block's effective icon with full inheritance)
is preferable for the new picker model — pages with meaningful per-
instance icons like photos show their photos in cmdk, instead of a
generic class glyph. Drop the dead flags to reflect actual behavior and
remove the misleading vestige. If "always show class default in cmdk"
is wanted later, it's a deliberate new feature, not a regression to
restore.
Verified live: cmdk renders page rows with their inherited/own avatars,
asset rows with asset glyphs, block rows with dot fallbacks.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -211,7 +211,7 @@
|
||||
(state->action state nil))
|
||||
([state fallback-item]
|
||||
(let [highlighted-item (state->highlighted-item state fallback-item)
|
||||
action (get-action)]
|
||||
action (get-action)]
|
||||
(cond (and (:source-block highlighted-item) (= action :move-blocks)) :trigger
|
||||
(:source-block highlighted-item) :open
|
||||
(:file-path highlighted-item) :open
|
||||
@@ -230,7 +230,7 @@
|
||||
(let [!results (::results state)
|
||||
recent-pages (map (fn [block]
|
||||
(let [text (block-handler/block-unique-title block :truncate? false)
|
||||
icon (icon-component/get-node-icon-cp block {:ignore-current-icon? true})]
|
||||
icon (icon-component/get-node-icon-cp block {})]
|
||||
{:icon icon
|
||||
:icon-theme :gray
|
||||
:text text
|
||||
@@ -308,7 +308,7 @@
|
||||
(->> search-results
|
||||
(map (fn [block]
|
||||
(let [text (block-handler/block-unique-title block :truncate? false)
|
||||
icon (icon-component/get-node-icon-cp block {:ignore-current-icon? true})]
|
||||
icon (icon-component/get-node-icon-cp block {})]
|
||||
{:icon icon
|
||||
:icon-theme :gray
|
||||
:text text
|
||||
@@ -346,7 +346,7 @@
|
||||
(:block/uuid page))
|
||||
current-page? (and current-page-uuid
|
||||
(= current-page-uuid result-page-id))
|
||||
icon (icon-component/get-node-icon-cp entity {:ignore-current-icon? true})
|
||||
icon (icon-component/get-node-icon-cp entity {})
|
||||
title (block-handler/block-unique-title entity
|
||||
:alias (:block/title source-page)
|
||||
:truncate? false)]
|
||||
@@ -369,7 +369,7 @@
|
||||
[repo block current-page-uuid input]
|
||||
(let [id (:block/uuid block)
|
||||
text (block-handler/block-unique-title block :truncate? false)
|
||||
icon (icon-component/get-node-icon-cp block {:ignore-current-icon? true})]
|
||||
icon (icon-component/get-node-icon-cp block {})]
|
||||
{:icon icon
|
||||
:icon-theme :gray
|
||||
:text (highlight-content-query text input)
|
||||
@@ -856,9 +856,9 @@
|
||||
nil)]
|
||||
[:div {:data-item-index item-idx}
|
||||
(if (= group :nodes)
|
||||
(ui/lazy-visible (fn [] item) {:root scroll-root
|
||||
:root-margin "500px 0px"})
|
||||
item)]))
|
||||
(ui/lazy-visible (fn [] item) {:root scroll-root
|
||||
:root-margin "500px 0px"})
|
||||
item)]))
|
||||
|
||||
(defn- show-more-results!
|
||||
[state group]
|
||||
|
||||
Reference in New Issue
Block a user