Compare commits

...

1 Commits

Author SHA1 Message Date
Nate Butler
6292b6f11b Add tool preview component for agent 2025-04-08 16:18:39 -06:00
5 changed files with 28 additions and 1 deletions

2
Cargo.lock generated
View File

@@ -64,6 +64,7 @@ dependencies = [
"clock",
"collections",
"command_palette_hooks",
"component",
"context_server",
"convert_case 0.8.0",
"db",
@@ -84,6 +85,7 @@ dependencies = [
"language",
"language_model",
"language_model_selector",
"linkme",
"log",
"lsp",
"markdown",

View File

@@ -31,6 +31,7 @@ client.workspace = true
clock.workspace = true
collections.workspace = true
command_palette_hooks.workspace = true
component.workspace = true
context_server.workspace = true
convert_case.workspace = true
db.workspace = true
@@ -50,6 +51,7 @@ itertools.workspace = true
language.workspace = true
language_model.workspace = true
language_model_selector.workspace = true
linkme.workspace = true
log.workspace = true
lsp.workspace = true
markdown.workspace = true
@@ -84,9 +86,9 @@ ui.workspace = true
ui_input.workspace = true
util.workspace = true
uuid.workspace = true
workspace-hack.workspace = true
workspace.workspace = true
zed_actions.workspace = true
workspace-hack.workspace = true
[dev-dependencies]
buffer_diff = { workspace = true, features = ["test-support"] }

View File

@@ -1,5 +1,6 @@
mod agent_notification;
mod context_pill;
mod tool_preview;
pub use agent_notification::*;
pub use context_pill::*;

View File

@@ -0,0 +1,20 @@
mod tool_preview {
use ui::{AnyElement, App, Window, component_prelude::*};
#[derive(RegisterComponent)]
pub struct Thinking {}
impl Component for Thinking {
fn scope() -> ComponentScope {
ComponentScope::Agent
}
fn description() -> Option<&'static str> {
None
}
fn preview(_window: &mut Window, _cx: &mut App) -> Option<AnyElement> {
None
}
}
}

View File

@@ -193,6 +193,7 @@ pub fn components() -> AllComponents {
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ComponentScope {
Agent,
Collaboration,
DataDisplay,
Editor,
@@ -212,6 +213,7 @@ pub enum ComponentScope {
impl Display for ComponentScope {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
ComponentScope::Agent => write!(f, "Agent"),
ComponentScope::Collaboration => write!(f, "Collaboration"),
ComponentScope::DataDisplay => write!(f, "Data Display"),
ComponentScope::Editor => write!(f, "Editor"),