Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/8372

Vanessaf5135faf294d
diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.ts
index b1cd9c600d..447ce2fb96 100644
--- a/app/src/layout/dock/Outline.ts
+++ b/app/src/layout/dock/Outline.ts
@@ -4,7 +4,7 @@ import {Tree} from "../../util/Tree";
import {getDockByType, setPanelFocus} from "../util";
import {fetchPost} from "../../util/fetch";
import {getAllModels} from "../getAll";
-import {hasClosestByClassName} from "../../protyle/util/hasClosest";
+import {hasClosestBlock, hasClosestByClassName} from "../../protyle/util/hasClosest";
import {updateHotkeyTip} from "../../protyle/util/compatibility";
import {openFileById} from "../../editor/util";
import {Constants} from "../../constants";
@@ -217,6 +217,13 @@ export class Outline extends Model {
id: this.blockId,
}, response => {
this.update(response);
+ // https://github.com/siyuan-note/siyuan/issues/8372
+ if (getSelection().rangeCount > 0) {
+ const blockElement = hasClosestBlock(getSelection().getRangeAt(0).startContainer);
+ if (blockElement && blockElement.getAttribute("data-type") === "NodeHeading") {
+ this.setCurrent(blockElement)
+ }
+ }
});
}
}