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: https://github.com/siyuan-note/siyuan/pull/16727
Vanessadafb7673bc92
diff --git a/app/src/business/openRecentDocs.ts b/app/src/business/openRecentDocs.tsindex 39810d861a..3fa4f67f25 100644--- a/app/src/business/openRecentDocs.ts+++ b/app/src/business/openRecentDocs.ts@@ -20,18 +20,14 @@ const renderRecentDocsContent = async (data: {}[], element: Element, key?: string) => {let tabHtml = "";let index = 0;-- if (key) {- data = data.filter((item) => {- return item.title.toLowerCase().includes(key.toLowerCase());- });- }data.forEach((item) => {- tabHtml += `<li data-index="${index}" data-node-id="${item.rootID}" class="b3-list-item${index === 0 ? " b3-list-item--focus" : ""}">+ if (!key || item.title.toLowerCase().includes(key.toLowerCase())) {+ tabHtml += `<li data-index="${index}" data-node-id="${item.rootID}" class="b3-list-item${index === 0 ? " b3-list-item--focus" : ""}">${unicode2Emoji(item.icon || window.siyuan.storage[Constants.LOCAL_IMAGES].file, "b3-list-item__graphic", true)}<span class="b3-list-item__text">${escapeHtml(item.title)}</span></li>`;- index++;+ index++;+ }});let switchPath = "";if (tabHtml) {@@ -49,10 +45,10 @@ const renderRecentDocsContent = async (data: {<span class="b3-list-item__text">${window.siyuan.languages.riffCard}</span><span class="b3-list-item__meta">${updateHotkeyTip(window.siyuan.config.keymap.general.riffCard.custom)}</span></li>`;+ docIndex++;if (!switchPath) {switchPath = window.siyuan.languages.riffCard;}- docIndex++;}getAllDocks().forEach((item) => {if (!key || item.title.toLowerCase().includes(key.toLowerCase())) {@@ -153,7 +149,6 @@ export const openRecentDocs = () => {sortSelect.addEventListener("change", () => {// 重新调用 API 获取排序后的数据fetchPost("/api/storage/getRecentDocs", {sortBy: sortSelect.value}, (newResponse) => {- response = newResponse;renderRecentDocsContent(newResponse.data, dialog.element, searchElement.value);});window.siyuan.storage[Constants.LOCAL_RECENT_DOCS].type = sortSelect.value;diff --git a/kernel/model/storage.go b/kernel/model/storage.goindex 52b3b46c9c..c95c18e5b1 100644--- a/kernel/model/storage.go+++ b/kernel/model/storage.go@@ -372,7 +372,7 @@ func getRecentDocs(sortBy string) (ret []*RecentDoc, err error) {switch sortBy {case "updated": // 按更新时间排序// 从数据库查询最近修改的文档- sqlBlocks := sql.SelectBlocksRawStmt("SELECT * FROM blocks WHERE type = 'd' ORDER BY updated DESC", 1, 32)+ sqlBlocks := sql.SelectBlocksRawStmt("SELECT * FROM blocks WHERE type = 'd' ORDER BY updated DESC", 1, Conf.FileTree.RecentDocsMaxListCount)ret = []*RecentDoc{}if 1 > len(sqlBlocks) {return