trilium/packages
Elian Doran 7edff12d9b
fix(search): confine quick search to the hoisted subtree (closes #10803)
Quick search widened its scope to the whole tree whenever the hoisted note
lived inside _hidden, so browsing the in-app help returned the user's own
notes instead of help pages. It also passed includeHiddenNotes, which made an
unhoisted quick search return notes that have no visible path at all.

Neither setting was chosen for quick search. Both arrived together in
8e227a6146, a commit about highlighting exact matches, which copied the
search context of searchNotesForAutocomplete verbatim into the quickSearch
route.

The widening belongs to autocomplete alone. It was added in 6a9ac6f90a for
the launcher work: while hoisted into the hidden configuration area, the
note-link autocomplete still has to reach normal notes so a launcher can
point at one. It first sat in the SearchContext constructor, where it applied
to every search that passed no explicit ancestor, and 88bc7402a2 deliberately
narrowed it to the one function that needs it, introducing includeHiddenNotes
and the IsHiddenExp filter at the same time. That commit's subject states the
intent this one restores: hidden notes should not appear in the global search
unless hoisted into it.

Quick search now scopes to the hoisted note with no special case, so a hoist
into the hidden subtree confines it there like any other hoist. The two
settings have to move together: getAncestorExp only applies the hidden filter
when the ancestor is root, so dropping includeHiddenNotes while keeping the
widening would leave a hoist into help searching everything except help.

Hoisting to _hidden itself now yields nothing, because getSubtree defaults to
includeHidden: false and stops at that node. Hidden descendants, help and the
launcher bar included, traverse normally. Letting AncestorExp traverse hidden
notes would fix that, but the expression also backs saved searches and ETAPI
queries, so it is left for a separate change.

CoreApiTester never seeded the execution context from request headers, so no
spec could describe a hoisted request; the route read "root" whatever the
spec did. It now seeds hoistedNoteId, componentId and localNowDateTime from
the trilium-* headers, matching route_api.ts on Express and browser_routes.ts
in standalone. The new specs create their hidden note under _lbBookmarks
because the API refuses children directly under _hidden and _help*.

The comment in SearchContext explaining the widening has documented a
condition that no longer exists since 88bc7402a2 and is removed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 23:12:56 +02:00
..
ckeditor5 fix(text editor): handle Enter on collapsed list items (closes #11256) (#11335) 2026-09-11 22:27:02 +02:00
codemirror Merge remote-tracking branch 'origin/main' into claude/trilium-note-list-perf-mwiar2 2026-09-10 19:11:11 +02:00
commons TOTP: accept each code only once, and one time step of clock drift (#11448) 2026-09-11 21:57:57 +02:00
highlightjs fix(deps): update dependency highlight.js to v11.12.0 2026-08-15 04:25:17 +00:00
pdfjs-viewer build(pdfjs): update to pdf.js 6.3.289 2026-09-01 05:19:56 +00:00
share-theme Update dependency katex to v0.18.7 2026-09-10 00:53:20 +00:00
splitjs Update vitest monorepo to v5 2026-09-07 20:53:14 +00:00
trilium-backup-container docs: a container inspector needs 40 bytes, not 32 2026-08-19 20:20:37 +03:00
trilium-core fix(search): confine quick search to the hoisted subtree (closes #10803) 2026-09-11 23:12:56 +02:00
trilium-e2e fix(autocomplete): keep the child-note row above the results 2026-09-06 21:07:30 +02:00
turndown-plugin-gfm Update vitest monorepo to v5 2026-09-07 20:53:14 +00:00
.gitkeep