diff --git a/crates/agent_ui/src/agent_panel.rs b/crates/agent_ui/src/agent_panel.rs index 658f31766ba165d20814b2614321cf90653a0556..04d545c1ce964cad45a67018be38ea25eca7c488 100644 --- a/crates/agent_ui/src/agent_panel.rs +++ b/crates/agent_ui/src/agent_panel.rs @@ -214,6 +214,7 @@ pub fn init(cx: &mut App) { None, initial_content, true, + "agent_panel", window, cx, ) @@ -351,6 +352,7 @@ pub fn init(cx: &mut App) { auto_submit: true, }), true, + "agent_panel", window, cx, ); @@ -377,6 +379,7 @@ pub fn init(cx: &mut App) { auto_submit: true, }), true, + "agent_panel", window, cx, ); @@ -405,6 +408,7 @@ pub fn init(cx: &mut App) { auto_submit: true, }), true, + "agent_panel", window, cx, ); @@ -1269,6 +1273,7 @@ impl AgentPanel { title, None, true, + "agent_panel", window, cx, ); @@ -1304,27 +1309,27 @@ impl AgentPanel { } pub fn new_thread(&mut self, _action: &NewThread, window: &mut Window, cx: &mut Context) { - telemetry::event!( - "New Thread Clicked", - source = "agent_panel", - thread_location = thread_location_str(cx) - ); - self.do_new_thread(window, cx); + self.do_new_thread("agent_panel", window, cx); } pub fn new_thread_from_sidebar(&mut self, window: &mut Window, cx: &mut Context) { - telemetry::event!( - "New Thread Clicked", - source = "sidebar", - thread_location = thread_location_str(cx) - ); - self.do_new_thread(window, cx); + self.do_new_thread("sidebar", window, cx); } - fn do_new_thread(&mut self, window: &mut Window, cx: &mut Context) { + fn do_new_thread(&mut self, source: &'static str, window: &mut Window, cx: &mut Context) { self.reset_start_thread_in_to_default(cx); let initial_content = self.take_active_draft_initial_content(cx); - self.external_thread(None, None, None, None, initial_content, true, window, cx); + self.external_thread( + None, + None, + None, + None, + initial_content, + true, + source, + window, + cx, + ); } fn take_active_draft_initial_content( @@ -1392,6 +1397,7 @@ impl AgentPanel { title: thread.title, }), true, + "agent_panel", window, cx, ); @@ -1409,6 +1415,7 @@ impl AgentPanel { title: Option, initial_content: Option, focus: bool, + source: &'static str, window: &mut Window, cx: &mut Context, ) { @@ -1436,6 +1443,7 @@ impl AgentPanel { project, agent, focus, + source, window, cx, ); @@ -2443,6 +2451,7 @@ impl AgentPanel { None, external_source_prompt.map(AgentInitialContent::from), true, + "agent_panel", window, cx, ); @@ -2468,6 +2477,7 @@ impl AgentPanel { None, initial_content, focus, + "agent_panel", window, cx, ); @@ -2529,6 +2539,7 @@ impl AgentPanel { title, None, focus, + "agent_panel", window, cx, ); @@ -2545,6 +2556,7 @@ impl AgentPanel { project: Entity, agent: Agent, focus: bool, + source: &'static str, window: &mut Window, cx: &mut Context, ) { @@ -2583,6 +2595,7 @@ impl AgentPanel { project, thread_store, self.prompt_store.clone(), + source, window, cx, ) @@ -3275,6 +3288,7 @@ impl AgentPanel { None, Some(initial_content), true, + "agent_panel", window, cx, ); @@ -3341,14 +3355,6 @@ fn agent_panel_side_str(cx: &App) -> &'static str { } } -fn thread_location_str(cx: &App) -> &'static str { - use settings::{NewThreadLocation, Settings}; - match AgentSettings::get_global(cx).new_thread_location { - NewThreadLocation::LocalProject => "current_worktree", - NewThreadLocation::NewWorktree => "new_worktree", - } -} - pub enum AgentPanelEvent { ActiveViewChanged, ThreadFocused, @@ -3810,12 +3816,6 @@ impl AgentPanel { let agent_server_store = agent_server_store; Rc::new(move |window, cx| { - telemetry::event!( - "New Thread Clicked", - source = "agent_panel", - thread_location = thread_location_str(cx) - ); - let active_thread = active_thread.clone(); Some(ContextMenu::build(window, cx, |menu, _window, cx| { menu.context(focus_handle.clone()) @@ -4709,7 +4709,18 @@ impl AgentPanel { }; self.create_agent_thread( - server, None, None, None, None, workspace, project, ext_agent, true, window, cx, + server, + None, + None, + None, + None, + workspace, + project, + ext_agent, + true, + "agent_panel", + window, + cx, ); } diff --git a/crates/agent_ui/src/conversation_view.rs b/crates/agent_ui/src/conversation_view.rs index 85e73685dca14feef5aea529a77befe2cc6eabd6..7d23bcdf44e6274d1869a953902d54b5ad0f7a49 100644 --- a/crates/agent_ui/src/conversation_view.rs +++ b/crates/agent_ui/src/conversation_view.rs @@ -522,6 +522,7 @@ impl ConversationView { project: Entity, thread_store: Option>, prompt_store: Option>, + source: &'static str, window: &mut Window, cx: &mut Context, ) -> Self { @@ -568,6 +569,7 @@ impl ConversationView { title, project, initial_content, + source, window, cx, ), @@ -611,6 +613,7 @@ impl ConversationView { title, self.project.clone(), None, + "agent_panel", window, cx, ); @@ -635,6 +638,7 @@ impl ConversationView { title: Option, project: Entity, initial_content: Option, + source: &'static str, window: &mut Window, cx: &mut Context, ) -> ServerState { @@ -696,6 +700,7 @@ impl ConversationView { telemetry::event!( "Agent Thread Started", agent = connection.telemetry_id(), + source = source, side = side, thread_location = thread_location );