Skip to content

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

:art: Improve rollback doc file history https://github.com/siyuan-note/siyuan/issues/11575

Daniel21d7f4a81e9f
diff --git a/kernel/model/history.go b/kernel/model/history.go
index 9e2af2ada4..b0ce07e38c 100644
--- a/kernel/model/history.go
+++ b/kernel/model/history.go
@@ -273,8 +273,26 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
IncSync()
go func() {
sql.WaitForWritingDatabase()
+
+ tree, _ = LoadTreeByBlockID(id)
+ if nil == tree {
+ return
+ }
+
// 刷新关联的动态锚文本 https://github.com/siyuan-note/siyuan/issues/11575
refreshDynamicRefText(tree.Root, tree)
+
+ // 刷新页签名
+ refText := getNodeRefText(tree.Root)
+ evt := util.NewCmdResult("rename", 0, util.PushModeBroadcast)
+ evt.Data = map[string]interface{}{
+ "box": boxID,
+ "id": tree.Root.ID,
+ "path": tree.Path,
+ "title": tree.Root.IALAttr("title"),
+ "refText": refText,
+ }
+ util.PushEvent(evt)
}()
return nil
}