Format the prompt history closure

This commit is contained in:
muraa-p
2026-11-02 11:48:40 +03:00
committed by bflatastic
parent a92eccc012
commit b8cc3d3c95
+7 -1
View File
@@ -320,7 +320,13 @@ 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(crate::prompt_box::Prompt { text: text.clone(), pictures: Vec::new() }) } 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,