An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: fix https://github.com/siyuan-note/siyuan/issues/10365
Vanessac9b2db881857
diff --git a/app/src/constants.ts b/app/src/constants.tsindex 042e84e5d2..c0ec946ca5 100644--- a/app/src/constants.ts+++ b/app/src/constants.ts@@ -105,6 +105,7 @@ export abstract class Constants {public static readonly LOCAL_FILEPOSITION = "local-fileposition";public static readonly LOCAL_DIALOGPOSITION = "local-dialogposition";public static readonly LOCAL_SESSION_FIRSTLOAD = "local-session-firstload";+ public static readonly LOCAL_OUTLINE = "local-outline";// dialogpublic static readonly DIALOG_OPENCARD = "dialog-opencard";diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.tsindex 533ffac5ac..6da086dacf 100644--- a/app/src/layout/dock/Outline.ts+++ b/app/src/layout/dock/Outline.ts@@ -6,7 +6,7 @@ import {getDockByType} from "../tabUtil";import {fetchPost} from "../../util/fetch";import {getAllModels} from "../getAll";import {hasClosestBlock, hasClosestByClassName, hasTopClosestByClassName} from "../../protyle/util/hasClosest";-import {updateHotkeyTip} from "../../protyle/util/compatibility";+import {setStorageVal, updateHotkeyTip} from "../../protyle/util/compatibility";import {openFileById} from "../../editor/util";import {Constants} from "../../constants";import {escapeHtml} from "../../util/escape";@@ -87,7 +87,7 @@ export class Outline extends Model {<svg class="block__logoicon"><use xlink:href="#iconAlignCenter"></use></svg>${window.siyuan.languages.outline}</div><span class="fn__flex-1 fn__space"></span>- <span data-type="expand" class="block__icon b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.stickOpen} ${updateHotkeyTip(window.siyuan.config.keymap.editor.general.expand.custom)}">+ <span data-type="expand" class="block__icon b3-tooltips b3-tooltips__sw${window.siyuan.storage[Constants.LOCAL_OUTLINE].keepExpand ? " block__icon--active" : ""}" aria-label="${window.siyuan.languages.stickOpen} ${updateHotkeyTip(window.siyuan.config.keymap.editor.general.expand.custom)}"><svg><use xlink:href="#iconExpand"></use></svg></span><span class="fn__space"></span>@@ -155,9 +155,13 @@ export class Outline extends Model {}if (iconElement.classList.contains("block__icon--active")) {iconElement.classList.remove("block__icon--active");+ window.siyuan.storage[Constants.LOCAL_OUTLINE].keepExpand = false;} else {iconElement.classList.add("block__icon--active");+ window.siyuan.storage[Constants.LOCAL_OUTLINE].keepExpand = true;}++ setStorageVal(Constants.LOCAL_OUTLINE, window.siyuan.storage[Constants.LOCAL_OUTLINE]);this.tree.expandAll();});options.tab.panelElement.addEventListener("click", (event: MouseEvent & { target: HTMLElement }) => {diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.tsindex 7aea95db6d..81fc9ebbe1 100644--- a/app/src/protyle/util/compatibility.ts+++ b/app/src/protyle/util/compatibility.ts@@ -187,6 +187,7 @@ export const getLocalStorage = (cb: () => void) => {defaultStorage[Constants.LOCAL_LAYOUTS] = []; // {name: "", layout:{}}defaultStorage[Constants.LOCAL_AI] = []; // {name: "", memo: ""}defaultStorage[Constants.LOCAL_PLUGINTOPUNPIN] = [];+ defaultStorage[Constants.LOCAL_OUTLINE] = {keepExpand: true};defaultStorage[Constants.LOCAL_FILEPOSITION] = {}; // {id: IScrollAttr}defaultStorage[Constants.LOCAL_DIALOGPOSITION] = {}; // {id: IPosition}defaultStorage[Constants.LOCAL_FLASHCARD] = {@@ -250,7 +251,7 @@ export const getLocalStorage = (cb: () => void) => {Constants.LOCAL_EXPORTWORD, Constants.LOCAL_EXPORTPDF, Constants.LOCAL_DOCINFO, Constants.LOCAL_FONTSTYLES,Constants.LOCAL_SEARCHDATA, Constants.LOCAL_ZOOM, Constants.LOCAL_LAYOUTS, Constants.LOCAL_AI,Constants.LOCAL_PLUGINTOPUNPIN, Constants.LOCAL_SEARCHASSET, Constants.LOCAL_FLASHCARD, Constants.LOCAL_DIALOGPOSITION,- Constants.LOCAL_FILEPOSITION].forEach((key) => {+ Constants.LOCAL_OUTLINE, Constants.LOCAL_FILEPOSITION].forEach((key) => {if (typeof response.data[key] === "string") {try {const parseData = JSON.parse(response.data[key]);