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

Vanessac4aee4d601ec
diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts
index f2c1ca8787..0229521a8f 100644
--- a/app/src/layout/util.ts
+++ b/app/src/layout/util.ts
@@ -578,7 +578,7 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any, brea
json.blockId = layout.editor.protyle.block.id;
json.rootId = layout.editor.protyle.block.rootID;
json.mode = layout.editor.protyle.preview.element.classList.contains("fn__none") ? "wysiwyg" : "preview";
- json.action = layout.editor.protyle.block.showAll ? Constants.CB_GET_ALL : Constants.CB_GET_SCROLL;
+ json.action = (layout.editor.protyle.block.showAll && layout.editor.protyle.block.id !== layout.editor.protyle.block.rootID) ? Constants.CB_GET_ALL : Constants.CB_GET_SCROLL;
json.instance = "Editor";
} else if (layout instanceof Asset) {
json.path = layout.path;
diff --git a/app/src/protyle/scroll/saveScroll.ts b/app/src/protyle/scroll/saveScroll.ts
index d85aaca143..f4a69cf05d 100644
--- a/app/src/protyle/scroll/saveScroll.ts
+++ b/app/src/protyle/scroll/saveScroll.ts
@@ -67,7 +67,7 @@ export const getDocByScroll = (options: {
actions = [Constants.CB_GET_UNUNDO];
}
}
- if (options.scrollAttr?.zoomInId) {
+ if (options.scrollAttr?.zoomInId && options.scrollAttr?.rootId && options.scrollAttr.zoomInId !== options.scrollAttr.rootId) {
fetchPost("/api/filetree/getDoc", {
id: options.scrollAttr.zoomInId,
size: Constants.SIZE_GET_MAX,