Tinker with the reporting of telemetry events (#34239)

Release Notes:

- N/A

---------

Co-authored-by: Katie Geer <katie@zed.dev>
This commit is contained in:
Mikayla Maki 2025-07-11 12:02:40 -07:00 committed by GitHub
parent fbead09c30
commit 625a4b90a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 4 deletions

View file

@ -2322,7 +2322,10 @@ impl Editor {
editor.update_lsp_data(false, None, window, cx);
}
editor.report_editor_event("Editor Opened", None, cx);
if editor.mode.is_full() {
editor.report_editor_event("Editor Opened", None, cx);
}
editor
}

View file

@ -813,7 +813,13 @@ impl Item for Editor {
window: &mut Window,
cx: &mut Context<Self>,
) -> Task<Result<()>> {
self.report_editor_event("Editor Saved", None, cx);
// Add meta data tracking # of auto saves
if options.autosave {
self.report_editor_event("Editor Autosaved", None, cx);
} else {
self.report_editor_event("Editor Saved", None, cx);
}
let buffers = self.buffer().clone().read(cx).all_buffers();
let buffers = buffers
.into_iter()

View file

@ -51,7 +51,6 @@ impl OnboardingBanner {
}
fn dismiss(&mut self, cx: &mut Context<Self>) {
telemetry::event!("Banner Dismissed", source = self.source);
persist_dismissed(&self.source, cx);
self.dismissed = true;
cx.notify();
@ -144,7 +143,10 @@ impl Render for OnboardingBanner {
div().border_l_1().border_color(border_color).child(
IconButton::new("close", IconName::Close)
.icon_size(IconSize::Indicator)
.on_click(cx.listener(|this, _, _window, cx| this.dismiss(cx)))
.on_click(cx.listener(|this, _, _window, cx| {
telemetry::event!("Banner Dismissed", source = this.source);
this.dismiss(cx)
}))
.tooltip(|window, cx| {
Tooltip::with_meta(
"Close Announcement Banner",