Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/6740

Vanessabb73932a1722
diff --git a/app/src/search/util.ts b/app/src/search/util.ts
index 3491fb6630..4ff0911e63 100644
--- a/app/src/search/util.ts
+++ b/app/src/search/util.ts
@@ -143,6 +143,16 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
<span id="searchPath" style="opacity: 1;padding: 3px 4px;" aria-label="${window.siyuan.languages.specifyPath}" class="block__icon b3-tooltips b3-tooltips__w">
<svg><use xlink:href="#iconFolder"></use></svg>
</span>
+ <div class="fn__flex${config.group === 0 ? " fn__none" : ""}">
+ <span class="fn__space"></span>
+ <span id="searchExpand" style="opacity: 1;padding: 3px 4px;" class="block__icon b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.expand}">
+ <svg><use xlink:href="#iconFullscreen"></use></svg>
+ </span>
+ <span class="fn__space"></span>
+ <span id="searchCollapse" style="opacity: 1;padding: 3px 4px;" class="block__icon b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.collapse}">
+ <svg><use xlink:href="#iconContract"></use></svg>
+ </span>
+ </div>
</div>
<div id="searchList" class="search__list b3-list b3-list--background"></div>
<div id="searchPreview" class="fn__flex-1 search__preview"></div>
@@ -180,6 +190,26 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
event.stopPropagation();
event.preventDefault();
break;
+ } else if (target.id === "searchExpand") {
+ Array.from(searchPanelElement.children).forEach(item => {
+ if (item.classList.contains("b3-list-item")) {
+ item.querySelector(".b3-list-item__arrow").classList.add("b3-list-item__arrow--open");
+ item.nextElementSibling.classList.remove("fn__none");
+ }
+ })
+ event.stopPropagation();
+ event.preventDefault();
+ break;
+ } else if (target.id === "searchCollapse") {
+ Array.from(searchPanelElement.children).forEach(item => {
+ if (item.classList.contains("b3-list-item")) {
+ item.querySelector(".b3-list-item__arrow").classList.remove("b3-list-item__arrow--open");
+ item.nextElementSibling.classList.add("fn__none");
+ }
+ })
+ event.stopPropagation();
+ event.preventDefault();
+ break;
} else if (target.id === "searchPath") {
movePathTo([], undefined, (toPath, toNotebook) => {
if (toPath === "/") {
@@ -240,6 +270,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
event.preventDefault();
break;
} else if (target.id === "searchGroup") {
+ element.querySelector("#searchCollapse").parentElement.classList.toggle("fn__none")
config.group = config.group === 0 ? 1 : 0;
inputTimeout = inputEvent(element, config, inputTimeout, edit);
event.stopPropagation();