From 9d9f1b8164dce1bb564175f5cdad143e16451806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 12 Sep 2026 21:23:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E7=B4=A0=E6=9D=90=E6=8F=90?= =?UTF-8?q?=E5=8F=96=E6=8F=90=E7=A4=BA=E4=B8=AD=E7=9A=84=E5=A4=87=E6=B3=A8?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对 YAML 提示中的描述和返工备注做有界清洗,避免代码围栏破坏提示结构。 --- .../ui_editor/commands/separation/prompt/extract.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/prompt/extract.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/prompt/extract.rs index c6cf4abfa..8a40dbaf7 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/prompt/extract.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/prompt/extract.rs @@ -1,6 +1,6 @@ use crate::ui_editor::commands::separation::model::{SeparationState, SeparationTree}; use crate::ui_editor::commands::separation::workflow::batch::terminal_node_ids; -use crate::ui_editor::commands::separation::{SeparationNode, SeparationNodeKind}; +use crate::ui_editor::commands::separation::{sanitize_prompt_text, SeparationNode, SeparationNodeKind, MAX_NOTE_DESCRIPTION_CHARS, MAX_REWORK_NOTE_CHARS}; use crate::ui_editor::utils::NodeId; use serde::Serialize; use std::collections::HashSet; @@ -113,8 +113,13 @@ fn project_node( width: node.width_px, height: node.height_px, }, - description: node.note.description.clone(), - rework_notes: node.note.rework_notes.iter().cloned().collect(), + description: sanitize_prompt_text(&node.note.description, MAX_NOTE_DESCRIPTION_CHARS), + rework_notes: node + .note + .rework_notes + .iter() + .map(|note| sanitize_prompt_text(note, MAX_REWORK_NOTE_CHARS)) + .collect(), children, } }