An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Improve av option editing https://github.com/siyuan-note/siyuan/issues/11484
Daniel4a668ab414f4
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.goindex 9e76aa3a0a..3261d1341d 100644--- a/kernel/model/attribute_view.go+++ b/kernel/model/attribute_view.go@@ -3468,7 +3468,7 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {found := falseif oldName != newName {for _, opt := range key.Options {- if newName == opt.Name { // 如果选项名已经存在则直接使用+ if newName == opt.Name { // 如果选项已经存在则直接使用found = truenewColor = opt.Colorbreak@@ -3497,13 +3497,33 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {continue}- for i, opt := range value.MSelect {- if oldName == opt.Content {- value.MSelect[i].Content = newName- value.MSelect[i].Color = newColor+ found = false+ for _, opt := range value.MSelect {+ if newName == opt.Content {+ found = truebreak}}+ if found {+ idx := -1+ for i, opt := range value.MSelect {+ if oldName == opt.Content {+ idx = i+ break+ }+ }+ if 0 <= idx {+ value.MSelect = util.RemoveElem(value.MSelect, idx)+ }+ } else {+ for i, opt := range value.MSelect {+ if oldName == opt.Content {+ value.MSelect[i].Content = newName+ value.MSelect[i].Color = newColor+ break+ }+ }+ }}break}