From 369eb7844d054c38947529f392bbb053f75fe7c0 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Thu, 12 Jun 2025 19:36:54 +0800 Subject: [PATCH] fix(tree): Unexpected collapse after hoisting a note --- apps/client/src/widgets/note_tree.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/client/src/widgets/note_tree.ts b/apps/client/src/widgets/note_tree.ts index 662562f42..46abe10a0 100644 --- a/apps/client/src/widgets/note_tree.ts +++ b/apps/client/src/widgets/note_tree.ts @@ -1507,6 +1507,12 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { ); this.toggleHiddenNode(true); // hoisting will handle hidden note visibility + + // Automatically expand the hoisted note by default + const node = this.getActiveNode(); + if (node.data.noteId === this.noteContext.hoistedNoteId){ + this.setExpanded(node.data.branchId, true); + } } }