From cdca55e82b62ce8aeca866ee072a2fb67a9ae14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 1 Sep 2026 15:30:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=20UI=20=E6=A0=91=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=90=8D=E8=BF=BD=E5=8A=A0=E6=A0=B9=E8=8A=82=E7=82=B9=E6=A0=87?= =?UTF-8?q?=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用根节点 ID 的十六进制后缀避免清洗后导出名重复 保留现有导出名主体,降低调用方迁移成本 --- .../src-tauri/src/ui_editor/html_renderer/mod.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/html_renderer/mod.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/html_renderer/mod.rs index e417fd6c1..93f71a414 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/html_renderer/mod.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/html_renderer/mod.rs @@ -56,11 +56,16 @@ pub(crate) fn render_ui_design_state_html(state: &State) -> Result Result<(String, Vec, usize), String> { + // 生成阶段只渲染已由保存流程 validate_state 校验过的 State;不重复执行领域校验。 let mut exports = Vec::with_capacity(state.ui_trees.len()); let mut modules = Vec::with_capacity(state.ui_trees.len()); let mut node_count = 0usize; for tree in &state.ui_trees { - let export_name = tree_export_name(tree.src_ui_design.as_str()); + let export_name = format!( + "{}_{}", + tree_export_name(tree.src_ui_design.as_str()), + hex_id(tree.root.id.as_str()) + ); exports.push(export_name.clone()); let image = state .ui_design_images