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

Vanessa20c55f50a6bb
diff --git a/app/src/protyle/util/blockFold.ts b/app/src/protyle/util/blockFold.ts
index 15df8f6239..2bdcaa1701 100644
--- a/app/src/protyle/util/blockFold.ts
+++ b/app/src/protyle/util/blockFold.ts
@@ -151,7 +151,10 @@ export const foldBlocksRecursively = (protyle: IProtyle, nodeElements: Element[]
}
// Determine target state: if any block is unfolded, we fold all. Otherwise we expand all.
- const isFoldAll = elementsToFold.some(element => element.getAttribute("fold") !== "1");
+ let isFoldAll = elementsToFold.some(item => item.getAttribute("fold") !== "1");
+ if (isFoldAll && nodeElements.length === 1 && nodeElements[0].getAttribute("fold") === "1") {
+ isFoldAll = false;
+ }
elementsToFold.sort((a, b) => {
const position = a.compareDocumentPosition(b);
if (position & Node.DOCUMENT_POSITION_FOLLOWING) {