Skip to content

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

:art: fix https://github.com/siyuan-note/siyuan/issues/10443

Vanessa445108525f8c
diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.ts
index 4aaa3479c4..0602e3d597 100644
--- a/app/src/protyle/render/av/openMenuPanel.ts
+++ b/app/src/protyle/render/av/openMenuPanel.ts
@@ -694,6 +694,7 @@ export const openMenuPanel = (options: {
avID,
id
}]);
+ options.blockElement.setAttribute("custom-sy-av-view", id)
avPanelElement.remove();
event.preventDefault();
event.stopPropagation();
diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts
index 1e05a68619..c52d5eca9a 100644
--- a/app/src/protyle/render/av/render.ts
+++ b/app/src/protyle/render/av/render.ts
@@ -54,8 +54,6 @@ export const avRender = (element: Element, protyle: IProtyle, cb?: () => void, v
newViewID = viewID;
fetchPost("/api/av/setDatabaseBlockView", {id: e.dataset.nodeId, viewID});
e.setAttribute("custom-sy-av-view", newViewID);
- } else if (typeof viewID === "undefined") {
- newViewID = e.querySelector(".av__header .item--focus")?.getAttribute("data-id");
}
fetchPost(created ? "/api/av/renderHistoryAttributeView" : (snapshot ? "/api/av/renderSnapshotAttributeView" : "/api/av/renderAttributeView"), {
id: e.getAttribute("data-av-id"),
@@ -309,8 +307,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
// 更新属性面板
renderAVAttribute(attrElement.parentElement, attrElement.dataset.nodeId, protyle);
}
- }, ["addAttrViewView", "duplicateAttrViewView"].includes(operation.action) ? operation.id :
- (operation.action === "removeAttrViewView" ? null : undefined));
+ });
});
}
}, ["insertAttrViewBlock"].includes(operation.action) ? 2 : 100);
diff --git a/app/src/protyle/render/av/view.ts b/app/src/protyle/render/av/view.ts
index d02dace98d..b76f1f32f4 100644
--- a/app/src/protyle/render/av/view.ts
+++ b/app/src/protyle/render/av/view.ts
@@ -54,6 +54,7 @@ export const openViewMenu = (options: { protyle: IProtyle, blockElement: HTMLEle
avID: options.blockElement.dataset.avId,
id
}]);
+ options.blockElement.setAttribute("custom-sy-av-view", id)
}
});
menu.addItem({
@@ -204,4 +205,5 @@ export const addView = (protyle: IProtyle, blockElement: Element) => {
avID,
id
}]);
+ blockElement.setAttribute("custom-sy-av-view", id);
};