An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:recycle: context
Vanessa65821e57de0d
diff --git a/app/src/constants.ts b/app/src/constants.tsindex f8f41d194b..76d1848ecf 100644--- a/app/src/constants.ts+++ b/app/src/constants.ts@@ -51,6 +51,7 @@ export abstract class Constants {public static readonly CB_GET_ALL = "cb-get-all"; // 获取所有块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"; // 包含上下文// localstoragepublic static readonly LOCAL_SEARCHEDATA = "local-searchedata";diff --git a/app/src/editor/util.ts b/app/src/editor/util.tsindex 7764ec1ef1..04de8055c0 100644--- a/app/src/editor/util.ts+++ b/app/src/editor/util.ts@@ -198,7 +198,7 @@ const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IModif ((!nodeElement || nodeElement?.clientHeight === 0) && options.id !== options.rootID) {fetchPost("/api/filetree/getDoc", {id: options.id,- mode: (options.action && !options.action.includes(Constants.CB_GET_ALL)) ? 3 : 0,+ mode: (options.action && options.action.includes(Constants.CB_GET_CONTEXT)) ? 3 : 0,size: Constants.SIZE_GET,}, getResponse => {onGet(getResponse, editor.editor.protyle, options.action);diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.tsindex 6ba753ea2f..eeb7632619 100644--- a/app/src/layout/Wnd.ts+++ b/app/src/layout/Wnd.ts@@ -334,7 +334,7 @@ export class Wnd {} else {openFileById({id: keepCursorId,- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});}currentTab.headElement.removeAttribute("keep-cursor");diff --git a/app/src/layout/dock/Backlinks.ts b/app/src/layout/dock/Backlinks.tsindex d7096412b8..65fc6da68b 100644--- a/app/src/layout/dock/Backlinks.ts+++ b/app/src/layout/dock/Backlinks.ts@@ -137,27 +137,28 @@ export class Backlinks extends Model {click(element: HTMLElement) {openFileById({id: element.getAttribute("data-node-id"),- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});},ctrlClick(element: HTMLElement) {openFileById({id: element.getAttribute("data-node-id"),keepCursor: true,+ action: [Constants.CB_GET_CONTEXT]});},altClick(element: HTMLElement) {openFileById({id: element.getAttribute("data-node-id"),position: "right",- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});},shiftClick(element: HTMLElement) {openFileById({id: element.getAttribute("data-node-id"),position: "bottom",- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});}});@@ -187,7 +188,7 @@ export class Backlinks extends Model {} else {openFileById({id: element.getAttribute("data-node-id"),- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});}},@@ -195,20 +196,21 @@ export class Backlinks extends Model {openFileById({id: element.getAttribute("data-node-id"),keepCursor: true,+ action: [Constants.CB_GET_CONTEXT]});},altClick(element: HTMLElement) {openFileById({id: element.getAttribute("data-node-id"),position: "right",- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});},shiftClick(element: HTMLElement) {openFileById({id: element.getAttribute("data-node-id"),position: "bottom",- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});},blockExtHTML: `<span class="b3-list-item__action b3-tooltips b3-tooltips__nw" aria-label="${window.siyuan.languages.more}"><svg><use xlink:href="#iconMore"></use></svg></span>`diff --git a/app/src/layout/dock/Bookmark.ts b/app/src/layout/dock/Bookmark.tsindex 06917c4b64..59b6fa3b54 100644--- a/app/src/layout/dock/Bookmark.ts+++ b/app/src/layout/dock/Bookmark.ts@@ -80,7 +80,7 @@ export class Bookmark extends Model {fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {openFileById({id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],});});},@@ -152,20 +152,21 @@ export class Bookmark extends Model {openFileById({id: element.getAttribute("data-node-id"),keepCursor: true,+ action: [Constants.CB_GET_CONTEXT]});},altClick(element: HTMLElement) {openFileById({id: element.getAttribute("data-node-id"),position: "right",- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});},shiftClick(element: HTMLElement) {openFileById({id: element.getAttribute("data-node-id"),position: "bottom",- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});}});diff --git a/app/src/layout/dock/Graph.ts b/app/src/layout/dock/Graph.tsindex 49edc6f7ee..e60e7895ec 100644--- a/app/src/layout/dock/Graph.ts+++ b/app/src/layout/dock/Graph.ts@@ -598,13 +598,13 @@ export class Graph extends Model {openFileById({id: node.id,position: "bottom",- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});} else if (window.siyuan.altIsPressed) {openFileById({id: node.id,position: "right",- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});} else if (window.siyuan.ctrlIsPressed) {window.siyuan.blockPanels.push(new BlockPanel({@@ -612,7 +612,7 @@ export class Graph extends Model {nodeIds: [node.id],}));} else {- openFileById({id: node.id, action: [Constants.CB_GET_FOCUS]});+ openFileById({id: node.id, action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});}});}, 1000);diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.tsindex 5a2ddcd9d9..1b25fc570b 100644--- a/app/src/layout/dock/Outline.ts+++ b/app/src/layout/dock/Outline.ts@@ -96,7 +96,7 @@ export class Outline extends Model {fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {openFileById({id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT],});});}diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.tsindex 1d9e61d942..fa45821e37 100644--- a/app/src/menus/protyle.ts+++ b/app/src/menus/protyle.ts@@ -89,7 +89,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {fetchPost("/api/block/checkBlockFold", {id: refBlockId}, (foldResponse) => {openFileById({id: refBlockId,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT],keepCursor: true,zoomIn: foldResponse.data});@@ -105,7 +105,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {openFileById({id: refBlockId,position: "right",- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],zoomIn: foldResponse.data});});@@ -120,7 +120,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {openFileById({id: refBlockId,position: "bottom",- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],zoomIn: foldResponse.data});});@@ -354,7 +354,7 @@ export const zoomOut = (protyle: IProtyle, id: string, focusId?: string, isPushBif (window.siyuan.mobileEditor) {window.localStorage.setItem(Constants.LOCAL_DOCINFO, JSON.stringify({id,- action: id === protyle.block.rootID ? [Constants.CB_GET_HL] : [Constants.CB_GET_ALL]+ action: id === protyle.block.rootID ? [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT] : [Constants.CB_GET_ALL]}));window.siyuan.backStack.push({id: protyle.block.id,diff --git a/app/src/mobile/editor.ts b/app/src/mobile/editor.tsindex ad7a349eb2..78a54f141c 100644--- a/app/src/mobile/editor.ts+++ b/app/src/mobile/editor.ts@@ -53,7 +53,7 @@ export const openMobileFileById = (id: string, action = [Constants.CB_GET_HL], pfetchPost("/api/filetree/getDoc", {id,size: action.includes(Constants.CB_GET_ALL) ? Constants.SIZE_GET_MAX : Constants.SIZE_GET,- mode: !action.includes(Constants.CB_GET_ALL) ? 3 : 0,+ mode: action.includes(Constants.CB_GET_CONTEXT) ? 3 : 0,}, getResponse => {onGet(getResponse, window.siyuan.mobileEditor.protyle, action);window.siyuan.mobileEditor.protyle.breadcrumb.render(window.siyuan.mobileEditor.protyle);diff --git a/app/src/mobile/util/MobileBacklinks.ts b/app/src/mobile/util/MobileBacklinks.tsindex 0da41ac31f..e8fcc490c3 100644--- a/app/src/mobile/util/MobileBacklinks.ts+++ b/app/src/mobile/util/MobileBacklinks.ts@@ -46,7 +46,7 @@ export class MobileBacklinks {element: this.element.querySelector(".backlinkList") as HTMLElement,data: null,click(element: HTMLElement) {- openMobileFileById(element.getAttribute("data-node-id"), [Constants.CB_GET_FOCUS]);+ openMobileFileById(element.getAttribute("data-node-id"), [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);}});this.mTree = new Tree({@@ -73,7 +73,7 @@ export class MobileBacklinks {}).element);window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY});} else {- openMobileFileById(element.getAttribute("data-node-id"), [Constants.CB_GET_FOCUS]);+ openMobileFileById(element.getAttribute("data-node-id"), [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);}},blockExtHTML: '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>'diff --git a/app/src/mobile/util/MobileBookmarks.ts b/app/src/mobile/util/MobileBookmarks.tsindex c557cdb221..c4ff716be8 100644--- a/app/src/mobile/util/MobileBookmarks.ts+++ b/app/src/mobile/util/MobileBookmarks.ts@@ -83,7 +83,7 @@ export class MobileBookmarks {});}} else {- openMobileFileById(id, [Constants.CB_GET_FOCUS]);+ openMobileFileById(id, [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);}},blockExtHTML: '<span class="b3-list-item__action" data-type="remove"><svg><use xlink:href="#iconTrashcan"></use></svg></span>',diff --git a/app/src/mobile/util/MobileOutline.ts b/app/src/mobile/util/MobileOutline.tsindex 39c4f5d01e..0a1b7c3462 100644--- a/app/src/mobile/util/MobileOutline.ts+++ b/app/src/mobile/util/MobileOutline.ts@@ -29,7 +29,7 @@ export class MobileOutline {click: (element: HTMLElement) => {const id = element.getAttribute("data-node-id");fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {- openMobileFileById(id,foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID]);+ openMobileFileById(id, foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT]);});}});diff --git a/app/src/mobile/util/initFramework.ts b/app/src/mobile/util/initFramework.tsindex 9b7e2993d9..bef39f8885 100644--- a/app/src/mobile/util/initFramework.ts+++ b/app/src/mobile/util/initFramework.ts@@ -118,7 +118,7 @@ export const initFramework = () => {} else {fetchPost("/api/block/getRecentUpdatedBlocks", {}, (response) => {if (response.data.length !== 0) {- openMobileFileById(response.data[0].id);+ openMobileFileById(response.data[0].id, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);} else {setEmpty();}diff --git a/app/src/mobile/util/search.ts b/app/src/mobile/util/search.tsindex febe4b4d77..d0bb5266b7 100644--- a/app/src/mobile/util/search.ts+++ b/app/src/mobile/util/search.ts@@ -80,7 +80,7 @@ export const popSearch = (modelElement: HTMLElement, modelMainElement: HTMLElemepreventScroll(window.siyuan.mobileEditor.protyle);}fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {- openMobileFileById(id,foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL]);+ openMobileFileById(id,foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);});closePanel();event.preventDefault();diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.tsindex aa0acb8202..1fed739bfe 100644--- a/app/src/protyle/hint/index.ts+++ b/app/src/protyle/hint/index.ts@@ -506,11 +506,11 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;}, () => {insertHTML(genEmptyBlock(false, false, `<span data-type="block-ref" data-id="${newSubDocId}" data-subtype="d">Untitled</span>`), protyle);/// #if MOBILE- openMobileFileById(newSubDocId);+ openMobileFileById(newSubDocId, [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);/// #elseopenFileById({id: newSubDocId,- action: [Constants.CB_GET_HL]+ action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]});/// #endif});diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.tsindex 77a3abf68f..a4a73ba8f8 100644--- a/app/src/protyle/index.ts+++ b/app/src/protyle/index.ts@@ -157,7 +157,7 @@ class Protyle {fetchPost("/api/filetree/getDoc", {id: options.blockId,k: options.key || "",- mode: (options.action && !options.action.includes(Constants.CB_GET_ALL)) ? 3 : 0, // 0: 仅当前 ID(默认值),1:向上 2:向下,3:上下都加载,4:加载最后+ mode: (options.action && options.action.includes(Constants.CB_GET_CONTEXT)) ? 3 : 0, // 0: 仅当前 ID(默认值),1:向上 2:向下,3:上下都加载,4:加载最后size: options.action?.includes(Constants.CB_GET_ALL) ? Constants.SIZE_GET_MAX : Constants.SIZE_GET,}, getResponse => {onGet(getResponse, this.protyle, options.action);diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.tsindex 9cf2f5d9b3..d5a460f75c 100644--- a/app/src/protyle/wysiwyg/index.ts+++ b/app/src/protyle/wysiwyg/index.ts@@ -1357,33 +1357,33 @@ export class WYSIWYG {fetchPost("/api/block/checkBlockFold", {id: refBlockId}, (foldResponse) => {/// #if MOBILE- openMobileFileById(refBlockId, foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL]);+ openMobileFileById(refBlockId, foldResponse.data ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);/// #elseif (window.siyuan.shiftIsPressed) {openFileById({id: refBlockId,position: "bottom",- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],zoomIn: foldResponse.data});} else if (window.siyuan.altIsPressed) {openFileById({id: refBlockId,position: "right",- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],zoomIn: foldResponse.data});} else if (window.siyuan.ctrlIsPressed) {openFileById({id: refBlockId,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT],keepCursor: true,zoomIn: foldResponse.data});} else {openFileById({id: refBlockId,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],zoomIn: foldResponse.data});}diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.tsindex b1bdd58883..1304332256 100644--- a/app/src/protyle/wysiwyg/keydown.ts+++ b/app/src/protyle/wysiwyg/keydown.ts@@ -1533,6 +1533,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {openFileById({id,keepCursor: true,+ action: [Constants.CB_GET_CONTEXT]});event.preventDefault();event.stopPropagation();@@ -1541,7 +1542,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {openFileById({id,position: "right",- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});event.preventDefault();event.stopPropagation();@@ -1550,7 +1551,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {openFileById({id,position: "bottom",- action: [Constants.CB_GET_FOCUS]+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]});event.preventDefault();event.stopPropagation();diff --git a/app/src/search/index.ts b/app/src/search/index.tsindex 8f66e9256e..45e6e7a030 100644--- a/app/src/search/index.ts+++ b/app/src/search/index.ts@@ -116,7 +116,7 @@ export class Search extends Model {fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {openFileById({id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],zoomIn: foldResponse.data,position: "right",});@@ -135,7 +135,7 @@ export class Search extends Model {fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {openFileById({id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],zoomIn: foldResponse.data});});@@ -196,7 +196,7 @@ export class Search extends Model {} else {this.protyle = new Protyle(this.element.querySelector("#searchPreview") as HTMLElement, {blockId: id,- action: foldResponse.data ? [Constants.CB_GET_HL, Constants.CB_GET_ALL] : [Constants.CB_GET_HL],+ action: foldResponse.data ? [Constants.CB_GET_HL, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT],key: value,render: {gutter: true,diff --git a/app/src/search/spread.ts b/app/src/search/spread.tsindex 71c5f2a65f..eea5048289 100644--- a/app/src/search/spread.ts+++ b/app/src/search/spread.ts@@ -468,7 +468,7 @@ export const openSearch = async (hotkey: string, key?: string, notebookId?: strifetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {openFileById({id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],zoomIn: foldResponse.data});dialog.destroy();@@ -591,7 +591,7 @@ export const openSearch = async (hotkey: string, key?: string, notebookId?: strifetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {openFileById({id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],zoomIn: foldResponse.data,position: "right"});@@ -614,7 +614,7 @@ export const openSearch = async (hotkey: string, key?: string, notebookId?: strifetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {openFileById({id,- action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS],+ action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],zoomIn: foldResponse.data});dialog.destroy();@@ -643,7 +643,7 @@ const getArticle = (options: {if (!protyle) {protyle = new Protyle(options.dialog.element.querySelector("#searchPreview") as HTMLElement, {blockId: options.id,- action: foldResponse.data ? [Constants.CB_GET_HL, Constants.CB_GET_ALL] : [Constants.CB_GET_HL],+ action: foldResponse.data ? [Constants.CB_GET_HL, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT],key: options.k,render: {gutter: true,diff --git a/app/src/util/newFile.ts b/app/src/util/newFile.tsindex 1be551c513..44b41f4f3b 100644--- a/app/src/util/newFile.ts+++ b/app/src/util/newFile.ts@@ -67,7 +67,7 @@ export const newFile = (notebookId?: string, currentPath?: string, open?: boolea}, () => {/// #if !MOBILEif (open) {- openFileById({id, action: [Constants.CB_GET_HL]});+ openFileById({id, action: [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]});}/// #endif});diff --git a/app/src/util/onGetConfig.ts b/app/src/util/onGetConfig.tsindex f05e962cce..e68cd775de 100644--- a/app/src/util/onGetConfig.ts+++ b/app/src/util/onGetConfig.ts@@ -342,7 +342,7 @@ const initWindow = () => {}openFileById({id: url.substr(16, 22),- action: [Constants.CB_GET_FOCUS],+ action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],zoomIn: getSearch("focus", url) === "1"});});