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

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

View File

@@ -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 } })),
];
}

View File

@@ -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,

View File

@@ -15,6 +15,7 @@ export { isDirectSystemModel } from "@/lib/model-selection";
export function modelChannelLabel(config: AiConfig, value: string) {
const channel = resolveModelChannel(config, value);
const cost = channel.modelCosts?.find((item) => item.model === modelOptionName(value));
if (channel.scope === "system") return cost?.channelLabel?.trim() || "系统模型";
return cost?.channelLabel?.trim() || channel.name || "未命名渠道";
}
@@ -39,7 +40,7 @@ export function groupModelsForPicker(config: AiConfig, options: string[]): Model
const key = JSON.stringify(["channel", channel.id]);
groups.set(key, {
key,
label: channel.name || "未命名渠道",
label: channel.scope === "system" ? "系统模型" : channel.name || "未命名渠道",
icon: modelIcon(config, otherModels[0]),
scope: channel.id === PUBLIC_MODEL_CATALOG_ID ? "" : "我的模型",
kind: "channel",