An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:recycle: 重构重命名/移动文档路径
Liang Ding5f364acbbc0a
diff --git a/kernel/model/box.go b/kernel/model/box.goindex bd29ac1d1d..f63dc0d71c 100644--- a/kernel/model/box.go+++ b/kernel/model/box.go@@ -391,47 +391,28 @@ func isSkipFile(filename string) bool {return strings.HasPrefix(filename, ".") || "node_modules" == filename || "dist" == filename || "target" == filename}-func (box *Box) renameSubTrees(tree *parse.Tree) {- subFiles := box.ListFiles(tree.Path)- totals := len(subFiles) + 3- showProgress := 64 < totals- for i, subFile := range subFiles {- if !strings.HasSuffix(subFile.path, ".sy") {- continue- }-- subTree, err := LoadTree(box.ID, subFile.path) // LoadTree 会重新构造 HPath- if nil != err {- continue- }-- sql.UpsertTreeQueue(subTree)- if showProgress {- msg := fmt.Sprintf(Conf.Language(107), subTree.HPath)- util.PushProgress(util.PushProgressCodeProgressed, i, totals, msg)- }- }-- if showProgress {- util.ClearPushProgress(totals)- }-}-func moveTree(tree *parse.Tree) {treenode.SetBlockTreePath(tree)sql.UpsertTreeQueue(tree)box := Conf.Box(tree.Box)+ box.renameSubTrees(tree)+}++func (box *Box) renameSubTrees(tree *parse.Tree) {subFiles := box.ListFiles(tree.Path)- totals := len(subFiles) + 5- showProgress := 64 < totals+ box.moveTrees0(subFiles)+}- for i, subFile := range subFiles {+func (box *Box) moveTrees0(files []*FileInfo) {+ totals := len(files) + 5+ showProgress := 64 < totals+ for i, subFile := range files {if !strings.HasSuffix(subFile.path, ".sy") {continue}- subTree, err := LoadTree(box.ID, subFile.path)+ subTree, err := LoadTree(box.ID, subFile.path) // LoadTree 会重新构造 HPathif nil != err {continue}