mirror of
https://github.com/logseq/logseq.git
synced 2026-05-26 21:54:26 +00:00
Hovering a color swatch in the text-picker didn't tint anything live
— neither the gallery preview tiles nor the page-icon next to the
page title. Previous commit (5551f6eb86) added the SUBSCRIBER side
in text-picker but no WRITER existed on this code path. The icon-picker
already broadcasts via `:on-hover!` / `:on-hover-end!` callbacks
supplied to `color-picker` (icon.cljs:3961-3972); the text-picker's
call passed only `*color` + selection callback.
Port the same pattern:
1. text-picker mount in icon-search (line 7159) now forwards the
preview-scope opts (`:preview-target-db-id`,
`:preview-target-db-ids`, `:preview-inheritor-db-ids`, `:property`).
2. text-picker's destructure (line 6416) accepts these keys and builds
`preview-base-target` via the same cond-> as the icon-picker
(icon.cljs:3545).
3. The existing subscriber gains a scope filter via
`icon-preview-matches?` so a hover meant for another entity
doesn't bleed in.
4. The `color-picker` call (line 6485) gains `:on-hover!` /
`:on-hover-end!` that call `merge-into-icon-preview!` /
`dissoc-icon-preview-field!` with `preview-base-target` — same
pattern as the icon-picker.
Result: hovering a swatch tints all three gallery preview tiles AND
the page-icon next to the page title; mouse-leave reverts both
together; only the entity actually being themed is affected (scope
filter does its job).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>