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

Vanessad61fbd83c6a3
diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts
index b813c08fa6..a5f51740ac 100644
--- a/app/src/protyle/render/av/render.ts
+++ b/app/src/protyle/render/av/render.ts
@@ -546,18 +546,22 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
item.querySelector(".av__drag-fill")?.remove();
});
addDragFill(item.querySelector(".av__cell--select"));
- }
- if (operation.action === "setAttrViewBlockView") {
+ } else if (operation.action === "setAttrViewBlockView") {
const viewTabElement = item.querySelector(`.av__views > .layout-tab-bar > .item[data-id="${operation.id}"]`) as HTMLElement;
if (viewTabElement) {
item.dataset.pageSize = viewTabElement.dataset.page;
}
- }
- if (operation.action === "addAttrViewView") {
+ } else if (operation.action === "addAttrViewView") {
item.dataset.pageSize = "50";
- }
- if (operation.action === "removeAttrViewView") {
+ } else if (operation.action === "removeAttrViewView") {
item.dataset.pageSize = item.querySelector(`.av__views > .layout-tab-bar .item[data-id="${item.getAttribute(Constants.CUSTOM_SY_AV_VIEW)}"]`)?.getAttribute("data-page");
+ } else if (operation.action === "sortAttrViewView" && operation.data === "unRefresh") {
+ const viewTabElement = item.querySelector(`.av__views > .layout-tab-bar > .item[data-id="${operation.id}"]`) as HTMLElement;
+ if (viewTabElement && !operation.previousID && !viewTabElement.previousElementSibling) {
+ return;
+ } else if (viewTabElement && operation.previousID && viewTabElement.previousElementSibling?.getAttribute("data-id") === operation.previousID) {
+ return;
+ }
}
avRender(item, protyle, () => {
const attrElement = document.querySelector(`.b3-dialog--open[data-key="${Constants.DIALOG_ATTR}"] div[data-av-id="${avID}"]`) as HTMLElement;
diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts
index f5657ddb97..8bd7d4e6d1 100644
--- a/app/src/protyle/wysiwyg/transaction.ts
+++ b/app/src/protyle/wysiwyg/transaction.ts
@@ -856,7 +856,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
"duplicateAttrViewKey", "setAttrViewViewDesc", "setAttrViewCoverFrom", "setAttrViewCoverFromAssetKeyID",
"setAttrViewBlockView", "setAttrViewCardSize", "setAttrViewCardAspectRatio", "hideAttrViewName", "setAttrViewShowIcon",
"setAttrViewWrapField", "setAttrViewGroup"].includes(operation.action)) {
- if (!isUndo && operation.data !== "unRefresh") {
+ if (!isUndo) {
// 撤销 transaction 会进行推送,需使用推送来进行刷新最新数据 https://github.com/siyuan-note/siyuan/issues/13607
refreshAV(protyle, operation);
} else if (operation.action === "setAttrViewName") {