notedeck

One damus client to rule them all
git clone git://jb55.com/notedeck
Log | Files | Refs | README | LICENSE

commit 7c58dc019b845e594cc6b081b4f8b19400befff6
parent fcd7c261bb278314e4db3b674456448bc24cdcbc
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 27 Mar 2025 11:50:44 -0700

dave: extract search_call ui

A bit cleaner

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mcrates/notedeck_dave/src/lib.rs | 25+++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/crates/notedeck_dave/src/lib.rs b/crates/notedeck_dave/src/lib.rs @@ -435,6 +435,18 @@ impl Dave { ui.label(format!("tool_response: {:?}", tool_response)); } + fn search_call_ui(search_call: &SearchCall, ui: &mut egui::Ui) { + ui.add(search_icon(16.0, 16.0)); + ui.add_space(8.0); + let context = match search_call.context { + SearchContext::Profile => "profile ", + SearchContext::Any => "", + SearchContext::Home => "home ", + }; + + ui.label(format!("Searching {}for '{}'", context, search_call.query)); + } + fn tool_call_ui(toolcalls: &[ToolCall], ui: &mut egui::Ui) { ui.vertical(|ui| { for call in toolcalls { @@ -446,18 +458,7 @@ impl Dave { .corner_radius(10.0) .fill(ui.visuals().widgets.inactive.weak_bg_fill) .show(ui, |ui| { - ui.add(search_icon(16.0, 16.0)); - ui.add_space(8.0); - let context = match search_call.context { - SearchContext::Profile => "profile ", - SearchContext::Any => "", - SearchContext::Home => "home ", - }; - - ui.label(format!( - "Searching {}for '{}'", - context, search_call.query - )); + Self::search_call_ui(search_call, ui); }) }); }