From d869056910f7d7794544a83de48686cb96f618cb Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Fri, 4 Jul 2025 13:47:50 +0300 Subject: [PATCH] client/note types mapping: add a way to highlight newly introduced types --- apps/client/src/services/note_types.ts | 6 ++++++ apps/client/src/translations/en/translation.json | 3 ++- apps/client/src/widgets/note_type.ts | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/client/src/services/note_types.ts b/apps/client/src/services/note_types.ts index dd4137ee9a..5d52b7528b 100644 --- a/apps/client/src/services/note_types.ts +++ b/apps/client/src/services/note_types.ts @@ -10,6 +10,8 @@ export interface NoteTypeMapping { mime?: string; title: string; icon?: string; + /** Indicates whether this type should be marked as a newly introduced feature. */ + isNew?: boolean; /** Indicates that this note type is part of a beta feature. */ isBeta?: boolean; /** Indicates that this note type cannot be created by the user. */ @@ -77,6 +79,10 @@ function getBlankNoteTypes(command): MenuItem[] { badges: [] } + if (nt.isNew) { + menuItem.badges?.push({title: t("note_types.new-feature"), className: "new-note-type-badge"}); + } + if (nt.isBeta) { menuItem.badges?.push({title: t("note_types.beta-feature")}); } diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index e3ae657b72..7663f1fc53 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -1626,7 +1626,8 @@ "geo-map": "Geo Map", "beta-feature": "Beta", "ai-chat": "AI Chat", - "task-list": "Task List" + "task-list": "Task List", + "new-feature": "New" }, "protect_note": { "toggle-on": "Protect the note", diff --git a/apps/client/src/widgets/note_type.ts b/apps/client/src/widgets/note_type.ts index 04602813d3..d1a40b4085 100644 --- a/apps/client/src/widgets/note_type.ts +++ b/apps/client/src/widgets/note_type.ts @@ -69,6 +69,11 @@ export default class NoteTypeWidget extends NoteContextAwareWidget { let $typeLink: JQuery; const $title = $("").text(noteType.title); + + if (noteType.isNew) { + $title.append($(``).text(t("note_types.new-feature"))); + } + if (noteType.isBeta) { $title.append($(``).text(t("note_types.beta-feature"))); }