assistant2: Add tiny design improvements (#27399)

Danilo Leal created

Really small stuff, like adding icons and adjusting colors.

Release Notes:

- N/A

Change summary

assets/icons/arrow_right_left.svg                           | 1 +
assets/icons/cog.svg                                        | 1 +
crates/assistant2/src/active_thread.rs                      | 3 ++-
crates/assistant2/src/context_picker.rs                     | 2 +-
crates/assistant2/src/context_picker/completion_provider.rs | 2 +-
crates/assistant_tools/src/bash_tool.rs                     | 2 +-
crates/editor/src/code_context_menus.rs                     | 3 ++-
crates/ui/src/components/icon.rs                            | 2 ++
8 files changed, 11 insertions(+), 5 deletions(-)

Detailed changes

assets/icons/arrow_right_left.svg 🔗

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-right-left"><path d="m16 3 4 4-4 4"/><path d="M20 7H4"/><path d="m8 21-4-4 4-4"/><path d="M4 17h16"/></svg>

assets/icons/cog.svg 🔗

@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cog"><path d="M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z"/><path d="M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"/><path d="M12 2v2"/><path d="M12 22v-2"/><path d="m17 20.66-1-1.73"/><path d="M11 10.27 7 3.34"/><path d="m20.66 17-1.73-1"/><path d="m3.34 7 1.73 1"/><path d="M14 12h8"/><path d="M2 12h2"/><path d="m20.66 7-1.73 1"/><path d="m3.34 17 1.73-1"/><path d="m17 3.34-1 1.73"/><path d="m11 13.73-4 6.93"/></svg>

crates/assistant2/src/active_thread.rs 🔗

@@ -1258,12 +1258,13 @@ impl ActiveThread {
             "edit-files" => IconName::Pencil,
             "fetch" => IconName::Globe,
             "list-directory" => IconName::Folder,
+            "move-path" => IconName::ArrowRightLeft,
             "now" => IconName::Info,
             "path-search" => IconName::SearchCode,
             "read-file" => IconName::Eye,
             "regex-search" => IconName::Regex,
             "thinking" => IconName::Brain,
-            _ => IconName::Terminal,
+            _ => IconName::Cog,
         };
 
         div().py_2().child(

crates/assistant2/src/context_picker.rs 🔗

@@ -67,7 +67,7 @@ impl ContextPickerMode {
 
     pub fn label(&self) -> &'static str {
         match self {
-            Self::File => "File/Directory",
+            Self::File => "Files & Directories",
             Self::Fetch => "Fetch",
             Self::Thread => "Thread",
         }

crates/assistant2/src/context_picker/completion_provider.rs 🔗

@@ -821,7 +821,7 @@ mod tests {
                     format!("six.txt {}", separator!("dir/b")).as_str(),
                     format!("five.txt {}", separator!("dir/b")).as_str(),
                     format!("four.txt {}", separator!("dir/a")).as_str(),
-                    "File/Directory",
+                    "Files & Directories",
                     "Fetch"
                 ]
             );

crates/assistant_tools/src/bash_tool.rs 🔗

@@ -38,7 +38,7 @@ impl Tool for BashTool {
 
     fn ui_text(&self, input: &serde_json::Value) -> String {
         match serde_json::from_value::<BashToolInput>(input.clone()) {
-            Ok(input) => format!("`$ {}`", input.command),
+            Ok(input) => format!("`{}`", input.command),
             Err(_) => "Run bash command".to_string(),
         }
     }

crates/editor/src/code_context_menus.rs 🔗

@@ -547,7 +547,8 @@ impl CompletionsMenu {
                             .or_else(|| {
                                 completion.icon_path.as_ref().map(|path| {
                                     Icon::from_path(path)
-                                        .size(IconSize::Small)
+                                        .size(IconSize::XSmall)
+                                        .color(Color::Muted)
                                         .into_any_element()
                                 })
                             });

crates/ui/src/components/icon.rs 🔗

@@ -140,6 +140,7 @@ pub enum IconName {
     ArrowDownFromLine,
     ArrowLeft,
     ArrowRight,
+    ArrowRightLeft,
     ArrowUp,
     ArrowUpFromLine,
     ArrowUpRight,
@@ -170,6 +171,7 @@ pub enum IconName {
     Circle,
     Close,
     Code,
+    Cog,
     Command,
     Context,
     Control,