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(in-app-help): add dedicated icon for folders
Elian Doran6215a21bae0c
diff --git a/src/services/in_app_help.ts b/src/services/in_app_help.tsindex 6e8aefb61f..c1ce8c4bc1 100644--- a/src/services/in_app_help.ts+++ b/src/services/in_app_help.ts@@ -39,14 +39,20 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIttype: "doc",attributes: []};+ let iconClass: string | undefined = undefined;// Handle attributesfor (const attribute of noteMeta.attributes ?? []) {if (attribute.name === "iconClass") {- item.attributes?.push(attribute);+ iconClass = attribute.value;}}+ // Handle folder notes+ if (!noteMeta.dataFileName) {+ iconClass = "bx bx-folder";+ }+// Handle text notesif (noteMeta.type === "text" && noteMeta.dataFileName) {const docPath = `${docNameRoot}/${path.basename(noteMeta.dataFileName, ".html")}`@@ -58,6 +64,7 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIt});}+ // Handle childrenif (noteMeta.children) {const children: HiddenSubtreeItem[] = [];for (const childMeta of noteMeta.children) {@@ -68,5 +75,14 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeItitem.children = children;}+ // Handle note icon+ if (iconClass) {+ item.attributes?.push({+ name: "iconClass",+ value: iconClass,+ type: "label"+ });+ }+return item;}