Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(tree): only allow dropping into the hoisted note, not before/after
Elian Doran18d5aea877b9
diff --git a/apps/client/src/widgets/note_tree.ts b/apps/client/src/widgets/note_tree.tsindex b0ae3cbf3c..87f564be7e 100644--- a/apps/client/src/widgets/note_tree.ts+++ b/apps/client/src/widgets/note_tree.ts@@ -548,6 +548,10 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {return false;} else if (node.data.noteId.startsWith("_options")) {return false;+ } else if (node.data.noteId === hoistedNoteService.getHoistedNoteId()) {+ // The hoisted note is the tree root, so it has no visible siblings to drop before/after.+ // Only allow dropping into it to avoid the easy-to-hit "dropping not allowed" strips.+ return ["over"];} else if (node.data.noteType === "launcher") {return ["before", "after"];} else if (["_lbAvailableLaunchers", "_lbVisibleLaunchers"].includes(node.data.noteId)) {