Cmd+Shift+K "Search only: current page" returns blocks from the whole graph

オープン 初心者向け
#1,506 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
85/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
clojure
領域
search

調査の方向性

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
  1. Open any page, e.g. page A.
  2. Press Cmd+Shift+K. The dialog shows "Search only: current page".
  3. Type a word that appears on other pages but not on page A.
  4. 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

logseq/db-test のほかの issue

logseq/db-test の issue をすべて見る

似ている issue

Search の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。