Skip to content

Build your personal knowledge base with Trilium Notes

feat(tree): move Advanced to the bottom of the tree menu

Elian Doran61178d0a31e9
diff --git a/apps/client/src/menus/tree_context_menu.spec.ts b/apps/client/src/menus/tree_context_menu.spec.ts
index b010fa918e..ca1edf9d82 100644
--- a/apps/client/src/menus/tree_context_menu.spec.ts
+++ b/apps/client/src/menus/tree_context_menu.spec.ts
@@ -59,6 +59,14 @@ describe("buildTreeContextMenuItems", () => {
expect(quickEdit.command).toBe("openNoteInPopup");
});
+ it("ends with Advanced, right after Search in subtree", async () => {
+ const { build } = setUp();
+ const [ search, advanced ] = (await build()).slice(-2);
+
+ expect(search && "command" in search && search.command).toBe("searchInSubtree");
+ expect(advanced && "uiIcon" in advanced && advanced.uiIcon).toBe("bx bxs-wrench");
+ });
+
it("protects or unprotects the subtree after Archive, as the note stands, with both in its submenu", async () => {
const { child, build } = setUp();
diff --git a/apps/client/src/menus/tree_context_menu.ts b/apps/client/src/menus/tree_context_menu.ts
index 3d1b4bada7..a43b457925 100644
--- a/apps/client/src/menus/tree_context_menu.ts
+++ b/apps/client/src/menus/tree_context_menu.ts
@@ -236,66 +236,6 @@ export async function buildTreeContextMenuItems(ctx: TreeContextMenuContext): Pr
{ kind: "separator" },
- {
- title: t("tree-context-menu.advanced"),
- uiIcon: "bx bxs-wrench",
- enabled: true,
- items: [
- { title: t("tree-context-menu.apply-bulk-actions"), command: "openBulkActionsDialog", uiIcon: "bx bx-list-plus", enabled: true },
- {
- // One note at a time: the dialog is configured against what that note holds and
- // reports on what it changed there, neither of which a multi-selection has.
- title: t("compress-images"),
- uiIcon: "bx bx-collapse-alt",
- enabled: noSelectedNotes && notOptionsOrHelp,
- handler: () => void showImageCompressionDialog({ type: "note", noteId: note.noteId })
- },
-
- { kind: "separator" },
-
- {
- title: t("tree-context-menu.edit-branch-prefix"),
- command: "editBranchPrefix",
- keyboardShortcut: "editBranchPrefix",
- uiIcon: "bx bx-rename",
- enabled: isNotRoot && parentNotSearch && notOptionsOrHelp
- },
- {
- title: t("tree-context-menu.convert-to-attachment"),
- command: "convertNoteToAttachment",
- uiIcon: "bx bx-paperclip",
- enabled: isNotRoot && !isHoisted && notOptionsOrHelp && selectedNotes.some((n) => n.isEligibleForConversionToAttachment())
- },
-
- { kind: "separator" },
-
- !hasSubtreeHidden && !isMobileTarget && { title: t("tree-context-menu.expand-subtree"), command: "expandSubtree", keyboardShortcut: "expandSubtree", uiIcon: "bx bx-expand", enabled: noSelectedNotes },
- !hasSubtreeHidden && !isMobileTarget && { title: t("tree-context-menu.collapse-subtree"), command: "collapseSubtree", keyboardShortcut: "collapseSubtree", uiIcon: "bx bx-collapse", enabled: noSelectedNotes },
- {
- title: hasSubtreeHidden ? t("tree-context-menu.show-subtree") : t("tree-context-menu.hide-subtree"),
- uiIcon: "bx bx-show",
- enabled: isNotRoot,
- handler: async () => {
- attributes.setBooleanWithInheritance(note, "subtreeHidden", !hasSubtreeHidden);
- }
- },
- {
- title: t("tree-context-menu.sort-by"),
- command: "sortChildNotes",
- keyboardShortcut: "sortChildNotes",
- uiIcon: "bx bx-sort-down",
- enabled: noSelectedNotes && notSearch
- },
-
- { kind: "separator" },
-
- { title: t("tree-context-menu.copy-note-path-to-clipboard"), command: "copyNotePathToClipboard", uiIcon: "bx bx-directions", enabled: true },
- { title: t("tree-context-menu.recent-changes-in-subtree"), command: "recentChangesInSubtree", uiIcon: "bx bx-history", enabled: noSelectedNotes && notOptionsOrHelp }
- ].filter(Boolean) as MenuItem<TreeCommandNames>[]
- },
-
- { kind: "separator" },
-
{
title: t("tree-context-menu.move-to"),
command: "moveNotesTo",
@@ -372,6 +312,64 @@ export async function buildTreeContextMenuItems(ctx: TreeContextMenuContext): Pr
keyboardShortcut: "searchInSubtree",
uiIcon: "bx bx-search",
enabled: notSearch && noSelectedNotes
+ },
+
+ {
+ title: t("tree-context-menu.advanced"),
+ uiIcon: "bx bxs-wrench",
+ enabled: true,
+ items: [
+ { title: t("tree-context-menu.apply-bulk-actions"), command: "openBulkActionsDialog", uiIcon: "bx bx-list-plus", enabled: true },
+ {
+ // One note at a time: the dialog is configured against what that note holds and
+ // reports on what it changed there, neither of which a multi-selection has.
+ title: t("compress-images"),
+ uiIcon: "bx bx-collapse-alt",
+ enabled: noSelectedNotes && notOptionsOrHelp,
+ handler: () => void showImageCompressionDialog({ type: "note", noteId: note.noteId })
+ },
+
+ { kind: "separator" },
+
+ {
+ title: t("tree-context-menu.edit-branch-prefix"),
+ command: "editBranchPrefix",
+ keyboardShortcut: "editBranchPrefix",
+ uiIcon: "bx bx-rename",
+ enabled: isNotRoot && parentNotSearch && notOptionsOrHelp
+ },
+ {
+ title: t("tree-context-menu.convert-to-attachment"),
+ command: "convertNoteToAttachment",
+ uiIcon: "bx bx-paperclip",
+ enabled: isNotRoot && !isHoisted && notOptionsOrHelp && selectedNotes.some((n) => n.isEligibleForConversionToAttachment())
+ },
+
+ { kind: "separator" },
+
+ !hasSubtreeHidden && !isMobileTarget && { title: t("tree-context-menu.expand-subtree"), command: "expandSubtree", keyboardShortcut: "expandSubtree", uiIcon: "bx bx-expand", enabled: noSelectedNotes },
+ !hasSubtreeHidden && !isMobileTarget && { title: t("tree-context-menu.collapse-subtree"), command: "collapseSubtree", keyboardShortcut: "collapseSubtree", uiIcon: "bx bx-collapse", enabled: noSelectedNotes },
+ {
+ title: hasSubtreeHidden ? t("tree-context-menu.show-subtree") : t("tree-context-menu.hide-subtree"),
+ uiIcon: "bx bx-show",
+ enabled: isNotRoot,
+ handler: async () => {
+ attributes.setBooleanWithInheritance(note, "subtreeHidden", !hasSubtreeHidden);
+ }
+ },
+ {
+ title: t("tree-context-menu.sort-by"),
+ command: "sortChildNotes",
+ keyboardShortcut: "sortChildNotes",
+ uiIcon: "bx bx-sort-down",
+ enabled: noSelectedNotes && notSearch
+ },
+
+ { kind: "separator" },
+
+ { title: t("tree-context-menu.copy-note-path-to-clipboard"), command: "copyNotePathToClipboard", uiIcon: "bx bx-directions", enabled: true },
+ { title: t("tree-context-menu.recent-changes-in-subtree"), command: "recentChangesInSubtree", uiIcon: "bx bx-history", enabled: noSelectedNotes && notOptionsOrHelp }
+ ].filter(Boolean) as MenuItem<TreeCommandNames>[]
}
];
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu.html
index 2faf0cdd77..8cf43b7cf1 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu.html
@@ -200,8 +200,8 @@
</figure>
<p>The advanced options menu offers some of the less frequently used actions
for notes.</p>
-<p>To access these options, first look for the <em>Advanced</em> option in
- the contextual menu to reveal a sub-menu with:</p>
+<p>To access these options, first look for the <em>Advanced</em> option at
+ the bottom of the contextual menu to reveal a sub-menu with:</p>
<ul>
<li><strong>Apply bulk actions</strong>
<ul>
diff --git a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu.md b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu.md
index 573e9700d2..e7d90f007f 100644
--- a/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu.md
+++ b/docs/User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu.md
@@ -87,7 +87,7 @@ The rest of the menu lists its options one per row:
The advanced options menu offers some of the less frequently used actions for notes.
-To access these options, first look for the _Advanced_ option in the contextual menu to reveal a sub-menu with:
+To access these options, first look for the _Advanced_ option at the bottom of the contextual menu to reveal a sub-menu with:
* **Apply bulk actions**
* Opens the <a class="reference-link" href="../../../Advanced%20Usage/Bulk%20Actions.md">Bulk Actions</a> dialog, to apply actions such as adding labels or moving notes to multiple notes at once (see <a class="reference-link" href="Multiple%20selection.md">Multiple selection</a>).