Skip to content

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

:art: Database gallery view https://github.com/siyuan-note/siyuan/issues/10414

Daniel72898063d89c
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 44a20dda03..e8ad1b4711 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -44,6 +44,14 @@ import (
"github.com/xrash/smetrics"
)
+func (tx *Transaction) doSetAttrViewBlockView(operation *Operation) (ret *TxErr) {
+ err := SetDatabaseBlockView(operation.BlockID, operation.ID, operation.AvID)
+ if err != nil {
+ return &TxErr{code: TxErrWriteAttributeView, id: operation.AvID, msg: err.Error()}
+ }
+ return
+}
+
func (tx *Transaction) doChangeAttrViewLayout(operation *Operation) (ret *TxErr) {
err := changeAttrViewLayout(operation)
if err != nil {
diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go
index 57364827fa..861bec7331 100644
--- a/kernel/model/transaction.go
+++ b/kernel/model/transaction.go
@@ -290,6 +290,8 @@ func performTx(tx *Transaction) (ret *TxErr) {
ret = tx.doSetAttrViewWrapField(op)
case "changeAttrViewLayout":
ret = tx.doChangeAttrViewLayout(op)
+ case "setAttrViewBlockView":
+ ret = tx.doSetAttrViewBlockView(op)
}
if nil != ret {