Skip to content

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

:art: Improve the drag-and-drop experience in the list and super block https://github.com/siyuan-note/siyuan/issues/17893

Daniel8dc2619d1416
diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go
index 566f167c23..d70b5688b6 100644
--- a/kernel/model/transaction.go
+++ b/kernel/model/transaction.go
@@ -987,10 +987,13 @@ func (tx *Transaction) doDelete(operation *Operation) (ret *TxErr) {
return &TxErr{code: TxErrCodeBlockNotFound, id: id}
}
- deletedNode := tx.doDelete0(operation, tree)
- // 同步清理被删除容器块的索引节点及其子节点,否则删除列表/超级块等容器块后其子节点依然存在,ExistBlockTree 仍返回 true
- // Improve editor state synchronization when deleting blocks https://github.com/siyuan-note/siyuan/issues/17742
- deletedIDs := deletedNode.BlockIDs()
+ deletedNode := tx.doDelete0(operation, tree)
+ if nil == deletedNode {
+ return
+ }
+ // 同步清理被删除容器块的索引节点及其子节点,否则删除列表/超级块等容器块后其子节点依然存在,ExistBlockTree 仍返回 true
+ // Improve editor state synchronization when deleting blocks https://github.com/siyuan-note/siyuan/issues/17742
+ deletedIDs := deletedNode.BlockIDs()
treenode.RemoveBlockTreesByIDs(deletedIDs)
tx.writeTree(tree)
return