client/tree context menu/insert note: mark the beta note types with a badge

This commit is contained in:
Adorian Doran 2025-07-04 11:46:10 +03:00
parent 2c9a7144da
commit f90e2fb484
2 changed files with 4 additions and 3 deletions

View File

@ -17,7 +17,7 @@ interface MenuSeparatorItem {
title: "----"; title: "----";
} }
interface MenuItemBadge { export interface MenuItemBadge {
title: string; title: string;
className?: string; className?: string;
} }

View File

@ -1,10 +1,11 @@
import server from "./server.js"; import server from "./server.js";
import froca from "./froca.js"; import froca from "./froca.js";
import { t } from "./i18n.js"; import { t } from "./i18n.js";
import type { MenuItem } from "../menus/context_menu.js"; import type { MenuItem, MenuItemBadge } from "../menus/context_menu.js";
import type { TreeCommandNames } from "../menus/tree_context_menu.js"; import type { TreeCommandNames } from "../menus/tree_context_menu.js";
const SEPARATOR = { title: "----" }; const SEPARATOR = { title: "----" };
const BETA_BADGE: MenuItemBadge = {title: t("note_types.beta-feature")};
async function getNoteTypeItems(command?: TreeCommandNames) { async function getNoteTypeItems(command?: TreeCommandNames) {
const items: MenuItem<TreeCommandNames>[] = [ const items: MenuItem<TreeCommandNames>[] = [
@ -24,7 +25,7 @@ async function getNoteTypeItems(command?: TreeCommandNames) {
// Map notes // Map notes
{ title: t("note_types.geo-map"), command, type: "geoMap", uiIcon: "bx bx-map-alt" }, { title: t("note_types.geo-map"), command, type: "geoMap", uiIcon: "bx bx-map-alt" },
{ title: t("note_types.mind-map"), command, type: "mindMap", uiIcon: "bx bx-sitemap" }, { title: t("note_types.mind-map"), command, type: "mindMap", uiIcon: "bx bx-sitemap", badges: [BETA_BADGE]},
{ title: t("note_types.note-map"), command, type: "noteMap", uiIcon: "bx bxs-network-chart" }, { title: t("note_types.note-map"), command, type: "noteMap", uiIcon: "bx bxs-network-chart" },
{ title: t("note_types.relation-map"), command, type: "relationMap", uiIcon: "bx bxs-network-chart" }, { title: t("note_types.relation-map"), command, type: "relationMap", uiIcon: "bx bxs-network-chart" },