Cmd+Shift+K "Search only: current page" returns blocks from the whole graph
还没有人认领这个 Issue。
评估
调研方向
从 src/main/frontend/components/cmdk/core.cljs 中的 load-results :current-page 开始,然后检查 src/main/frontend/components/cmdk/state.cljs 如何映射 page-uuid,以及 src/main/frontend/worker/search.cljs 如何读取页面限制。使用一个在其他页面中出现、但当前页面中没有的词来复现。完成标准是“Search only: current page”不会返回其他页面的任何块。
由索引模型根据 Issue 内容生成。
描述
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!)
- 主要语言
- 没有语言数据
- 星标
- 29
- 派生
- 2
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
logseq/db-test 的其他 Issue
-
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 in可能已有人在做 @tiensonqin 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 87/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
Page titles with `$$`, `$&`, `` $` `` or `$'` change when block refs are resolved可能已有人在做 @RaphaelFakhri 于 17 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
-
`#Asset` label is not displayed on asset nodes when `Hide from Node` is disabled可能已有人在做 @tiensonqin 于 20 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 75/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 76/100
LogicLabs-OU/OpenArchiver#516 ·
维护者通常 2 天内回复
-
frontend size:S
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
nextapps-de/flexsearch#556 ·
-
green-harvest
难度 2/5 1-3 小时 新手友好度 72/100
paulnsorensen/hallouminate#712 ·
维护者通常 1 天内回复