Skip to content

Build your personal knowledge base with Trilium Notes

feat(tree): hide items dragged into a subtreeHidden

Elian Doran0f77caad6963
diff --git a/apps/client/src/widgets/note_tree.ts b/apps/client/src/widgets/note_tree.ts
index 1e4866b0f6..a61c454b29 100644
--- a/apps/client/src/widgets/note_tree.ts
+++ b/apps/client/src/widgets/note_tree.ts
@@ -758,6 +758,16 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
return;
}
+ const parentNote = froca.getNoteFromCache(branch.parentNoteId);
+ if (parentNote?.hasLabel("subtreeHidden")) {
+ const parentNode = node.getParent();
+ if (parentNode) {
+ parentNode.setActive(true);
+ }
+ node.remove();
+ return;
+ }
+
const title = `${branch.prefix ? `${branch.prefix} - ` : ""}${note.title}`;
node.data.isProtected = note.isProtected;