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): add Brave and Yandex search engine presets
Elian Doran802c9e5ab3e4
diff --git a/apps/client/src/services/search_engine.ts b/apps/client/src/services/search_engine.tsindex 043ad1e953..8be69fb9d2 100644--- a/apps/client/src/services/search_engine.ts+++ b/apps/client/src/services/search_engine.ts@@ -9,17 +9,25 @@ export const SEARCH_ENGINE_PRESETS = [url: "https://duckduckgo.com/?q={keyword}",nameKey: "search_engine.duckduckgo", icon: "bx bx-search-alt"},+ {+ url: "https://www.baidu.com/s?wd={keyword}",+ nameKey: "search_engine.baidu", icon: "bx bxl-baidu"+ },{url: "https://www.bing.com/search?q={keyword}",nameKey: "search_engine.bing", icon: "bx bxl-bing"},{- url: "https://www.baidu.com/s?wd={keyword}",- nameKey: "search_engine.baidu", icon: "bx bxl-baidu"+ url: "https://search.brave.com/search?q={keyword}",+ nameKey: "search_engine.brave", icon: "tn-brand tn-brand-brave"},{url: "https://www.google.com/search?q={keyword}",nameKey: "search_engine.google", icon: "bx bxl-google"+ },+ {+ url: "https://yandex.com/search/?text={keyword}",+ nameKey: "search_engine.yandex", icon: "bx bx-search-alt"}] as const;diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex c2f506711f..d2ce3d2e96 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -2101,8 +2101,10 @@"engine_label": "Engine","bing": "Bing","baidu": "Baidu",+ "brave": "Brave","duckduckgo": "DuckDuckGo","google": "Google",+ "yandex": "Yandex","none": "None","custom": "Custom","custom_name_label": "Name",diff --git a/apps/client/src/widgets/type_widgets/options/other.spec.tsx b/apps/client/src/widgets/type_widgets/options/other.spec.tsxindex 87b409bb86..5ad1d12eae 100644--- a/apps/client/src/widgets/type_widgets/options/other.spec.tsx+++ b/apps/client/src/widgets/type_widgets/options/other.spec.tsx@@ -107,14 +107,17 @@ describe("the search engine settings", () => {expect(urlBox()).toBeNull();expect(openMenu().map((row) => [row.textContent?.trim(),- [ ...row.querySelector(".bx")?.classList ?? [] ].find((name) => /^bxl?-/.test(name))+ [ ...row.querySelector(".tn-icon")?.classList ?? [] ]+ .filter((name) => name !== "tn-icon").join(" ")])).toEqual([- [ "search_engine.none", "bx-block" ],- [ "search_engine.duckduckgo", "bx-search-alt" ],- [ "search_engine.bing", "bxl-bing" ],- [ "search_engine.baidu", "bxl-baidu" ],- [ "search_engine.google", "bxl-google" ],- [ "search_engine.custom", "bx-edit-alt" ]+ [ "search_engine.none", "bx bx-block" ],+ [ "search_engine.duckduckgo", "bx bx-search-alt" ],+ [ "search_engine.baidu", "bx bxl-baidu" ],+ [ "search_engine.bing", "bx bxl-bing" ],+ [ "search_engine.brave", "tn-brand tn-brand-brave" ],+ [ "search_engine.google", "bx bxl-google" ],+ [ "search_engine.yandex", "bx bx-search-alt" ],+ [ "search_engine.custom", "bx bx-edit-alt" ]]);expect(getSearchEngineChoice("none")).toBe("none");