diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 317c64bd1c..2f78d6a341 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -2295,6 +2295,7 @@ "type_frontend_script": "Frontend script", "type_widget": "Widget", "type_app_css": "Custom CSS", + "type_render_note": "Render note", "toggle_tooltip_enable_tooltip": "Click to enable this {{type}}.", "toggle_tooltip_disable_tooltip": "Click to disable this {{type}}.", "menu_docs": "Open documentation", diff --git a/apps/client/src/widgets/layout/ActiveContentBadges.tsx b/apps/client/src/widgets/layout/ActiveContentBadges.tsx index 35160eee8d..d39ab75f36 100644 --- a/apps/client/src/widgets/layout/ActiveContentBadges.tsx +++ b/apps/client/src/widgets/layout/ActiveContentBadges.tsx @@ -13,6 +13,12 @@ import { useNoteContext, useNoteLabel, useNoteLabelBoolean, useTriliumEvent } fr const DANGEROUS_ATTRIBUTES = BUILTIN_ATTRIBUTES.filter(a => a.isDangerous || a.name === "appCss"); const activeContentLabels = [ "iconPack", "widget", "appCss" ] as const; +interface ActiveContentInfo { + type: "iconPack" | "backendScript" | "frontendScript" | "widget" | "appCss" | "renderNote"; + isEnabled: boolean; + canToggleEnabled: boolean; +} + const typeMappings: Record(null); @@ -237,7 +247,11 @@ function useActiveContentInfo(note: FNote | null | undefined) { return; } - if (note.type === "code" && note.mime === "application/javascript;env=backend") { + if (note.type === "render") { + type = "renderNote"; + isEnabled = note.hasRelation("renderNote"); + canToggleEnabled = note.hasRelation("renderNote") || note.hasRelation("disabled:renderNote"); + } else if (note.type === "code" && note.mime === "application/javascript;env=backend") { type = "backendScript"; for (const backendLabel of [ "run", "customRequestHandler", "customResourceProvider" ]) { isEnabled ||= note.hasLabel(backendLabel);