Skip to content

Build your personal knowledge base with Trilium Notes

feat(attributes): recognise the remaining system attributes across the app

Elian Doranfcb97d571d0d
diff --git a/apps/client/src/services/attributes.spec.ts b/apps/client/src/services/attributes.spec.ts
index cf3129a729..6bb6ba84dd 100644
--- a/apps/client/src/services/attributes.spec.ts
+++ b/apps/client/src/services/attributes.spec.ts
@@ -401,6 +401,19 @@ describe("isBuiltinAttribute", () => {
expect(isBuiltinAttribute("label", "isCompleted")).toBe(true);
});
+ it("recognizes the names of the smaller subsystems", () => {
+ expect(isBuiltinAttribute("label", "fastSearch")).toBe(true);
+ expect(isBuiltinAttribute("label", "launcherType")).toBe(true);
+ expect(isBuiltinAttribute("relation", "hoistedNote")).toBe(true);
+ expect(isBuiltinAttribute("label", "shareOpenGraphURL")).toBe(true);
+ expect(isBuiltinAttribute("label", "oneNotePageId")).toBe(true);
+ expect(isBuiltinAttribute("label", "versioningLimit")).toBe(true);
+ expect(isBuiltinAttribute("relation", "includeNoteLink")).toBe(true);
+ // `shareOpenGraphImage` is read as either a label or a relation, so both must be recognized.
+ expect(isBuiltinAttribute("label", "shareOpenGraphImage")).toBe(true);
+ expect(isBuiltinAttribute("relation", "shareOpenGraphImage")).toBe(true);
+ });
+
it("recognizes the map names", () => {
expect(isBuiltinAttribute("label", "geolocation")).toBe(true);
expect(isBuiltinAttribute("label", "map:style")).toBe(true);
diff --git a/packages/commons/src/lib/builtin_attributes.ts b/packages/commons/src/lib/builtin_attributes.ts
index dc1a1a50ff..9cd5314145 100644
--- a/packages/commons/src/lib/builtin_attributes.ts
+++ b/packages/commons/src/lib/builtin_attributes.ts
@@ -46,6 +46,7 @@ const BUILTIN_ATTRIBUTES = [
// Note tree & organisation
{ type: "label", name: "inbox", valueType: "boolean" },
{ type: "label", name: "disableVersioning", valueType: "boolean" },
+ { type: "label", name: "versioningLimit", valueType: "number" },
{ type: "label", name: "calendarRoot", valueType: "boolean" },
{ type: "label", name: "archived", valueType: "boolean" },
{ type: "label", name: "excludeFromExport", valueType: "boolean" },
@@ -75,6 +76,8 @@ const BUILTIN_ATTRIBUTES = [
{ type: "label", name: "workspaceInbox", valueType: "boolean" },
{ type: "label", name: "workspaceSearchHome", valueType: "boolean" },
{ type: "label", name: "sqlConsoleHome", valueType: "boolean" },
+ { type: "label", name: "llmChatHome", valueType: "boolean" },
+ { type: "label", name: "workspaceLlmChatHome", valueType: "boolean" },
{ type: "label", name: "datePattern", valueType: "string" },
{ type: "label", name: "weekPattern", valueType: "string" },
{ type: "label", name: "enableWeekNote", valueType: "boolean" },
@@ -109,7 +112,17 @@ const BUILTIN_ATTRIBUTES = [
// Sharing
{ type: "label", name: "shareHiddenFromTree", valueType: "boolean" },
- { type: "label", name: "shareExternalLink", valueType: "boolean" },
+ // Both hold the URL to link out to; `shareExternal` is the older spelling the theme still reads.
+ { type: "label", name: "shareExternalLink", valueType: "string", hasUserValue: true },
+ { type: "label", name: "shareExternal", valueType: "string", hasUserValue: true },
+ { type: "label", name: "shareRootLink", valueType: "string", hasUserValue: true },
+ { type: "label", name: "shareLogoWidth", valueType: "number" },
+ { type: "label", name: "shareLogoHeight", valueType: "number" },
+ { type: "label", name: "shareOpenGraphColor", valueType: "string" },
+ { type: "label", name: "shareOpenGraphURL", valueType: "string", hasUserValue: true },
+ { type: "label", name: "shareOpenGraphDomain", valueType: "string", hasUserValue: true },
+ // Also exists as a relation, pointing at an image note instead of naming a URL.
+ { type: "label", name: "shareOpenGraphImage", valueType: "string", hasUserValue: true },
{ type: "label", name: "shareAlias", valueType: "string", hasUserValue: true },
{ type: "label", name: "shareOmitDefaultCss", valueType: "boolean" },
{ type: "label", name: "shareRoot", valueType: "boolean" },
@@ -126,7 +139,9 @@ const BUILTIN_ATTRIBUTES = [
{ type: "label", name: "titleTemplate", valueType: "string", isDangerous: true },
{ type: "label", name: "template", valueType: "boolean" },
{ type: "label", name: "snippet", valueType: "boolean" },
+ { type: "label", name: "snippetDescription", valueType: "string", hasUserValue: true },
{ type: "label", name: "textSnippet", valueType: "boolean" },
+ { type: "label", name: "textSnippetDescription", valueType: "string", hasUserValue: true },
{ type: "label", name: "toc", valueType: "string" },
{ type: "label", name: "color", valueType: "string" },
{ type: "label", name: "keepCurrentHoisting", valueType: "boolean" },
@@ -135,6 +150,11 @@ const BUILTIN_ATTRIBUTES = [
{ type: "label", name: "executeTitle", valueType: "string", hasUserValue: true },
{ type: "label", name: "newNotesOnTop", valueType: "boolean" },
{ type: "label", name: "clipperInbox", valueType: "boolean" },
+ { type: "label", name: "clipType", valueType: "string" },
+ { type: "label", name: "sentFromSender", valueType: "boolean" },
+ { type: "label", name: "hideChildrenOverview", valueType: "boolean" },
+ { type: "label", name: "mediaNotesPlayMode", valueType: "string" },
+ { type: "label", name: "collection", valueType: "boolean" },
{ type: "label", name: "webViewSrc", valueType: "string", isDangerous: true },
{ type: "label", name: "hideHighlightWidget", valueType: "boolean" },
{ type: "label", name: "iconPack", valueType: "string", isDangerous: true },
@@ -152,6 +172,25 @@ const BUILTIN_ATTRIBUTES = [
{ type: "label", name: "orderBy", valueType: "string", hasUserValue: true },
{ type: "label", name: "orderDirection", valueType: "string", hasUserValue: true },
{ type: "label", name: "limit", valueType: "string", hasUserValue: true },
+ { type: "label", name: "fastSearch", valueType: "boolean" },
+ { type: "label", name: "includeArchivedNotes", valueType: "boolean" },
+ { type: "label", name: "debug", valueType: "boolean" },
+
+ // Launch bar, and the hidden subtree items that back it
+ { type: "label", name: "launcherType", valueType: "string" },
+ { type: "label", name: "builtinWidget", valueType: "string" },
+ { type: "label", name: "scriptInLauncherContent", valueType: "boolean" },
+ { type: "label", name: "baseSize", valueType: "number" },
+ { type: "label", name: "growthFactor", valueType: "number" },
+ { type: "label", name: "desktopOnly", valueType: "boolean" },
+ { type: "label", name: "electronOnly", valueType: "boolean" },
+ { type: "label", name: "serverOnly", valueType: "boolean" },
+ { type: "label", name: "beta", valueType: "boolean" },
+
+ // Recorded on import, to trace a note back to where it came from
+ { type: "label", name: "oneNotePageId", valueType: "string", hasUserValue: true },
+ { type: "label", name: "oneNoteSectionId", valueType: "string", hasUserValue: true },
+ { type: "label", name: "oneNoteImportFailed", valueType: "boolean" },
// Collections
{ type: "label", name: "status", valueType: "string", hasUserValue: true },
@@ -206,6 +245,7 @@ const BUILTIN_ATTRIBUTES = [
{ type: "relation", name: "internalLink" },
{ type: "relation", name: "imageLink" },
{ type: "relation", name: "relationMapLink" },
+ { type: "relation", name: "includeNoteLink" },
{ type: "relation", name: "runOnNoteCreation", isDangerous: true },
{ type: "relation", name: "runOnNoteTitleChange", isDangerous: true },
{ type: "relation", name: "runOnNoteChange", isDangerous: true },
@@ -230,7 +270,11 @@ const BUILTIN_ATTRIBUTES = [
{ type: "relation", name: "searchScript" },
{ type: "relation", name: "ancestor" },
{ type: "relation", name: "target" },
+ { type: "relation", name: "script" },
+ { type: "relation", name: "hoistedNote" },
{ type: "relation", name: "shareCss" },
+ { type: "relation", name: "shareLogo" },
+ { type: "relation", name: "shareOpenGraphImage" },
{ type: "relation", name: "shareJs", isDangerous: true },
{ type: "relation", name: "shareHtml", isDangerous: true },
{ type: "relation", name: "shareTemplate", isDangerous: true },