清理素材提取提示中的备注内容

对 YAML 提示中的描述和返工备注做有界清洗,避免代码围栏破坏提示结构。
This commit is contained in:
2026-09-12 21:23:44 +08:00
parent 8629a228a1
commit 9d9f1b8164
@@ -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,
}
}