Skip to content

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

:art: 反链面板中文档标题在鼠标悬浮时显示文档完整路径 https://github.com/siyuan-note/insider/issues/1088

Liang Dingef5a911f5760
diff --git a/kernel/model/block.go b/kernel/model/block.go
index 36455f39ac..4ce27279cd 100644
--- a/kernel/model/block.go
+++ b/kernel/model/block.go
@@ -69,6 +69,7 @@ type Path struct {
ID string `json:"id"` // 块 ID
Box string `json:"box"` // 块 Box
Name string `json:"name"` // 当前路径
+ HPath string `json:"hPath"` // 人类可读路径
Type string `json:"type"` // "path"
NodeType string `json:"nodeType"` // 节点类型
SubType string `json:"subType"` // 节点子类型
diff --git a/kernel/model/path.go b/kernel/model/path.go
index 7f3193e161..d3039ff6e7 100644
--- a/kernel/model/path.go
+++ b/kernel/model/path.go
@@ -120,6 +120,10 @@ func toFlatTree(blocks []*Block, baseDepth int, typ string) (ret []*Path) {
treeNode.Blocks = append(treeNode.Blocks, c)
}
ret = append(ret, treeNode)
+
+ if "backlink" == typ {
+ treeNode.HPath = root.HPath
+ }
}
sort.Slice(ret, func(i, j int) bool {