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

Vanessae11ba33f4c18
diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts
index 7623a284d0..8366d5a1f6 100644
--- a/app/src/menus/protyle.ts
+++ b/app/src/menus/protyle.ts
@@ -912,14 +912,14 @@ export const zoomOut = (options: {
data: getResponse,
protyle: options.protyle,
action: options.id === options.protyle.block.rootID ? [Constants.CB_GET_FOCUS, Constants.CB_GET_HTML] : [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS, Constants.CB_GET_HTML],
- afterCB: options.callback
+ afterCB: options.callback,
});
} else {
onGet({
data: getResponse,
protyle: options.protyle,
action: options.id === options.protyle.block.rootID ? [Constants.CB_GET_FOCUS, Constants.CB_GET_HTML, Constants.CB_GET_UNUNDO] : [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS, Constants.CB_GET_UNUNDO, Constants.CB_GET_HTML],
- afterCB: options.callback
+ afterCB: options.callback,
});
}
// https://github.com/siyuan-note/siyuan/issues/4874
@@ -938,7 +938,13 @@ export const zoomOut = (options: {
showElement = getFirstBlock(showElement);
}
focusBlock(showElement);
- showElement.scrollIntoView();
+ const resizeObserver = new ResizeObserver(() => {
+ showElement.scrollIntoView();
+ });
+ resizeObserver.observe(options.protyle.wysiwyg.element);
+ setTimeout(() => {
+ resizeObserver.disconnect();
+ }, 1000 * 3);
} else if (options.id === options.protyle.block.rootID) { // 聚焦返回后,该块是动态加载的,但是没加载出来
fetchPost("/api/filetree/getDoc", {
id: options.focusId,