Skip to content

Build your personal knowledge base with Trilium Notes

chore(search): integration cleanup

perfectra1naae9ee3a17ff
diff --git a/apps/client/src/widgets/collections/search/SearchResultsList.spec.tsx b/apps/client/src/widgets/collections/search/SearchResultsList.spec.tsx
index 3c3efd232f..45203f2f25 100644
--- a/apps/client/src/widgets/collections/search/SearchResultsList.spec.tsx
+++ b/apps/client/src/widgets/collections/search/SearchResultsList.spec.tsx
@@ -71,7 +71,7 @@ describe("SearchResultCard", () => {
const link = container.querySelector("a.search-result-card");
// The card's href carries the highlighted plain tokens as `searchTerms` so the destination
- // type widget can highlight/jump to them once ViewScope.searchTerms is real (task 8).
+ // type widget can highlight/jump to them via ViewScope.searchTerms.
expect(link?.getAttribute("href")).toBe(`#${note.noteId}?searchTerms=sync`);
expect(container.querySelector(".search-result-card-title")?.textContent).toBe("Meeting notes");
// Breadcrumb is the note-path title minus the note's own (last) segment.
diff --git a/apps/client/src/widgets/collections/search/useSearchResultDetails.spec.tsx b/apps/client/src/widgets/collections/search/useSearchResultDetails.spec.tsx
index 06fa837399..8b2ee61f72 100644
--- a/apps/client/src/widgets/collections/search/useSearchResultDetails.spec.tsx
+++ b/apps/client/src/widgets/collections/search/useSearchResultDetails.spec.tsx
@@ -4,8 +4,7 @@
* the stale-response guard (an older in-flight response must not clobber a newer one), and the
* re-execution refetch triggered by `searchRefreshed` for the matching ntxId.
*/
-import { deferred } from "@triliumnext/commons";
-import type { SearchResultDetailsResponse } from "@triliumnext/commons";
+import { deferred, type SearchResultDetailsResponse } from "@triliumnext/commons";
import { render } from "preact";
import { act } from "preact/test-utils";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
diff --git a/apps/client/src/widgets/find_in_text.ts b/apps/client/src/widgets/find_in_text.ts
index 39c8b1ad00..58a903dda2 100644
--- a/apps/client/src/widgets/find_in_text.ts
+++ b/apps/client/src/widgets/find_in_text.ts
@@ -1,7 +1,8 @@
import type { CKTextEditor, FindAndReplaceState, FindCommandResult } from "@triliumnext/ckeditor5";
+
import { expandCollapsedAncestors } from "../services/collapsibles.js";
-import type { FindResult } from "./find.js";
import type FindWidget from "./find.js";
+import type { FindResult } from "./find.js";
export default class FindInText {
diff --git a/apps/client/src/widgets/quick_search.ts b/apps/client/src/widgets/quick_search.ts
index 2793ade28a..d2addf98f8 100644
--- a/apps/client/src/widgets/quick_search.ts
+++ b/apps/client/src/widgets/quick_search.ts
@@ -166,7 +166,7 @@ export default class QuickSearchWidget extends BasicWidget {
private isLoadingMore: boolean = false;
// Plain tokens the server highlighted for the last completed search. Consumed by
- // jump-to-match producers (Task 9) to know what to highlight in the opened note.
+ // jump-to-match producers to know what to highlight in the opened note.
private lastHighlightedTokens: string[] = [];
doRender() {
diff --git a/packages/trilium-core/src/services/search/services/build_comparator.ts b/packages/trilium-core/src/services/search/services/build_comparator.ts
index a3f572ac3f..e1838d0b79 100644
--- a/packages/trilium-core/src/services/search/services/build_comparator.ts
+++ b/packages/trilium-core/src/services/search/services/build_comparator.ts
@@ -20,7 +20,7 @@ const stringComparators: Record<string, Comparator<string>> = {
"=": (comparedValue) => (val) => normalizeSearchText(val) === normalizeSearchText(comparedValue),
"!=": (comparedValue) => (val) => normalizeSearchText(val) !== normalizeSearchText(comparedValue),
// Internal operator (not user-typable): word/phrase match used by the leading-"="
- // fulltext title comparison. Punctuation-aware via Task 1's helpers.
+ // fulltext title comparison. Punctuation-aware via tokenizeIntoWords/stripWordPunctuation.
"word=": (comparedValue) => (val) => {
if (!val) return false;