fix(canvas): 创作工作台 - 恢复连续对话并完善附件、媒体占位与生成分辨率

Fixes #231

Fixes #233
This commit is contained in:
ddCat committed 2026-08-15 22:01:42 +08:00
1 parent 11d9d469f5
commit 7804574f9f
15 files changed
+753 -115

No files matched your search

+3 -3
View File
@@ -52,7 +52,7 @@ export function expandCreationPrompt(prompt: string, references: CreationReferen
}
if (reference.attachmentId) {
const position = attachmentPositions.get(reference.attachmentId);
const kindLabel = reference.kind === "video" ? "视频" : reference.kind === "audio" ? "音频" : "图片";
const kindLabel = reference.kind === "video" ? "视频" : reference.kind === "audio" ? "音频" : reference.kind === "text" ? "文件" : "图片";
mediaMappings.push(`- @${reference.label}:参考${kindLabel} ${position || 1}`);
return;
}
@@ -70,11 +70,11 @@ export function creationReferenceMetadata(references: CreationReference[]) {
function attachmentReference(attachment: CreationAttachment, index: number): CreationReference {
const kind = creationAttachmentKind(attachment);
const label = kind === "video" ? "视频" : kind === "audio" ? "音频" : "图片";
const label = kind === "video" ? "视频" : kind === "audio" ? "音频" : kind === "file" ? "文件" : "图片";
return {
id: `upload:${attachment.id}`,
nodeId: `upload:${attachment.id}`,
kind,
kind: kind === "file" ? "text" : kind,
label: `${label}${index + 1}`,
title: "当前参考内容",
previewUrl: attachment.previewUrl || ("dataUrl" in attachment ? attachment.dataUrl : attachment.url),