Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Improve outline dnd https://github.com/siyuan-note/siyuan/issues/10828

Daniele12ed21c655e
diff --git a/kernel/model/outline.go b/kernel/model/outline.go
index 25abe2b54b..859287edc6 100644
--- a/kernel/model/outline.go
+++ b/kernel/model/outline.go
@@ -31,17 +31,16 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) {
previousID := operation.PreviousID
parentID := operation.ParentID
- if headingID == parentID || headingID == previousID {
- return
- }
-
tree, err := tx.loadTree(headingID)
if nil != err {
return &TxErr{code: TxErrCodeBlockNotFound, id: headingID}
}
-
operation.RetData = tree.Root.ID
+ if headingID == parentID || headingID == previousID {
+ return
+ }
+
heading := treenode.GetNodeInTree(tree, headingID)
if nil == heading {
return &TxErr{code: TxErrCodeBlockNotFound, id: headingID}