fix(canvas): 画布同步 - 版本冲突先核对并合并,本地保存与云端状态分开展示

本地持久化记录保存时间和日志令牌,同步面板区分本地与云端,不再用提示打断编辑。冲突时先尝试合并,无法合并才保留草稿并暂停自动提交;未登录时生成结果留在本地,登录后再继续上传。
This commit is contained in:
ddcat666
2026-10-09 17:17:38 +08:00
parent 631a85b4fe
commit 5e69106d8f
17 changed files with 541 additions and 238 deletions

View File

@@ -20,6 +20,8 @@ export type ClientDiagnosticEvent = {
taskId?: string;
projectId?: string;
canvasId?: string;
nodes_before?: number;
nodes_after?: number;
stack?: string;
};
@@ -133,6 +135,8 @@ export function recordDiagnosticEvent(input: DiagnosticEventInput) {
taskId: safeDiagnosticId(input.taskId),
projectId: safeDiagnosticId(input.projectId),
canvasId: safeDiagnosticId(input.canvasId),
nodes_before: input.nodes_before === undefined ? undefined : clampNumber(input.nodes_before, 0, 10_000_000),
nodes_after: input.nodes_after === undefined ? undefined : clampNumber(input.nodes_after, 0, 10_000_000),
stack: redactClientText(input.stack, 4000),
};
events.push(event);