Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

agent: Add thread history import telemetry (#59050)

Katie Geereb4e2e8c7b82
diff --git a/crates/sidebar/src/sidebar.rs b/crates/sidebar/src/sidebar.rs
index ebd42f38730..b3fa58a0ee3 100644
--- a/crates/sidebar/src/sidebar.rs
+++ b/crates/sidebar/src/sidebar.rs
@@ -7458,7 +7458,21 @@ impl Sidebar {
.map(|w| w.read(cx).workspace().clone())
}
- fn show_thread_import_modal(&mut self, window: &mut Window, cx: &mut Context<Self>) {
+ fn show_thread_import_modal(
+ &mut self,
+ source: &'static str,
+ window: &mut Window,
+ cx: &mut Context<Self>,
+ ) {
+ telemetry::event!(
+ "Agent Threads Import Clicked",
+ source = source,
+ side = match self.side(cx) {
+ SidebarSide::Left => "left",
+ SidebarSide::Right => "right",
+ }
+ );
+
let Some(active_workspace) = self.active_workspace(cx) else {
return;
};
@@ -7514,7 +7528,7 @@ impl Sidebar {
) -> impl IntoElement {
let on_import = cx.listener(|this, _, window, cx| {
this.show_archive(window, cx);
- this.show_thread_import_modal(window, cx);
+ this.show_thread_import_modal("external_agent_onboarding", window, cx);
});
render_import_onboarding_banner(
"acp",
@@ -7553,6 +7567,14 @@ impl Sidebar {
);
let on_import = cx.listener(|this, _, _window, cx| {
+ telemetry::event!(
+ "Agent Threads Import Clicked",
+ source = "cross_channel_onboarding",
+ side = match this.side(cx) {
+ SidebarSide::Left => "left",
+ SidebarSide::Right => "right",
+ }
+ );
CrossChannelImportOnboarding::dismiss(cx);
if let Some(workspace) = this.active_workspace(cx) {
workspace.update(cx, |workspace, cx| {
@@ -7583,11 +7605,6 @@ impl Sidebar {
) {
match &self.view {
SidebarView::ThreadList => {
- let side = match self.side(cx) {
- SidebarSide::Left => "left",
- SidebarSide::Right => "right",
- };
- telemetry::event!("Thread History Viewed", side = side);
self.show_archive(window, cx);
}
SidebarView::Archive(_) => self.show_thread_list(window, cx),
@@ -7595,6 +7612,12 @@ impl Sidebar {
}
fn show_archive(&mut self, window: &mut Window, cx: &mut Context<Self>) {
+ let side = match self.side(cx) {
+ SidebarSide::Left => "left",
+ SidebarSide::Right => "right",
+ };
+ telemetry::event!("Thread History Viewed", side = side);
+
let Some(active_workspace) = self
.multi_workspace
.upgrade()
@@ -7639,7 +7662,7 @@ impl Sidebar {
this.restoring_tasks.remove(thread_id);
}
ThreadsArchiveViewEvent::Import => {
- this.show_thread_import_modal(window, cx);
+ this.show_thread_import_modal("thread_history", window, cx);
}
},
);