An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: Avoid loading desktop navigation code on mobile https://github.com/siyuan-note/siyuan/issues/18835
Daniel43c3147ab128
diff --git a/app/src/block/util.ts b/app/src/block/util.tsindex 16efe344b8..1cbb77551f 100644--- a/app/src/block/util.ts+++ b/app/src/block/util.ts@@ -19,8 +19,6 @@ import {openMobileFileById} from "../mobile/editor";import {mathRender} from "../protyle/render/mathRender";import {buildCancelSuperBlockOperations} from "./cancelSuperBlock";import {shouldFocusJumpTarget, shouldFocusParentDocumentTitle} from "./jumpToParent";-import {zoomOut} from "../menus/protyle";-import {pushBack} from "../util/backForward";export const cancelSB = async (protyle: IProtyle, nodeElement: Element, range?: Range) => {let previousId = getPreviousBlockSibling(nodeElement)?.getAttribute("data-node-id");@@ -198,11 +196,13 @@ export const refreshSbAndPersistWidth = (sbElement: Element,};export const jumpToParent = (protyle: IProtyle, nodeElement: Element, type: "parent" | "next" | "previous") => {+ /// #if !MOBILEconst previousRange = getEditorRange(nodeElement);+ /// #endiffetchPost("/api/block/getBlockSiblingID", {id: nodeElement.getAttribute("data-node-id"),notebook: protyle.notebookId,- }, (response) => {+ }, async (response) => {const targetId = response.data[type];if (!targetId) {return;@@ -213,6 +213,14 @@ export const jumpToParent = (protyle: IProtyle, nodeElement: Element, type: "parhasTitle: Boolean(titleElement),isBacklink: Boolean(protyle.options.backlinkData),})) {+ /// #if !MOBILE+ let pushBack: typeof import("../util/backForward").pushBack | undefined;+ try {+ ({pushBack} = await import("../util/backForward"));+ } catch (error) {+ console.error("Failed to load the back-forward module", error);+ }+ /// #endifconst focusTitle = () => {const range = titleElement.ownerDocument.createRange();range.selectNodeContents(titleElement);@@ -220,10 +228,15 @@ export const jumpToParent = (protyle: IProtyle, nodeElement: Element, type: "parfocusByRange(range);protyle.toolbar.range = range;protyle.contentElement.scrollTop = 0;- pushBack(protyle, range, titleElement);+ /// #if !MOBILE+ pushBack?.(protyle, range, titleElement);+ /// #endif};- pushBack(protyle, previousRange);+ /// #if !MOBILE+ pushBack?.(protyle, previousRange);+ /// #endifif (protyle.block.showAll) {+ const {zoomOut} = await import("../menus/protyle");zoomOut({protyle,id: protyle.block.rootID,