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

Vanessa6bc968c0e633
diff --git a/app/src/config/fileTree.ts b/app/src/config/fileTree.ts
index 96f0c2678e..80f561832d 100644
--- a/app/src/config/fileTree.ts
+++ b/app/src/config/fileTree.ts
@@ -28,6 +28,14 @@ export const fileTree = {
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="closeTabsOnStart" type="checkbox"${window.siyuan.config.fileTree.closeTabsOnStart ? " checked" : ""}/>
</label>
+<label class="fn__flex b3-label">
+ <div class="fn__flex-1">
+ ${window.siyuan.languages.noSplitScreenWhenOpenTab}
+ <div class="b3-label__text">${window.siyuan.languages.noSplitScreenWhenOpenTabTip}</div>
+ </div>
+ <span class="fn__space"></span>
+ <input class="b3-switch fn__flex-center" id="noSplitScreenWhenOpenTab" type="checkbox"${window.siyuan.config.fileTree.noSplitScreenWhenOpenTab ? " checked" : ""}/>
+</label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.fileTree18}
@@ -138,6 +146,7 @@ export const fileTree = {
docCreateSaveBox: (fileTree.element.querySelector("#docCreateSaveBox") as HTMLInputElement).value,
openFilesUseCurrentTab: (fileTree.element.querySelector("#openFilesUseCurrentTab") as HTMLInputElement).checked,
closeTabsOnStart: (fileTree.element.querySelector("#closeTabsOnStart") as HTMLInputElement).checked,
+ noSplitScreenWhenOpenTab: (fileTree.element.querySelector("#noSplitScreenWhenOpenTab") as HTMLInputElement).checked,
allowCreateDeeper: (fileTree.element.querySelector("#allowCreateDeeper") as HTMLInputElement).checked,
removeDocWithoutConfirm: (fileTree.element.querySelector("#removeDocWithoutConfirm") as HTMLInputElement).checked,
useSingleLineSave: (fileTree.element.querySelector("#useSingleLineSave") as HTMLInputElement).checked,
diff --git a/app/src/config/search.ts b/app/src/config/search.ts
index 94b0bb7ea7..8d3d409f60 100644
--- a/app/src/config/search.ts
+++ b/app/src/config/search.ts
@@ -35,7 +35,8 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
getLang(["selectOpen", "tabLimit", "fileTree", "fileTree2", "fileTree3", "fileTree4", "fileTree5",
"fileTree6", "fileTree7", "fileTree8", "fileTree9", "fileTree10", "fileTree12", "fileTree13", "fileTree15",
"fileTree16", "fileTree17", "fileTree18", "fileTree19", "fileTree20", "fileTree21", "fileTree22", "fileTree23",
- "fileTree24", "fileTree25", "recentDocsMaxListCount", "recentDocsMaxListCountTip"]),
+ "fileTree24", "fileTree25", "recentDocsMaxListCount", "recentDocsMaxListCountTip", "noSplitScreenWhenOpenTab",
+ "noSplitScreenWhenOpenTabTip"]),
// 闪卡
getLang(["riffCard", "flashcardNewCardLimit", "flashcardNewCardLimitTip", "flashcardReviewCardLimit",
diff --git a/app/src/editor/openLink.ts b/app/src/editor/openLink.ts
index 198d351cf0..ecf0d033b6 100644
--- a/app/src/editor/openLink.ts
+++ b/app/src/editor/openLink.ts
@@ -135,7 +135,7 @@ export const openLink = (protyle: IProtyle, aLink: string, event?: MouseEvent, c
openByMobile(linkAddress);
/// #endif
} else {
- openAsset(protyle.app, linkAddress, pdfParams, "right");
+ openAsset(protyle.app, linkAddress, pdfParams, !window.siyuan.config.fileTree.noSplitScreenWhenOpenTab ? "right" : null);
}
} else {
/// #if !BROWSER
diff --git a/app/src/search/util.ts b/app/src/search/util.ts
index 9ec132b244..f0449096a4 100644
--- a/app/src/search/util.ts
+++ b/app/src/search/util.ts
@@ -76,7 +76,7 @@ export const openGlobalSearch = (app: App, text: string, replace: boolean, searc
removed: localData.removed,
page: 1
},
- position: (window.siyuan.layout.centerLayout.children.length > 1 || window.innerWidth > 1024) ? "right" : undefined
+ position: (!window.siyuan.config.fileTree.noSplitScreenWhenOpenTab && (window.siyuan.layout.centerLayout.children.length > 1 || window.innerWidth > 1024)) ? "right" : undefined
});
};
@@ -593,7 +593,7 @@ export const genSearch = (app: App, config: Config.IUILayoutTabSearchConfig, ele
openFile({
app,
searchData: config,
- position: (window.siyuan.layout.centerLayout.children.length > 1 || window.innerWidth > 1024) ? "right" : undefined
+ position: (!window.siyuan.config.fileTree.noSplitScreenWhenOpenTab && (window.siyuan.layout.centerLayout.children.length > 1 || window.innerWidth > 1024)) ? "right" : undefined
});
if (closeCB) {
closeCB();
diff --git a/app/src/types/config.d.ts b/app/src/types/config.d.ts
index cd90be0a14..0bdbff76cb 100644
--- a/app/src/types/config.d.ts
+++ b/app/src/types/config.d.ts
@@ -629,6 +629,10 @@ declare namespace Config {
* Whether to allow the creation of sub-documents deeper than 7 levels
*/
allowCreateDeeper: boolean;
+ /**
+ * Don't automatically split the screen when opening search, PDF and other tabs
+ */
+ noSplitScreenWhenOpenTab: boolean;
/**
* Whether to automatically locate the currently open document in the document tree
*/