Skip to content

Commit d5ee663

Browse files
authored
Tree context menu: reorder the note types of "Insert (child) note..." (#6206)
2 parents a7ab4be + 0365857 commit d5ee663

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

apps/client/src/services/note_types.ts

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,35 @@ const SEPARATOR = { title: "----" };
88

99
async function getNoteTypeItems(command?: TreeCommandNames) {
1010
const items: MenuItem<TreeCommandNames>[] = [
11+
// The suggested note type ordering method: insert the item into the corresponding group,
12+
// then ensure the items within the group are ordered alphabetically.
13+
// Please keep the order synced with the listing found also in aps/client/src/widgets/note_types.ts.
14+
15+
// The default note type (always the first item)
1116
{ title: t("note_types.text"), command, type: "text", uiIcon: "bx bx-note" },
12-
{ title: t("note_types.code"), command, type: "code", uiIcon: "bx bx-code" },
13-
{ title: t("note_types.saved-search"), command, type: "search", uiIcon: "bx bx-file-find" },
14-
{ title: t("note_types.relation-map"), command, type: "relationMap", uiIcon: "bx bxs-network-chart" },
15-
{ title: t("note_types.note-map"), command, type: "noteMap", uiIcon: "bx bxs-network-chart" },
16-
{ title: t("note_types.render-note"), command, type: "render", uiIcon: "bx bx-extension" },
17+
18+
// Text notes group
1719
{ title: t("note_types.book"), command, type: "book", uiIcon: "bx bx-book" },
18-
{ title: t("note_types.mermaid-diagram"), command, type: "mermaid", uiIcon: "bx bx-selection" },
20+
21+
// Graphic notes
1922
{ title: t("note_types.canvas"), command, type: "canvas", uiIcon: "bx bx-pen" },
20-
{ title: t("note_types.web-view"), command, type: "webView", uiIcon: "bx bx-globe-alt" },
21-
{ title: t("note_types.mind-map"), command, type: "mindMap", uiIcon: "bx bx-sitemap" },
23+
{ title: t("note_types.mermaid-diagram"), command, type: "mermaid", uiIcon: "bx bx-selection" },
24+
25+
// Map notes
2226
{ title: t("note_types.geo-map"), command, type: "geoMap", uiIcon: "bx bx-map-alt" },
27+
{ title: t("note_types.mind-map"), command, type: "mindMap", uiIcon: "bx bx-sitemap" },
28+
{ title: t("note_types.note-map"), command, type: "noteMap", uiIcon: "bx bxs-network-chart" },
29+
{ title: t("note_types.relation-map"), command, type: "relationMap", uiIcon: "bx bxs-network-chart" },
30+
31+
// Misc note types
32+
{ title: t("note_types.render-note"), command, type: "render", uiIcon: "bx bx-extension" },
33+
{ title: t("note_types.saved-search"), command, type: "search", uiIcon: "bx bx-file-find" },
34+
{ title: t("note_types.web-view"), command, type: "webView", uiIcon: "bx bx-globe-alt" },
35+
36+
// Code notes
37+
{ title: t("note_types.code"), command, type: "code", uiIcon: "bx bx-code" },
38+
39+
// Templates
2340
...await getBuiltInTemplates(command),
2441
...await getUserTemplates(command)
2542
];

apps/client/src/widgets/note_type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ interface NoteTypeMapping {
1919
const NOTE_TYPES: NoteTypeMapping[] = [
2020
// The suggested note type ordering method: insert the item into the corresponding group,
2121
// then ensure the items within the group are ordered alphabetically.
22+
// Please keep the order synced with the listing found also in apps/client/src/services/note_types.ts.
2223

2324
// The default note type (always the first item)
2425
{ type: "text", mime: "text/html", title: t("note_types.text"), selectable: true },

0 commit comments

Comments
 (0)