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

Vanessaf95084e96a3c
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts
index f0bee3e753..190e9c126d 100644
--- a/app/src/protyle/render/av/action.ts
+++ b/app/src/protyle/render/av/action.ts
@@ -20,6 +20,7 @@ import {openAsset} from "../../../editor/util";
import {getSearch, isMobile} from "../../../util/functions";
import {unicode2Emoji} from "../../../emoji";
import {selectRow} from "./row";
+import * as dayjs from "dayjs";
export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLElement }) => {
const blockElement = hasClosestBlock(event.target);
@@ -330,19 +331,30 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
export const updateAVName = (protyle: IProtyle, blockElement: Element) => {
const avId = blockElement.getAttribute("data-av-id");
+ const id = blockElement.getAttribute("data-node-id");
const nameElement = blockElement.querySelector(".av__title") as HTMLElement;
const newData = nameElement.textContent.trim();
if (newData === nameElement.dataset.title.trim()) {
return;
}
+ const newUpdated = dayjs().format("YYYYMMDDHHmmss")
+ blockElement.setAttribute("updated", newUpdated);
transaction(protyle, [{
action: "setAttrViewName",
id: avId,
data: newData,
+ }, {
+ action: "doUpdateUpdated",
+ id,
+ data: newUpdated,
}], [{
action: "setAttrViewName",
id: avId,
name: nameElement.dataset.title,
+ }, {
+ action: "doUpdateUpdated",
+ id,
+ data: blockElement.getAttribute("updated")
}]);
nameElement.dataset.title = newData;
};
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index 54b09d781d..99c2458667 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -34,6 +34,7 @@ type TOperation =
| "removeAttrViewColOption"
| "updateAttrViewColOption"
| "setAttrViewName"
+ | "doUpdateUpdated"
| "setAttrViewColIcon"
| "setAttrViewFilters"
| "setAttrViewSorts"