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: fix https://github.com/siyuan-note/siyuan/issues/9082
Vanessa72f28947d261
diff --git a/app/src/block/Panel.ts b/app/src/block/Panel.tsindex 39d82a431f..357ee44a20 100644--- a/app/src/block/Panel.ts+++ b/app/src/block/Panel.ts@@ -156,7 +156,7 @@ export class BlockPanel {if (response.data.rootID !== this.nodeIds[index]) {action.push(Constants.CB_GET_ALL);} else {- action.push(Constants.CB_GET_SCROLL);+ action.push(Constants.CB_GET_CONTEXT);action.push(Constants.CB_GET_HL);}diff --git a/app/src/boot/onGetConfig.ts b/app/src/boot/onGetConfig.tsindex 5feae88ba3..b515186f71 100644--- a/app/src/boot/onGetConfig.ts+++ b/app/src/boot/onGetConfig.ts@@ -281,7 +281,7 @@ export const initWindow = (app: App) => {openFileById({app,id,- action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],zoomIn: focus,});ipcRenderer.send(Constants.SIYUAN_SHOW, getCurrentWindow().id);diff --git a/app/src/constants.ts b/app/src/constants.tsindex 8afcb28077..260e75d66e 100644--- a/app/src/constants.ts+++ b/app/src/constants.ts@@ -69,6 +69,7 @@ export abstract class Constants {public static readonly CB_GET_UNUNDO = "cb-get-unundo"; // 不需要记录历史public static readonly CB_GET_SCROLL = "cb-get-scroll"; // 滚动到指定位置public static readonly CB_GET_CONTEXT = "cb-get-context"; // 包含上下文+ public static readonly CB_GET_ROOTSCROLL = "cb-get-rootscroll"; // 如果为 rootID 就滚动到指定位置public static readonly CB_GET_HTML = "cb-get-html"; // 直接渲染,不需要再 /api/block/getDocInfo,否则搜索表格无法定位public static readonly CB_GET_HISTORY = "cb-get-history"; // 历史渲染diff --git a/app/src/index.ts b/app/src/index.tsindex bc75f6c453..074a85b608 100644--- a/app/src/index.ts+++ b/app/src/index.ts@@ -190,7 +190,7 @@ window.openFileByURL = (openURL) => {openFileById({app: siyuanApp,id: getIdFromSYProtocol(openURL),- action: isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],zoomIn: isZoomIn});return true;diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.tsindex b00221d893..26cbebe8af 100644--- a/app/src/layout/Wnd.ts+++ b/app/src/layout/Wnd.ts@@ -474,7 +474,7 @@ export class Wnd {openFileById({app: this.app,id: keepCursorId,- action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]});}currentTab.headElement.removeAttribute("keep-cursor");diff --git a/app/src/layout/dock/Bookmark.ts b/app/src/layout/dock/Bookmark.tsindex a5a64802e7..1fdb8e3118 100644--- a/app/src/layout/dock/Bookmark.ts+++ b/app/src/layout/dock/Bookmark.ts@@ -89,7 +89,7 @@ export class Bookmark extends Model {openFileById({app,id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],zoomIn: foldResponse.data});});@@ -103,7 +103,7 @@ export class Bookmark extends Model {app,id: element.getAttribute("data-node-id"),keepCursor: true,- action: [Constants.CB_GET_CONTEXT]+ action: [Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]});},altClick(element: HTMLElement) {@@ -111,7 +111,7 @@ export class Bookmark extends Model {app,id: element.getAttribute("data-node-id"),position: "right",- action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]});},shiftClick(element: HTMLElement) {@@ -119,7 +119,7 @@ export class Bookmark extends Model {app,id: element.getAttribute("data-node-id"),position: "bottom",- action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]});},blockExtHTML: '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>',diff --git a/app/src/layout/dock/Graph.ts b/app/src/layout/dock/Graph.tsindex b601ea5221..10c5969378 100644--- a/app/src/layout/dock/Graph.ts+++ b/app/src/layout/dock/Graph.ts@@ -653,14 +653,14 @@ export class Graph extends Model {app: this.app,id: node.id,position: "bottom",- action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]});} else if (window.siyuan.altIsPressed) {openFileById({app: this.app,id: node.id,position: "right",- action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]});} else if (window.siyuan.ctrlIsPressed) {window.siyuan.blockPanels.push(new BlockPanel({@@ -674,7 +674,7 @@ export class Graph extends Model {openFileById({app: this.app,id: node.id,- action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]});}});diff --git a/app/src/layout/util.ts b/app/src/layout/util.tsindex 2ae5dd8d11..77dd610fa6 100644--- a/app/src/layout/util.ts+++ b/app/src/layout/util.ts@@ -435,7 +435,7 @@ export const JSONToLayout = (app: App, isStart: boolean) => {openFileById({app,id: idZoomIn.id,- action: idZoomIn.isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ 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});} else {diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.tsindex c0b7731e33..bbd82b0a93 100644--- a/app/src/menus/protyle.ts+++ b/app/src/menus/protyle.ts@@ -193,7 +193,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {openFileById({app: protyle.app,id: refBlockId,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],zoomIn: foldResponse.data});});@@ -207,7 +207,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {openFileById({app: protyle.app,id: refBlockId,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],keepCursor: true,zoomIn: foldResponse.data});@@ -224,7 +224,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {app: protyle.app,id: refBlockId,position: "right",- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],zoomIn: foldResponse.data});});@@ -240,7 +240,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {app: protyle.app,id: refBlockId,position: "bottom",- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],zoomIn: foldResponse.data});});diff --git a/app/src/mobile/dock/MobileBookmarks.ts b/app/src/mobile/dock/MobileBookmarks.tsindex 71d0830fc4..f95eb0356f 100644--- a/app/src/mobile/dock/MobileBookmarks.ts+++ b/app/src/mobile/dock/MobileBookmarks.ts@@ -39,7 +39,7 @@ export class MobileBookmarks {}}fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {- openMobileFileById(app, id, foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML]);+ openMobileFileById(app, id, foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);});},blockExtHTML: '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>',diff --git a/app/src/mobile/index.ts b/app/src/mobile/index.tsindex 63380459f6..07f7e09247 100644--- a/app/src/mobile/index.ts+++ b/app/src/mobile/index.ts@@ -130,7 +130,7 @@ window.hideKeyboardToolbar = hideKeyboardToolbar;window.openFileByURL = (openURL) => {if (openURL && isSYProtocol(openURL)) {openMobileFileById(siyuanApp, getIdFromSYProtocol(openURL),- getSearch("focus", openURL) === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);+ getSearch("focus", openURL) === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);return true;}return false;diff --git a/app/src/mobile/menu/search.ts b/app/src/mobile/menu/search.tsindex 809d337ce1..0c7976e66e 100644--- a/app/src/mobile/menu/search.ts+++ b/app/src/mobile/menu/search.ts@@ -560,7 +560,7 @@ const initSearchEvent = (app: App, element: Element, config: ISearchOption) => {preventScroll(window.siyuan.mobile.editor.protyle);}fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {- openMobileFileById(app, id, foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);+ openMobileFileById(app, id, foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);});closePanel();} else {diff --git a/app/src/mobile/util/initFramework.ts b/app/src/mobile/util/initFramework.tsindex f44c9e6c7e..3a92cd9216 100644--- a/app/src/mobile/util/initFramework.ts+++ b/app/src/mobile/util/initFramework.ts@@ -119,7 +119,7 @@ export const initFramework = (app: App) => {const idZoomIn = getIdZoomInByPath();if (idZoomIn.id) {openMobileFileById(app, idZoomIn.id,- idZoomIn.isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);+ idZoomIn.isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);return;}const localDoc = window.siyuan.storage[Constants.LOCAL_DOCINFO];@@ -129,7 +129,7 @@ export const initFramework = (app: App) => {} else {fetchPost("/api/block/getRecentUpdatedBlocks", {}, (response) => {if (response.data.length !== 0) {- openMobileFileById(app, response.data[0].id, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);+ openMobileFileById(app, response.data[0].id, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);} else {setEmpty(app);}diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.tsindex c2c0c67484..4113273dea 100644--- a/app/src/protyle/index.ts+++ b/app/src/protyle/index.ts@@ -216,50 +216,48 @@ export class Protyle {removeLoading(this.protyle);return;}- if (options.scrollAttr ||- mergedOptions.action.includes(Constants.CB_GET_CONTEXT) ||- (mergedOptions.action.includes(Constants.CB_GET_SCROLL) && this.protyle.options.mode !== "preview")) {- if (!options.scrollAttr) {- fetchPost("/api/block/getDocInfo", {- id: options.blockId- }, (response) => {- if (response.data.rootID !== options.blockId && mergedOptions.action.includes(Constants.CB_GET_CONTEXT)) {- // 搜索打开文档等情况需保持上一次历史 https://github.com/siyuan-note/siyuan/issues/9082- this.getDoc(mergedOptions);- return;+ if (options.scrollAttr) {+ getDocByScroll({+ protyle: this.protyle,+ scrollAttr: options.scrollAttr,+ mergedOptions,+ cb: () => {+ this.afterOnGet(mergedOptions);+ }+ });+ } else if (this.protyle.options.mode !== "preview" &&+ (mergedOptions.action.includes(Constants.CB_GET_SCROLL) || mergedOptions.action.includes(Constants.CB_GET_ROOTSCROLL))) {+ fetchPost("/api/block/getDocInfo", {+ id: options.blockId+ }, (response) => {+ if (!mergedOptions.action.includes(Constants.CB_GET_SCROLL) &&+ response.data.rootID !== options.blockId && mergedOptions.action.includes(Constants.CB_GET_ROOTSCROLL)) {+ // 打开根文档保持上一次历史,否则按照原有 action 执行 https://github.com/siyuan-note/siyuan/issues/9082+ this.getDoc(mergedOptions);+ return;+ }+ let scrollObj;+ if (response.data.ial.scroll) {+ try {+ scrollObj = JSON.parse(response.data.ial.scroll.replace(/"/g, '"'));+ } catch (e) {+ scrollObj = undefined;}- let scrollObj;- if (response.data.ial.scroll) {- try {- scrollObj = JSON.parse(response.data.ial.scroll.replace(/"/g, '"'));- } catch (e) {- scrollObj = undefined;+ }+ if (scrollObj) {+ scrollObj.rootId = response.data.rootID;+ getDocByScroll({+ protyle: this.protyle,+ scrollAttr: scrollObj,+ mergedOptions,+ cb: () => {+ this.afterOnGet(mergedOptions);}- }- if (scrollObj) {- scrollObj.rootId = response.data.rootID;- getDocByScroll({- protyle: this.protyle,- scrollAttr: scrollObj,- mergedOptions,- cb: () => {- this.afterOnGet(mergedOptions);- }- });- } else {- this.getDoc(mergedOptions);- }- });- } else {- getDocByScroll({- protyle: this.protyle,- scrollAttr: options.scrollAttr,- mergedOptions,- cb: () => {- this.afterOnGet(mergedOptions);- }- });- }+ });+ } else {+ this.getDoc(mergedOptions);+ }+ });} else {this.getDoc(mergedOptions);}diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.tsindex bb893db50d..16a1ff3b16 100644--- a/app/src/protyle/util/onGet.ts+++ b/app/src/protyle/util/onGet.ts@@ -259,6 +259,7 @@ const setHTML = (options: {}// 屏幕太高的页签 https://github.com/siyuan-note/siyuan/issues/5018if (!protyle.scroll.element.classList.contains("fn__none") &&+ !protyle.element.classList.contains("block__edit") && // 不能为浮窗,否则悬浮为根文档无法打开整个文档 https://github.com/siyuan-note/siyuan/issues/9082protyle.wysiwyg.element.lastElementChild.getAttribute("data-eof") !== "2" &&protyle.contentElement.scrollHeight > 0 && // 没有激活的页签 https://github.com/siyuan-note/siyuan/issues/5255!options.action.includes(Constants.CB_GET_FOCUSFIRST) && // 防止 eof 为true https://github.com/siyuan-note/siyuan/issues/5291diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.tsindex 4b63ac309b..bd28154250 100644--- a/app/src/protyle/wysiwyg/index.ts+++ b/app/src/protyle/wysiwyg/index.ts@@ -1699,7 +1699,7 @@ export class WYSIWYG {app: protyle.app,id: refBlockId,position: "bottom",- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],zoomIn: foldResponse.data});} else if (event.altKey) {@@ -1707,14 +1707,14 @@ export class WYSIWYG {app: protyle.app,id: refBlockId,position: "right",- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],zoomIn: foldResponse.data});} else if (ctrlIsPressed) {openFileById({app: protyle.app,id: refBlockId,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],keepCursor: true,zoomIn: foldResponse.data});@@ -1722,7 +1722,7 @@ export class WYSIWYG {openFileById({app: protyle.app,id: refBlockId,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],zoomIn: foldResponse.data});}diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.tsindex c574785693..2191f7236c 100644--- a/app/src/protyle/wysiwyg/keydown.ts+++ b/app/src/protyle/wysiwyg/keydown.ts@@ -1641,7 +1641,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {openFileById({app: protyle.app,id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],zoomIn: foldResponse.data});});@@ -1654,7 +1654,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {openFileById({app: protyle.app,id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],keepCursor: true,zoomIn: foldResponse.data});@@ -1668,7 +1668,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {app: protyle.app,id,position: "right",- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],zoomIn: foldResponse.data});});@@ -1681,7 +1681,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {app: protyle.app,id,position: "bottom",- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],zoomIn: foldResponse.data});});diff --git a/app/src/search/util.ts b/app/src/search/util.tsindex 4ee2d2545c..b0b3cbfd8e 100644--- a/app/src/search/util.ts+++ b/app/src/search/util.ts@@ -739,7 +739,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clolet isClick = event.detail === 1let isDblClick = event.detail === 2/// #if BROWSER- const newDate = new Date().getTime()+ const newDate = new Date().getTime()isClick = newDate - lastClickTime > Constants.TIMEOUT_DBLCLICKisDblClick = !isClick;lastClickTime = newDate;@@ -763,7 +763,8 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, cloopenFileById({app,id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] :+ (id === target.getAttribute("data-root-id") ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ROOTSCROLL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]),zoomIn: foldResponse.data,position: "right"});@@ -803,7 +804,8 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, cloopenFileById({app,id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] :+ (id === target.getAttribute("data-root-id") ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ROOTSCROLL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]),zoomIn: foldResponse.data});if (closeCB) {@@ -862,7 +864,8 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, cloapp,id,position: "right",- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] :+ (id === target.getAttribute("data-root-id") ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ROOTSCROLL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]),zoomIn: foldResponse.data});if (closeCB) {@@ -891,7 +894,8 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, cloopenFileById({app,id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] :+ (id === target.getAttribute("data-root-id") ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ROOTSCROLL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]),zoomIn: foldResponse.data});if (closeCB) {