client/note types mapping: add a way to highlight newly introduced types

This commit is contained in:
Adorian Doran
2025-07-04 13:47:50 +03:00
parent 821e4b17cb
commit d869056910
3 changed files with 13 additions and 1 deletions

View File

@@ -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<TreeCommandNames>[] {
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")});
}

View File

@@ -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",

View File

@@ -69,6 +69,11 @@ export default class NoteTypeWidget extends NoteContextAwareWidget {
let $typeLink: JQuery<HTMLElement>;
const $title = $("<span>").text(noteType.title);
if (noteType.isNew) {
$title.append($(`<span class="badge new-note-type-badge">`).text(t("note_types.new-feature")));
}
if (noteType.isBeta) {
$title.append($(`<span class="badge">`).text(t("note_types.beta-feature")));
}