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(client): make view source searchable
Elian Doran889e44363ac5
diff --git a/apps/client/src/widgets/ribbon/NoteActions.tsx b/apps/client/src/widgets/ribbon/NoteActions.tsxindex 679b624c10..6490542d78 100644--- a/apps/client/src/widgets/ribbon/NoteActions.tsx+++ b/apps/client/src/widgets/ribbon/NoteActions.tsx@@ -75,7 +75,8 @@ export function NoteContextMenu({ note, noteContext, itemsAtStart, itemsNearNoteconst noteType = useNoteProperty(note, "type") ?? "";const [viewType] = useNoteLabel(note, "viewType");const canBeConvertedToAttachment = note?.isEligibleForConversionToAttachment();- const isSearchable = ["text", "code", "book", "mindMap", "doc", "spreadsheet"].includes(noteType);+ const isSourceView = noteContext?.viewScope?.viewMode === "source";+ const isSearchable = isSourceView || ["text", "code", "book", "mindMap", "doc", "spreadsheet"].includes(noteType);const isInOptionsOrHelp = note?.noteId.startsWith("_options") || note?.noteId.startsWith("_help");const isExportableToImage = ["mermaid", "mindMap"].includes(noteType);const isContentAvailable = note.isContentAvailable();