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/17929

Vanessa8dd363382a7b
diff --git a/app/src/mobile/menu/search.ts b/app/src/mobile/menu/search.ts
index f05079c7ea..6e73688e4d 100644
--- a/app/src/mobile/menu/search.ts
+++ b/app/src/mobile/menu/search.ts
@@ -226,7 +226,7 @@ ${childItem.tag ? `<span class="b3-list-item__meta b3-list-item__meta--ellipsis"
</div>`;
listElement.scrollTop = 0;
let countHTML = "";
- if (response) {
+ if (response && response.data.matchedBlockCount > 0) {
let text = window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount);
if (response.data.docMode) {
text = window.siyuan.languages.matchDoc.replace("${x}", response.data.matchedRootCount);
diff --git a/app/src/search/util.ts b/app/src/search/util.ts
index 003e34afa8..e17e1765cb 100644
--- a/app/src/search/util.ts
+++ b/app/src/search/util.ts
@@ -1376,12 +1376,16 @@ export const inputEvent = (element: Element, config: Config.IUILayoutTabSearchCo
nextElement.setAttribute("disabled", "disabled");
}
onSearch(response.data.blocks, edit, element, config, focusId);
- let text = window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount);
- if (response.data.docMode) {
- text = window.siyuan.languages.matchDoc.replace("${x}", response.data.matchedRootCount);
- }
- searchResultElement.innerHTML = `${config.page}/${response.data.pageCount || 1}<span class="fn__space"></span>
+ if (response.data.matchedBlockCount > 0) {
+ let text = window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount);
+ if (response.data.docMode) {
+ text = window.siyuan.languages.matchDoc.replace("${x}", response.data.matchedRootCount);
+ }
+ searchResultElement.innerHTML = `${config.page}/${response.data.pageCount || 1}<span class="fn__space"></span>
<span class="ft__on-surface">${text}</span>`;
+ } else {
+ searchResultElement.innerHTML = "";
+ }
loadingElement.classList.add("fn__none");
searchResultElement.setAttribute("data-pagecount", response.data.pageCount || 1);
});