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

Aperta Adatta ai principianti
#1,506 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
clojure
Ambito
search

Direzione di ricerca

Inizia in src/main/frontend/components/cmdk/core.cljs da load-results :current-page, poi controlla come src/main/frontend/components/cmdk/state.cljs associa page-uuid e come src/main/frontend/worker/search.cljs legge la restrizione della pagina. Riproduci il problema con una parola presente in un’altra pagina ma non in quella corrente. Il lavoro è concluso quando «Search only: current page» non restituisce blocchi di altre pagine.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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!)
Lingua principale
Nessun dato sulla lingua
Stelle
29
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di logseq/db-test

Tutte le issue di logseq/db-test

Issue simili

Altre issue su Search

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.