Cmd+Shift+K "Search only: current page" returns blocks from the whole graph
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
Start in src/main/frontend/components/cmdk/core.cljs at load-results :current-page, then check how src/main/frontend/components/cmdk/state.cljs maps page-uuid and how src/main/frontend/worker/search.cljs reads the page restriction. Reproduce with a word found on another page but not the current one. Done means “Search only: current page” returns no blocks from other pages.
Written by the indexing model from the issue text.
Description
Search first
- I searched and no similar issues were found
What Happened?
With the "Search only: current page" filter (Cmd+Shift+K), results include blocks from other pages. The filter label is shown, but the search is not restricted to the current page.
Reproduce the Bug
- Open any page, e.g. page A.
- Press Cmd+Shift+K. The dialog shows "Search only: current page".
- Type a word that appears on other pages but not on page A.
- Blocks from other pages are listed as current-page results.
Expected Behavior
Only blocks of the current page are listed (no result in step 3).
Screenshots
No response
Files
No response
Browser, Desktop or Mobile Platform Information
macOS, Logseq desktop 2.0.2, DB graph
Additional Context
Likely cause (same code in 2.0.2 and master):
In load-results :current-page (src/main/frontend/components/cmdk/core.cljs), the page uuid is added to the options as :page-uuid:
opts (assoc opts :page-uuid current-page-uuid)
but search-blocks in src/main/frontend/worker/search.cljs only reads :page. The restriction is dropped and the whole graph is searched, then every result is rendered with :current-page? true.
cmdk-block-search-options (src/main/frontend/components/cmdk/state.cljs) already maps page-uuid to :page, but it is called before the uuid is resolved, so without it. Possible fix: (assoc opts :page (str current-page-uuid)), or resolve the uuid first and pass it to cmdk-block-search-options.
Are you willing to submit a PR? If you know how to fix the bug.
- I'm willing to submit a PR (Thank you!)
- Dominant language
- No language data
- Stars
- 29
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from logseq/db-test
-
Web build on a phone: the fold arrow of an h1/h2 block lies on its bullet, so tapping the bullet folds instead of zooming inPossibly taken @tiensonqin claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Page titles with `$$`, `$&`, `` $` `` or `$'` change when block refs are resolvedPossibly taken @RaphaelFakhri claimed this 19 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
`#Asset` label is not displayed on asset nodes when `Hide from Node` is disabledPossibly taken @tiensonqin claimed this 22 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Similar issues
-
bot-found bug priority: P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
madenvel/KalinkaPlayer#536 ·
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
auto_convert_research: call trigger_auto_index so Research History reports get indexed in the backgroundPossibly taken A pull request linked to this issue is open or already merged. Openpriority: low rag
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
LearningCircuit/local-deep-research#8470 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
[Bug]: The search form accepts invaild inputs such as 1,000ms or a1msPossibly taken @ashwinkothavade claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
jaegertracing/jaeger-ui#4740 ·
Maintainers usually reply within 1 day