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/siyuan/issues/3293

Liang Ding4cd0e379c5f2
diff --git a/kernel/model/storage.go b/kernel/model/storage.go
index 76b684dc64..fe546775dc 100644
--- a/kernel/model/storage.go
+++ b/kernel/model/storage.go
@@ -80,7 +80,10 @@ func SetRecentDoc(doc *RecentDoc) (err error) {
}
}
if !update {
- recentDocs = append(recentDocs, doc)
+ recentDocs = append([]*RecentDoc{doc}, recentDocs...)
+ }
+ if 32 < len(recentDocs) {
+ recentDocs = recentDocs[:64]
}
err = setRecentDocs(recentDocs)