From c1b9d43dc78bf28901a9e2aeb4efb700deb76a69 Mon Sep 17 00:00:00 2001 From: scheinriese Date: Tue, 19 May 2026 13:49:16 +0200 Subject: [PATCH] refactor(cmdk): drop dead :ignore-current-icon? flag from 4 call sites MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/main/frontend/components/cmdk/core.cljs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/frontend/components/cmdk/core.cljs b/src/main/frontend/components/cmdk/core.cljs index 2da082f2f7..33a9c0da61 100644 --- a/src/main/frontend/components/cmdk/core.cljs +++ b/src/main/frontend/components/cmdk/core.cljs @@ -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]