fix(canvas): 图片引用编号 - 同步提示词中的媒体引用 (#441)
* fix(media): 对象存储参考素材 - 协议支持 URL 时优先发送签名链接 开启对象存储后,支持 URL 的上游协议优先发送 OSS/COS/七牛/S3 签名链接;必须传字节的协议仍走 Base64 或 multipart。本地资源回退字节,签发失败直接报错,不自动重发生成。 * fix(canvas): 图片引用清理 - 取消引用时同步移除提示词引用 * fix(canvas): 图片引用编号 - 同步提示词中的媒体引用
This commit is contained in:
@@ -207,6 +207,19 @@ describe("canvas resource mention slots", () => {
|
||||
});
|
||||
|
||||
describe("remove canvas resource mention tokens", () => {
|
||||
test("断开首图时同步紧邻中文、连续引用及两位数编号", () => {
|
||||
const images = Array.from({ length: 10 }, (_, index) => imageNode(`image-${index}`));
|
||||
const target = {
|
||||
...videoNode("target"),
|
||||
metadata: { composerContent: "@图片1@图片2的人物参考@图片10,@[node:image-1]保持一致" },
|
||||
};
|
||||
const nodes = [...images, target];
|
||||
const connections = images.map((image) => connection(image.id, target.id));
|
||||
const result = applyCanvasConnectionPromptSync(nodes, connections, nodes, connections.slice(1));
|
||||
expect(result.find((node) => node.id === target.id)?.metadata?.composerContent)
|
||||
.toBe("@图片1的人物参考@图片9,@图片1保持一致");
|
||||
});
|
||||
|
||||
test("取消引用后会清掉对应的 @图片N", () => {
|
||||
const image = imageNode("image-a");
|
||||
const target = {
|
||||
|
||||
Reference in New Issue
Block a user