note context menu: search selected text in Trilium

This commit is contained in:
contributor 2025-11-25 12:14:50 +02:00
parent 3afe6df9f2
commit b982ca2c5b
2 changed files with 12 additions and 0 deletions

View File

@ -119,6 +119,17 @@ function setupContextMenu() {
uiIcon: "bx bx-search-alt",
handler: () => electron.shell.openExternal(searchUrl)
});
items.push({
title: t("electron_context_menu.search_in_trilium", { term: shortenedSelection }),
uiIcon: "bx bx-search",
handler: async () => {
const appContext = (await import("../components/app_context.js")).default;
await appContext.triggerCommand("searchNotes", {
searchString: params.selectionText
});
}
});
}
if (items.length === 0) {

View File

@ -1868,6 +1868,7 @@
"copy-link": "Copy link",
"paste": "Paste",
"paste-as-plain-text": "Paste as plain text",
"search_in_trilium": "Search in Trilium for \"{{term}}\"",
"search_online": "Search for \"{{term}}\" with {{searchEngine}}"
},
"image_context_menu": {