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/16206

Vanessa0e334d1ca0e9
diff --git a/app/src/layout/dock/Outline.ts b/app/src/layout/dock/Outline.ts
index afd7e11968..5cb3e76c25 100644
--- a/app/src/layout/dock/Outline.ts
+++ b/app/src/layout/dock/Outline.ts
@@ -636,22 +636,10 @@ export class Outline extends Model {
});
this.element.scrollTop = scrollTop;
} else if (this.blockId) {
- fetchPost("/api/storage/getOutlineStorage", {
- docID: this.blockId
- }, storageResponse => {
- const storageData = storageResponse.data;
- if (storageData && storageData.expandIds) {
- if (storageData.expandIds.length === 0) {
- this.tree.collapseAll();
- } else {
- this.tree.setExpandIds(storageData.expandIds);
- }
- }
- if ((this.headerElement.querySelector("input.b3-text-field.search__label") as HTMLInputElement).value) {
- this.setFilter();
- }
- this.element.scrollTop = scrollTop;
- });
+ if ((this.headerElement.querySelector("input.b3-text-field.search__label") as HTMLInputElement).value) {
+ this.setFilter();
+ }
+ this.element.scrollTop = scrollTop;
}
if (currentId) {
currentElement = this.element.querySelector(`[data-node-id="${currentId}"]`);
diff --git a/app/src/util/Tree.ts b/app/src/util/Tree.ts
index 0e1927edf5..a52fa928f5 100644
--- a/app/src/util/Tree.ts
+++ b/app/src/util/Tree.ts
@@ -116,6 +116,7 @@ ${item.label ? "data-label='" + item.label + "'" : ""}>
data.forEach((item: IBlock & {
subType: string;
count: string;
+ folded?: boolean
ial?: {
icon: string
}
@@ -152,7 +153,7 @@ data-subtype="${item.subType}"
data-treetype="${type}"
data-def-path="${item.defPath}">
<span style="${style}" class="b3-list-item__toggle${item.children ? " b3-list-item__toggle--hl" : ""}${item.children ? "" : " fn__hidden"}">
- <svg data-id="${item.id}" class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg>
+ <svg data-id="${item.id}" class="b3-list-item__arrow${(type === "outline" && !item.folded) ? " b3-list-item__arrow--open" : ""}"><use xlink:href="#iconRight"></use></svg>
</span>
${iconHTML}
<span class="b3-list-item__text ariaLabel" data-position="parentE" ${type === "outline" ? ' aria-label="' + escapeAriaLabel(Lute.BlockDOM2Content(item.content)) + '"' : ""}>${item.content}</span>
@@ -160,7 +161,7 @@ data-def-path="${item.defPath}">
${this.blockExtHTML || ""}
</li>`;
if (item.children && item.children.length > 0) {
- html += this.genBlockHTML(item.children, false, type) + "</ul>";
+ html += this.genBlockHTML(item.children, (type === "outline" && !item.folded) ? true : false, type) + "</ul>";
}
});
return html;