Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(search): shrink the ancestor depth selector
Elian Doran159d34acf03d
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex ca485645fb..c2e448319d 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -1500,7 +1500,7 @@"depth_label": "depth","depth_doesnt_matter": "any","depth_eq": "= {{count}}",- "direct_children": "Direct children",+ "direct_children": "children only","depth_gt": "> {{count}}","depth_lt": "< {{count}}"},diff --git a/apps/client/src/widgets/search/SearchDefinitionOptions.tsx b/apps/client/src/widgets/search/SearchDefinitionOptions.tsxindex 3f9668f3fd..09ba0da9aa 100644--- a/apps/client/src/widgets/search/SearchDefinitionOptions.tsx+++ b/apps/client/src/widgets/search/SearchDefinitionOptions.tsx@@ -271,7 +271,7 @@ function AncestorOption({ note, ...restProps}: SearchOptionProps) {const options = useMemo(() => {const options: { value: string | undefined; label: string }[] = [{ value: "", label: t("ancestor.depth_doesnt_matter") },- { value: "eq1", label: `${t("ancestor.depth_eq", { count: 1 })} (${t("ancestor.direct_children")})` }+ { value: "eq1", label: t("ancestor.direct_children") }];for (let i=2; i<=9; i++) options.push({ value: `eq${ i}`, label: t("ancestor.depth_eq", { count: i }) });@@ -295,6 +295,7 @@ function AncestorOption({ note, ...restProps}: SearchOptionProps) {<span className="search-option-row-label">{t("ancestor.depth_label")}</span><FormSelect+ className="w-auto"values={options}keyProperty="value" titleProperty="label"currentValue={depth ?? ""} onChange={(value) => setDepth(value ? value : null)}