An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: Improve av https://github.com/siyuan-note/siyuan/issues/15490
Danieleba15bb41ab3
diff --git a/kernel/av/av.go b/kernel/av/av.goindex 15926cfe5f..1a78ef31b6 100644--- a/kernel/av/av.go+++ b/kernel/av/av.go@@ -200,6 +200,7 @@ type View struct {GroupVal *Value `json:"groupVal,omitempty"` // 分组值GroupFolded bool `json:"groupFolded"` // 分组是否折叠GroupHidden int `json:"groupHidden"` // 分组是否隐藏,0:显示,1:空白隐藏,2:手动隐藏+ GroupSort int `json:"groupSort"` // 分组排序值}// GetGroupValue 获取分组视图的分组值。diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.goindex 19e4e9f567..37244f070f 100644--- a/kernel/model/attribute_view.go+++ b/kernel/model/attribute_view.go@@ -198,6 +198,10 @@ func sortAttributeViewGroup(avID, blockID, previousGroupID, groupID string) (err}view.Groups = util.InsertElem(view.Groups, previousIndex, groupView)+ for i, g := range view.Groups {+ g.GroupSort = i+ }+err = av.SaveAttributeView(attrView)return}@@ -1797,6 +1801,7 @@ func renderAttributeView(attrView *av.AttributeView, blockID, viewID, query strifunc sortGroupViews(todayStart time.Time, view *av.View) {if av.GroupOrderMan == view.Group.Order {+ sort.Slice(view.Groups, func(i, j int) bool { return view.Groups[i].GroupSort < view.Groups[j].GroupSort })return}@@ -2077,6 +2082,7 @@ type GroupState struct {ID stringFolded boolHidden int+ Sort int}func getAttrViewGroupStates(view *av.View) (groupStates map[string]*GroupState) {@@ -2090,6 +2096,7 @@ func getAttrViewGroupStates(view *av.View) (groupStates map[string]*GroupState)ID: groupView.ID,Folded: groupView.GroupFolded,Hidden: groupView.GroupHidden,+ Sort: groupView.GroupSort,}}return@@ -2101,6 +2108,7 @@ func setAttrViewGroupStates(view *av.View, groupStates map[string]*GroupState) {groupView.ID = state.IDgroupView.GroupFolded = state.FoldedgroupView.GroupHidden = state.Hidden+ groupView.GroupSort = state.Sort}}}