diff --git a/src/public/app/widgets/note_tree.ts b/src/public/app/widgets/note_tree.ts
index 7fc801ecb..961432df9 100644
--- a/src/public/app/widgets/note_tree.ts
+++ b/src/public/app/widgets/note_tree.ts
@@ -25,6 +25,8 @@ import type FNote from "../entities/fnote.js";
import type { NoteType } from "../entities/fnote.js";
import type { AttributeRow, BranchRow } from "../services/load_results.js";
import type { SetNoteOpts } from "../components/note_context.js";
+import type { TouchBarItem } from "./touch_bar.js";
+import type { TreeCommandNames } from "../menus/tree_context_menu.js";
const TPL = /*html*/`
@@ -1760,4 +1762,28 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
appContext.tabManager.getActiveContext()?.setNote(resp.note.noteId);
}
+
+ buildTouchBarCommand({ TouchBar, buildIcon }: CommandListenerData<"buildTouchBar">) {
+ const triggerCommand = (command: TreeCommandNames) => {
+ const node = this.getActiveNode();
+ const notePath = treeService.getNotePath(node);
+
+ this.triggerCommand(command, {
+ node,
+ notePath,
+ noteId: node.data.noteId,
+ selectedOrActiveBranchIds: this.getSelectedOrActiveBranchIds(node),
+ selectedOrActiveNoteIds: this.getSelectedOrActiveNoteIds(node)
+ });
+ }
+
+ const items: TouchBarItem[] = [
+ new TouchBar.TouchBarButton({
+ icon: buildIcon("NSImageNameTouchBarDeleteTemplate"),
+ click: () => triggerCommand("deleteNotes")
+ })
+ ];
+
+ return items;
+ }
}