From 15e569dcea32449a79c1d15cdd27724d8f5ba8e2 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 15 Feb 2026 11:32:27 +0200 Subject: [PATCH] chore(client): address requested changes --- apps/client/src/entities/fnote.ts | 5 +++++ .../src/widgets/layout/ActiveContentBadges.tsx | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/client/src/entities/fnote.ts b/apps/client/src/entities/fnote.ts index fbe9493128..2b515f2412 100644 --- a/apps/client/src/entities/fnote.ts +++ b/apps/client/src/entities/fnote.ts @@ -700,6 +700,11 @@ export default class FNote { return this.hasAttribute(LABEL, name); } + /** + * Returns `true` if the note has a label with the given name (same as {@link hasOwnedLabel}), or it has a label with the `disabled:` prefix (for example due to a safe import). + * @param name the name of the label to look for. + * @returns `true` if the label exists, or its version with the `disabled:` prefix. + */ hasLabelOrDisabled(name: string) { return this.hasLabel(name) || this.hasLabel(`disabled:${name}`); } diff --git a/apps/client/src/widgets/layout/ActiveContentBadges.tsx b/apps/client/src/widgets/layout/ActiveContentBadges.tsx index ff94f19f04..80b37ec291 100644 --- a/apps/client/src/widgets/layout/ActiveContentBadges.tsx +++ b/apps/client/src/widgets/layout/ActiveContentBadges.tsx @@ -76,7 +76,7 @@ function ActiveContentBadge({ info, note }: { note: FNote, info: ActiveContentIn const { icon, helpPage, apiDocsPage, isExecutable } = typeMappings[info.type]; return ( @@ -200,7 +200,7 @@ function getTranslationForType(type: ActiveContentInfo["type"]) { case "renderNote": return t("active_content_badges.type_render_note"); case "webView": - return t("note_types.web-view"); + return t("active_content_badges.type_web_view"); } } @@ -210,8 +210,8 @@ function ActiveContentToggle({ note, info }: { note: FNote, info: ActiveContentI return info && { const attrs = note.getOwnedAttributes() .filter(attr => { @@ -227,7 +227,7 @@ function ActiveContentToggle({ note, info }: { note: FNote, info: ActiveContentI // We are adding and removing afterwards to avoid a flicker (because for a moment there would be no active content attribute anymore) because the operations are done in sequence and not atomically. if (attr.type === "label") { - await attributes.addLabel(note.noteId, newName, attr.value); + await attributes.setLabel(note.noteId, newName, attr.value); } else { await attributes.setRelation(note.noteId, newName, attr.value); } @@ -246,7 +246,7 @@ function useActiveContentInfo(note: FNote | null | undefined) { function refresh() { let type: ActiveContentInfo["type"] | null = null; - let isEnabled = true; + let isEnabled = false; let canToggleEnabled = false; if (!note) {