fix(*): 质量检查 - 修复预演保存、增量同步与缺失资源恢复

This commit is contained in:
ddcat666 committed 2026-10-12 00:37:15 +08:00
1 parent 298bee1fa9
commit 27c8066e6d
20 files changed
+257 -71

No files matched your search

@@ -45,8 +45,6 @@ export function commitCanvasGenerationResult(current: CanvasNodeData[], before:
const existingIds = new Set(current.map((node) => node.id));
return [
...committedWithAdditional,
...additionalNodes
.filter((node) => !existingIds.has(node.id))
.map((node) => ({ ...node, position: { x: node.position.x + merged.position.x - result.position.x, y: node.position.y + merged.position.y - result.position.y } })),
...additionalNodes.filter((node) => !existingIds.has(node.id)).map((node) => ({ ...node, position: { x: node.position.x + merged.position.x - result.position.x, y: node.position.y + merged.position.y - result.position.y } })),
];
}
@@ -383,16 +383,16 @@ async function buildGenerationTaskNodeResults(node: CanvasNodeData, task: Genera
const id = `${node.id}:task:${task.id}:image:${index}`;
const existing = nodes.find((item) => item.id === id);
const child = await buildGenerationTaskNodeResult(
existing
? { ...node, ...existing, id, title: existing.title, position: existing.position, width: existing.width, height: existing.height }
: { ...node, id, title: `${node.title} · ${index + 1}`, parentId: undefined },
existing ? { ...node, ...existing, id, title: existing.title, position: existing.position, width: existing.width, height: existing.height } : { ...node, id, title: `${node.title} · ${index + 1}`, parentId: undefined },
task,
nodes,
index,
);
children.push({
...child,
...(existing ? { title: existing.title, position: existing.position, width: existing.metadata?.manualSize ? existing.width : child.width, height: existing.metadata?.manualSize ? existing.height : child.height } : { position: imageGenerationChildPosition(resultNode.position, resultNode.width, child, index) }),
...(existing
? { title: existing.title, position: existing.position, width: existing.metadata?.manualSize ? existing.width : child.width, height: existing.metadata?.manualSize ? existing.height : child.height }
: { position: imageGenerationChildPosition(resultNode.position, resultNode.width, child, index) }),
metadata: {
...child.metadata,
assetId: task.outputs?.find((output) => output.outputIndex === index)?.materializedAssetId,