Skip to content

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

:bug: Keep restored attribute view rows redoable

Danielae0150a9b8f6
diff --git a/app/src/protyle/render/av/row.ts b/app/src/protyle/render/av/row.ts
index 814598c93a..ff9d6d3bdc 100644
--- a/app/src/protyle/render/av/row.ts
+++ b/app/src/protyle/render/av/row.ts
@@ -742,12 +742,15 @@ export const deleteRow = (blockElement: HTMLElement, protyle: IProtyle) => {
});
rowElements.forEach(item => {
const blockValue = genCellValueByElement("block", item.querySelector('.av__cell[data-dtype="block"]'));
+ const itemID = Lute.NewNodeID();
+ // 撤销会使用新的条目 ID 恢复该行,重做时需要同时删除这个新条目。
+ blockIds.push(itemID);
undoOperations.push({
action: "insertAttrViewBlock",
avID,
previousID: item.previousElementSibling?.getAttribute("data-id") || "",
srcs: [{
- itemID: Lute.NewNodeID(),
+ itemID,
id: item.getAttribute("data-id"),
isDetached: blockValue.isDetached,
content: blockValue.block.content