修复双 PR 合并后的持续集成问题
补齐生成引用槽位参数并恢复 source 稳定标识\n恢复画布导出元数据格式化函数导入\n同步图标规范 GenerationInputs V2 测试契约\n修正音效提交并发测试的画布落层断言\n统一 Rust 格式以通过仓库门禁
This commit is contained in:
@@ -2481,8 +2481,7 @@ fn build_editor_scene_generation_inputs(
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())
|
||||
{
|
||||
fields
|
||||
.push(json!({ "id": "customStyle", "title": "自定义画风", "value": custom_style }));
|
||||
fields.push(json!({ "id": "customStyle", "title": "自定义画风", "value": custom_style }));
|
||||
}
|
||||
json!({
|
||||
"version": 2,
|
||||
@@ -6292,6 +6291,7 @@ async fn resolve_editor_pixel_art_source_for_owner(
|
||||
)?;
|
||||
let generation_input_reference = if let Some(source_resource) = source_resource {
|
||||
Some(json!({
|
||||
"id": "source",
|
||||
"title": "原图",
|
||||
"label": source_resource
|
||||
.label
|
||||
@@ -6305,6 +6305,7 @@ async fn resolve_editor_pixel_art_source_for_owner(
|
||||
editor_generation_reference_from_records(
|
||||
projects.as_slice(),
|
||||
library.assets.as_slice(),
|
||||
Some("source"),
|
||||
"原图".to_string(),
|
||||
source,
|
||||
)
|
||||
@@ -6312,6 +6313,7 @@ async fn resolve_editor_pixel_art_source_for_owner(
|
||||
editor_generation_reference_from_records(
|
||||
projects.as_slice(),
|
||||
library.assets.as_slice(),
|
||||
Some("source"),
|
||||
"原图".to_string(),
|
||||
object_key.as_str(),
|
||||
)
|
||||
@@ -8544,9 +8546,7 @@ pub(crate) async fn rebuild_editor_generation_input_references(
|
||||
editor_generation_reference_from_records(
|
||||
projects.as_slice(),
|
||||
library.assets.as_slice(),
|
||||
reference_slot_ids
|
||||
.get(index)
|
||||
.and_then(|id| id.as_deref()),
|
||||
reference_slot_ids.get(index).and_then(|id| id.as_deref()),
|
||||
title,
|
||||
source.as_str(),
|
||||
)
|
||||
@@ -13566,27 +13566,32 @@ mod tests {
|
||||
let resource_reference = editor_generation_reference_from_records(
|
||||
projects.as_slice(),
|
||||
std::slice::from_ref(&asset),
|
||||
Some("specReference"),
|
||||
"参考图 1".to_string(),
|
||||
"generated-character-drafts/editor/shared.png",
|
||||
)
|
||||
.expect("owned resource object key should produce provenance");
|
||||
assert_eq!(resource_reference["refType"], "project-resource");
|
||||
assert_eq!(resource_reference["refId"], "resource-1");
|
||||
assert_eq!(resource_reference["id"], "specReference");
|
||||
|
||||
let asset_reference = editor_generation_reference_from_records(
|
||||
projects.as_slice(),
|
||||
std::slice::from_ref(&asset),
|
||||
Some("reference"),
|
||||
"参考图 2".to_string(),
|
||||
"asset-1",
|
||||
)
|
||||
.expect("owned asset id should produce provenance");
|
||||
assert_eq!(asset_reference["refType"], "asset");
|
||||
assert_eq!(asset_reference["refId"], "asset-1");
|
||||
assert_eq!(asset_reference["id"], "reference");
|
||||
|
||||
assert!(
|
||||
editor_generation_reference_from_records(
|
||||
projects.as_slice(),
|
||||
std::slice::from_ref(&asset),
|
||||
Some("reference"),
|
||||
"参考图 3".to_string(),
|
||||
"asset-forged",
|
||||
)
|
||||
|
||||
@@ -2241,9 +2241,20 @@ describe('ImageCanvasEditorView generation integration', () => {
|
||||
projectId: 'editor-project-default',
|
||||
assetFolderId: 'project',
|
||||
generationInputs: {
|
||||
version: 2,
|
||||
action: 'spec.generate',
|
||||
fields: [
|
||||
{ title: '玩法设定', value: '消除类派对玩法' },
|
||||
{ title: '美术风格', value: '糖果玻璃拟物' },
|
||||
{ id: 'specType', title: '规范类型', value: 'icon' },
|
||||
{
|
||||
id: 'playSetting',
|
||||
title: '玩法设定',
|
||||
value: '消除类派对玩法',
|
||||
},
|
||||
{
|
||||
id: 'artStyle',
|
||||
title: '美术风格',
|
||||
value: '糖果玻璃拟物',
|
||||
},
|
||||
],
|
||||
references: [],
|
||||
},
|
||||
@@ -3165,9 +3176,16 @@ describe('ImageCanvasEditorView generation integration', () => {
|
||||
projectId: 'editor-project-default',
|
||||
assetFolderId: 'project',
|
||||
generationInputs: {
|
||||
version: 2,
|
||||
action: 'spec.generate',
|
||||
fields: [
|
||||
{ title: '玩法设定', value: '背包整理玩法' },
|
||||
{ title: '美术风格', value: '清爽卡通' },
|
||||
{ id: 'specType', title: '规范类型', value: 'icon' },
|
||||
{
|
||||
id: 'playSetting',
|
||||
title: '玩法设定',
|
||||
value: '背包整理玩法',
|
||||
},
|
||||
{ id: 'artStyle', title: '美术风格', value: '清爽卡通' },
|
||||
],
|
||||
references: [],
|
||||
},
|
||||
|
||||
@@ -8,6 +8,7 @@ import type {
|
||||
import {
|
||||
DEFAULT_ICON_DESCRIPTIONS,
|
||||
formatEditorGenerationInputFieldValue,
|
||||
formatGenerationInputValue,
|
||||
formatLayerImageType,
|
||||
getEditorLayerModelDisplayName,
|
||||
isEditorUserVisibleGenerationInputField,
|
||||
|
||||
@@ -2395,7 +2395,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
|
||||
expect(screen.getByTestId('sound-effect-assist').textContent).toBe(
|
||||
'idle',
|
||||
);
|
||||
expect(screen.getByTestId('layers').textContent).not.toContain(
|
||||
expect(screen.getByTestId('layers').textContent).toContain(
|
||||
'sound-effect',
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user