Skip to content

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

:art:

Vanessaad24ee931965
diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.ts
index 15a2c8c950..53b45bc00a 100644
--- a/app/src/layout/dock/Outline.ts
+++ b/app/src/layout/dock/Outline.ts
@@ -152,7 +152,6 @@ export class Outline extends Model {
fetchPost("/api/outline/getDocOutline", {
id: this.blockId,
}, response => {
- this.updateDocTitle();
this.update(response);
});
diff --git a/app/src/layout/dock/index.ts b/app/src/layout/dock/index.ts
index 388f204678..9f412055b4 100644
--- a/app/src/layout/dock/index.ts
+++ b/app/src/layout/dock/index.ts
@@ -12,6 +12,7 @@ import {Backlinks} from "./Backlinks";
import {Model} from "../Model";
import {getDockByType, resizeTabs, setPanelFocus} from "../util";
import {Inbox} from "./Inbox";
+import Protyle from "../../protyle";
export class Dock {
public element: HTMLElement;
@@ -127,11 +128,11 @@ export class Dock {
});
target.classList.add("dock__item--active");
if (!target.getAttribute("data-id")) {
- let editId = "";
+ let editor: Protyle;
const models = getAllModels();
models.editor.find((item) => {
if (item.parent.headElement.classList.contains("item--focus") && item.editor?.protyle?.path) {
- editId = item.editor.protyle.block.rootID;
+ editor = item.editor;
return true;
}
});
@@ -161,11 +162,15 @@ export class Dock {
case "outline":
tab = new Tab({
callback(tab: Tab) {
- tab.addModel(new Outline({
+ const outline = new Outline({
type: "pin",
tab,
- blockId: editId,
- }));
+ blockId: editor?.protyle?.block?.rootID,
+ });
+ if (editor?.protyle?.title?.editElement) {
+ outline.updateDocTitle(editor.protyle.title.editElement.textContent);
+ }
+ tab.addModel(outline);
}
});
break;
@@ -174,7 +179,7 @@ export class Dock {
callback(tab: Tab) {
tab.addModel(new Graph({
tab,
- blockId: editId,
+ blockId: editor?.protyle?.block?.rootID,
type: "pin"
}));
}
@@ -196,7 +201,7 @@ export class Dock {
tab.addModel(new Backlinks({
type: "pin",
tab,
- blockId: editId,
+ blockId: editor?.protyle?.block?.rootID,
}));
}
});