From c2da8e184e90d2a3e99f64e4b1c4dfe38932babf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 15 Sep 2026 19:36:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20UI=20=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E6=BA=90=E8=B5=84=E6=BA=90=E6=9E=9A=E4=B8=BE=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 工作流源图校验与 fixture 统一使用 UiDesign。 更新失败提示中的 manifest kind 名称。 --- .../src-tauri/src/ui_editor/workflow.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/workflow.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/workflow.rs index 3eccc2876..05064ad65 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/workflow.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/workflow.rs @@ -20,6 +20,7 @@ use image::GenericImageView as _; use nalgebra::Vector2; use serde::{Deserialize, Serialize}; use sha2::{Digest as _, Sha256}; +use shared_contracts::game_creation_app::GameCreationAppAssetKind; use std::collections::{HashMap, HashSet}; use std::fs; use std::path::Path; @@ -534,8 +535,8 @@ fn validate_source_asset( root: &Path, asset: &GameCreationAppAssetManifestEntry, ) -> Result<(), String> { - if asset.kind != "ui-prototype" || !asset.media_type.starts_with("image/") { - return Err("ui.workflow.run sourceAssetId 必须是已登记的 ui-prototype 图片".to_string()); + if asset.kind != GameCreationAppAssetKind::UiDesign || !asset.media_type.starts_with("image/") { + return Err("ui.workflow.run sourceAssetId 必须是已登记的 ui-design 图片".to_string()); } validate_image_asset_file(root, asset, "UI 原型图") } @@ -1606,7 +1607,7 @@ mod tests { let design_path = root.join("assets/home.png"); fixture_png(&source_path); fixture_png(&design_path); - let source = fixture_asset(root, "assets/ui-prototype.png", "ui-prototype", "source-ui"); + let source = fixture_asset(root, "assets/ui-prototype.png", "ui-design", "source-ui"); let design = fixture_asset(root, "assets/home.png", "ui-design", "design-home"); let page = |operation| UiWorkflowRunInput { operation, @@ -1657,7 +1658,7 @@ mod tests { fixture_png(&root.join("assets/ui-prototype.png")); fixture_png(&root.join("assets/home.png")); fixture_png(&root.join("assets/start-button.png")); - let source = fixture_asset(root, "assets/ui-prototype.png", "ui-prototype", "source-ui"); + let source = fixture_asset(root, "assets/ui-prototype.png", "ui-design", "source-ui"); let design = fixture_asset(root, "assets/home.png", "ui-design", "design-home"); let sprite = fixture_asset(root, "assets/start-button.png", "ui-icon", "start-button"); let font_path = root.join("assets/ui-font.ttf");