Skip to content

Fix property value blocks in visible results#12767

Open
megayu wants to merge 3 commits into
masterfrom
fix/property-value-ref-visibility
Open

Fix property value blocks in visible results#12767
megayu wants to merge 3 commits into
masterfrom
fix/property-value-ref-visibility

Conversation

@megayu
Copy link
Copy Markdown
Collaborator

@megayu megayu commented Jun 4, 2026

  • Normalize generated property value blocks to their owner in user-visible flows.
  • Deduplicate linked references by visible block.
  • Hide internal property value blocks from Search/CmdK results.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts how “generated property value blocks” (internal storage blocks created for property values) are handled across user-visible surfaces, so they don’t appear as standalone nodes and are instead attributed to their owning (visible) block where appropriate.

Changes:

  • Hide generated property value blocks from search indexing and Search/CmdK results.
  • Deduplicate linked references by the visible (owning) outline block, including updating the linked-refs count API.
  • Add/extend tests to cover hiding, indexing exclusion, and linked-reference normalization/deduping.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/test/frontend/worker/search_test.cljs Adds tests ensuring property value blocks are hidden and excluded from indexing/search results.
src/test/frontend/worker/db_core_test.cljs Adds tests for deduped refs-count behavior and “count ignores filters” semantics.
src/test/frontend/db/reference_test.cljs Adds tests asserting linked refs are shown on the owning block and deduped.
src/main/frontend/worker/search.cljs Hides property value blocks from indexing/results and pulls :logseq.property/created-from-property for filtering.
src/main/frontend/worker/db_core.cljs Switches refs-count thread API to use the new linked-references count implementation.
src/main/frontend/components/cmdk/core.cljs Normalizes “open block” behavior to the nearest visible outline block (handling property value blocks).
deps/db/src/logseq/db/common/reference.cljs Normalizes linked refs to visible outline blocks; adds get-linked-references-count and includes property value ids in matched-children context.
deps/db/src/logseq/db.cljs Introduces property-value-block? and visible-outline-block helpers used by search/references/CmdK.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 966 to +971
(or (ldb/page-in-library? @conn block)
(not (ldb/internal-page? block))))
;; remove non-page blocks when asking for pages only
(and page-only? (not (ldb/page? block)))))
(and page-only? (not (ldb/page? block)))
;; generated property value blocks are storage nodes, not standalone search results
(ldb/property-value-block? block)))
@megayu megayu requested a review from tiensonqin June 4, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants