telemetry: Reduce the amount of telemetry events fired (#36060)

1. Extension loaded events are now condensed into a single event with a
Vec of (extension_id, extension_version) called id_and_versions.
2. Editor Saved & AutoSaved are merged into a singular event with a type
field that is either "manual" or "autosave”.
3. Editor Edited event will only fire once every 10 minutes now.
4. Editor Closed event is fired when an editor item (tab) is removed
from a pane



cc: @katie-z-geer 

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This commit is contained in:
Anthony Eid 2025-08-12 15:56:27 -04:00 committed by GitHub
parent 628b1058be
commit 255bb0a3f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 110 additions and 43 deletions

View file

@ -293,6 +293,7 @@ pub trait Item: Focusable + EventEmitter<Self::Event> + Render + Sized {
fn deactivated(&mut self, _window: &mut Window, _: &mut Context<Self>) {}
fn discarded(&self, _project: Entity<Project>, _window: &mut Window, _cx: &mut Context<Self>) {}
fn on_removed(&self, _cx: &App) {}
fn workspace_deactivated(&mut self, _window: &mut Window, _: &mut Context<Self>) {}
fn navigate(&mut self, _: Box<dyn Any>, _window: &mut Window, _: &mut Context<Self>) -> bool {
false
@ -532,6 +533,7 @@ pub trait ItemHandle: 'static + Send {
);
fn deactivated(&self, window: &mut Window, cx: &mut App);
fn discarded(&self, project: Entity<Project>, window: &mut Window, cx: &mut App);
fn on_removed(&self, cx: &App);
fn workspace_deactivated(&self, window: &mut Window, cx: &mut App);
fn navigate(&self, data: Box<dyn Any>, window: &mut Window, cx: &mut App) -> bool;
fn item_id(&self) -> EntityId;
@ -968,6 +970,10 @@ impl<T: Item> ItemHandle for Entity<T> {
self.update(cx, |this, cx| this.deactivated(window, cx));
}
fn on_removed(&self, cx: &App) {
self.read(cx).on_removed(cx);
}
fn workspace_deactivated(&self, window: &mut Window, cx: &mut App) {
self.update(cx, |this, cx| this.workspace_deactivated(window, cx));
}

View file

@ -1829,6 +1829,7 @@ impl Pane {
let mode = self.nav_history.mode();
self.nav_history.set_mode(NavigationMode::ClosingItem);
item.deactivated(window, cx);
item.on_removed(cx);
self.nav_history.set_mode(mode);
if self.is_active_preview_item(item.item_id()) {