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

Vanessa5e2910a4e60d
diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts
index 2676089a66..74bc8d98f6 100644
--- a/app/src/protyle/render/av/render.ts
+++ b/app/src/protyle/render/av/render.ts
@@ -233,6 +233,17 @@ ${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;
let lastParentID: string;
let lastElement: HTMLElement;
export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
+ if (operation.action === "setAttrViewName") {
+ Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.id}"]`)).forEach((item: HTMLElement) => {
+ const titleElement = item.querySelector(".av__title") as HTMLElement;
+ if (!titleElement) {
+ return;
+ }
+ titleElement.textContent = operation.data;
+ titleElement.dataset.title = operation.data;
+ item.querySelector(".layout-tab-bar .item__text").textContent = operation.data;
+ });
+ }
if (lastParentID === operation.parentID && protyle.contentElement.isSameNode(lastElement)) {
return;
}
@@ -249,16 +260,6 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
(rowItem.querySelector(`[data-col-id="${operation.id}"]`) as HTMLElement).style.width = operation.data;
});
});
- } else if (operation.action === "setAttrViewName") {
- Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.id}"]`)).forEach((item: HTMLElement) => {
- const titleElement = item.querySelector(".av__title") as HTMLElement;
- if (!titleElement) {
- return;
- }
- titleElement.textContent = operation.data;
- titleElement.dataset.title = operation.data;
- item.querySelector(".layout-tab-bar .item__text").textContent = operation.data;
- });
} else {
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${avId}"]`)).forEach((item: HTMLElement) => {
item.removeAttribute("data-render");