From 1c63736578c65de2ce0604d371c8def69fafd7f9 Mon Sep 17 00:00:00 2001 From: muraa-p Date: Mon, 2 Nov 2026 12:46:22 +0800 Subject: [PATCH] Fix the remaining call sites for the new Prompt and UserItem shapes --- apps/craft-anything-cli/src/rebuild_cmd.rs | 4 ++-- crates/ui-egui/src/chat.rs | 2 +- crates/ui-egui/src/just_ask.rs | 2 +- crates/ui-egui/tests/smoke.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/craft-anything-cli/src/rebuild_cmd.rs b/apps/craft-anything-cli/src/rebuild_cmd.rs index 8375176b..66924ce3 100644 --- a/apps/craft-anything-cli/src/rebuild_cmd.rs +++ b/apps/craft-anything-cli/src/rebuild_cmd.rs @@ -160,9 +160,9 @@ fn run(cli: &Cli, a: &RebuildArgs) -> Result { } } RunEvent::Agent(_) => {} - RunEvent::Note(text) => { + RunEvent::Note { shown, .. } => { end_line(&mut line_open); - println!(" + {text}"); + println!(" + {shown}"); } RunEvent::Ask(r) => { end_line(&mut line_open); diff --git a/crates/ui-egui/src/chat.rs b/crates/ui-egui/src/chat.rs index 367f853e..ff08c633 100644 --- a/crates/ui-egui/src/chat.rs +++ b/crates/ui-egui/src/chat.rs @@ -320,7 +320,7 @@ fn composer(app: &mut CraftApp, ui: &mut Ui, width: f32, dense: bool) { let answering = app.answering(); let hint = if dense { tr("Ask the agent…") } else { tr("Ask anything, e.g. \"What does this program do?\"") }; ui.allocate_ui(Vec2::new(width, 0.0), |ui| { - let history = || app.state.chat.iter().filter_map(|i| if let ChatItem::User(text) = i { Some(text.clone()) } else { None }).collect(); + let history = || app.state.chat.iter().filter_map(|i| if let ChatItem::User(text) = i { Some(crate::prompt_box::Prompt { text: text.clone(), pictures: Vec::new() }) } else { None }).collect(); let out = crate::prompt_box::show( ui, &mut app.state.input, diff --git a/crates/ui-egui/src/just_ask.rs b/crates/ui-egui/src/just_ask.rs index f911a13d..54e7306d 100644 --- a/crates/ui-egui/src/just_ask.rs +++ b/crates/ui-egui/src/just_ask.rs @@ -204,7 +204,7 @@ mod tests { // The feed stores the shown text with its "(n pictures attached)" line, and the // pictures travel with the same UserItem. let pics = [std::path::PathBuf::from("attachments/picture-1.png")]; - let feed = [FeedItem::User(UserItem::new("Make it blue\n(1 picture attached)", pics.clone()))]; + let feed = [FeedItem::User(UserItem::new("Make it blue\n(1 picture attached)".to_string(), pics.to_vec()))]; let list = [asked("where are the files", 1)]; let out = prompts(&feed, &list); assert_eq!(out[0].text, "Make it blue"); diff --git a/crates/ui-egui/tests/smoke.rs b/crates/ui-egui/tests/smoke.rs index f50de152..e0636e36 100644 --- a/crates/ui-egui/tests/smoke.rs +++ b/crates/ui-egui/tests/smoke.rs @@ -305,7 +305,7 @@ fn an_engine_download_shows_in_the_title_bar_on_every_screen() { #[test] fn a_projects_conversation_and_place_come_back_after_a_restart() { use craft_anything_engine::workspace::{TargetRef, Workspace}; - use craft_anything_ui_egui::state::FeedItem; + use craft_anything_ui_egui::state::{FeedItem, UserItem}; struct Mem(std::collections::HashMap); impl eframe::Storage for Mem { fn get_string(&self, key: &str) -> Option {