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

Vanessa04fc8cfa9790
diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts
index c83d73b265..1e9e3678e3 100644
--- a/app/src/protyle/render/av/render.ts
+++ b/app/src/protyle/render/av/render.ts
@@ -782,7 +782,8 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
popCellElement = popCellElements[0] as HTMLElement;
}
}
- if (popCellElement && popCellElement.getAttribute("data-detached") === "true") {
+ if (popCellElement && popCellElement.getAttribute("data-detached") === "true" &&
+ popCellElement.querySelector(".av__celltext").textContent === "") {
popTextCell(protyle, [popCellElement], "block");
}
}
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index 5b780cbba8..94f2014c14 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -864,9 +864,10 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
"duplicateAttrViewKey", "setAttrViewViewDesc", "setAttrViewCoverFrom", "setAttrViewCoverFromAssetKeyID",
"setAttrViewBlockView", "setAttrViewCardSize", "setAttrViewCardAspectRatio", "hideAttrViewName", "setAttrViewShowIcon",
"setAttrViewWrapField", "setAttrViewGroup", "removeAttrViewGroup", "hideAttrViewGroup", "sortAttrViewGroup",
- "foldAttrViewGroup", "hideAttrViewAllGroups", "setAttrViewFitImage", "setAttrViewDisplayFieldName"].includes(operation.action)) {
+ "foldAttrViewGroup", "hideAttrViewAllGroups", "setAttrViewFitImage", "setAttrViewDisplayFieldName",
+ "insertAttrViewBlock"].includes(operation.action)) {
+ // 撤销 transaction 会进行推送,需使用推送来进行刷新最新数据 https://github.com/siyuan-note/siyuan/issues/13607
if (!isUndo) {
- // 撤销 transaction 会进行推送,需使用推送来进行刷新最新数据 https://github.com/siyuan-note/siyuan/issues/13607
refreshAV(protyle, operation);
} else if (operation.action === "setAttrViewName") {
// setAttrViewName 同文档不会推送,需手动刷新
@@ -1327,8 +1328,6 @@ export const transaction = (protyle: IProtyle, doOperations: IOperation[], undoO
blockRender(protyle, item);
}
});
- } else if (operation.action === "insertAttrViewBlock") {
- refreshAV(protyle, operation);
}
});
});