From 96ad8e95e5e9363ec9c6a6951ac4b1f2bd86c32d Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 16 Jan 2026 11:51:55 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/15628 --- app/src/editor/openLink.ts | 1 + app/src/layout/util.ts | 5 +++-- app/src/util/pathName.ts | 25 ++++++++++++++----------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/app/src/editor/openLink.ts b/app/src/editor/openLink.ts index 279f02c6f..198d351cf 100644 --- a/app/src/editor/openLink.ts +++ b/app/src/editor/openLink.ts @@ -63,6 +63,7 @@ export const processSYLink = (app: App, url: string) => { if (urlObj && isSYProtocol(url)) { const id = getIdFromSYProtocol(url); const focus = urlObj.searchParams.get("focus") === "1"; + window.siyuan.editorIsFullscreen = urlObj.searchParams.get("fullscreen") === "1"; fetchPost("/api/block/checkBlockExist", {id}, existResponse => { if (existResponse.data) { checkFold(id, (zoomIn) => { diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 9b9ddddd8..c202c0700 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -481,13 +481,14 @@ export const JSONToLayout = (app: App, isStart: boolean) => { } } }); + const idZoomIn = getIdZoomInByPath(); if (idZoomIn.id) { openFileById({ app, id: idZoomIn.id, action: idZoomIn.isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL], - zoomIn: idZoomIn.isZoomIn + zoomIn: idZoomIn.isZoomIn, }); } else { let latestTabHeaderElement: HTMLElement; @@ -980,7 +981,7 @@ export const adjustLayout = (layout: Layout = window.siyuan.layout.centerLayout. item.element.style.minWidth = ""; } }); - if (layout.direction === "lr" && layout.element.scrollWidth > layout.element.clientWidth + 2 ) { + if (layout.direction === "lr" && layout.element.scrollWidth > layout.element.clientWidth + 2) { let index = Math.ceil(screen.width / 8); while (index > 0) { let width = 0; diff --git a/app/src/util/pathName.ts b/app/src/util/pathName.ts index 28fcd24c9..8b53f7a06 100644 --- a/app/src/util/pathName.ts +++ b/app/src/util/pathName.ts @@ -27,25 +27,28 @@ export const useShell = (cmd: "showItemInFolder" | "openPath", filePath: string) export const getIdZoomInByPath = () => { const searchParams = new URLSearchParams(window.location.search); const PWAURL = searchParams.get("url"); - let id = ""; - let isZoomIn = false; + const data = { + id: "", + isZoomIn: false, + }; if (/^web\+siyuan:\/\/blocks\/\d{14}-\w{7}/.test(PWAURL)) { // PWA 捕获 web+siyuan://blocks/20221031001313-rk7sd0e?focus=1 - id = PWAURL.substring(20, 20 + 22); - isZoomIn = getSearch("focus", PWAURL) === "1"; + data.id = PWAURL.substring(20, 20 + 22); + data.isZoomIn = getSearch("focus", PWAURL) === "1"; + window.siyuan.editorIsFullscreen = getSearch("fullscreen", PWAURL) === "1"; } else if (window.JSAndroid) { // PAD 通过思源协议打开 const SYURL = window.JSAndroid.getBlockURL(); - id = getIdFromSYProtocol(SYURL); - isZoomIn = getSearch("focus", SYURL) === "1"; + data.id = getIdFromSYProtocol(SYURL); + data.isZoomIn = getSearch("focus", SYURL) === "1"; + window.siyuan.editorIsFullscreen = getSearch("fullscreen", SYURL) === "1"; } else { // 支持通过 URL 查询字符串参数 `id` 和 `focus` 跳转到 Web 端指定块 https://github.com/siyuan-note/siyuan/pull/7086 - id = searchParams.get("id"); - isZoomIn = searchParams.get("focus") === "1"; + data.id = searchParams.get("id"); + data.isZoomIn = searchParams.get("focus") === "1"; + window.siyuan.editorIsFullscreen = searchParams.get("fullscreen") === "1"; } - return { - id, isZoomIn - }; + return data; }; export const isSYProtocol = (url: string) => {