Skip to content

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

:art: Improve sorting for `Add to Database` https://github.com/siyuan-note/siyuan/issues/11286

Daniel9a544e2a09ca
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index d30f04f48a..3a945a9910 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -21,6 +21,7 @@ import (
"fmt"
"os"
"path/filepath"
+ "slices"
"sort"
"strconv"
"strings"
@@ -2216,6 +2217,8 @@ func (tx *Transaction) doInsertAttrViewBlock(operation *Operation) (ret *TxErr)
}
func AddAttributeViewBlock(tx *Transaction, srcs []map[string]interface{}, avID, blockID, previousBlockID string, ignoreFillFilter bool) (err error) {
+ slices.Reverse(srcs) // https://github.com/siyuan-note/siyuan/issues/11286
+
for _, src := range srcs {
srcID := src["id"].(string)
isDetached := src["isDetached"].(bool)