onboarding: Add more telemetry (#36121)

1. Welcome Page Open
2. Welcome Nav clicked
3. Skip clicked
4. Font changed
5. Import settings clicked
6. Inlay Hints
7. Git Blame
8. Format on Save
9. Font Ligature
10. Ai Enabled
11. Ai Provider Modal open


Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This commit is contained in:
Anthony Eid 2025-08-13 12:02:14 -04:00 committed by GitHub
parent 6c1f19571a
commit a7442d8880
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 111 additions and 19 deletions

View file

@ -35,6 +35,11 @@ fn write_show_mini_map(show: ShowMinimap, cx: &mut App) {
EditorSettings::override_global(curr_settings, cx);
update_settings_file::<EditorSettings>(fs, cx, move |editor_settings, _| {
telemetry::event!(
"Welcome Minimap Clicked",
from = editor_settings.minimap.unwrap_or_default(),
to = show
);
editor_settings.minimap.get_or_insert_default().show = Some(show);
});
}
@ -71,7 +76,7 @@ fn read_git_blame(cx: &App) -> bool {
ProjectSettings::get_global(cx).git.inline_blame_enabled()
}
fn set_git_blame(enabled: bool, cx: &mut App) {
fn write_git_blame(enabled: bool, cx: &mut App) {
let fs = <dyn Fs>::global(cx);
let mut curr_settings = ProjectSettings::get_global(cx).clone();
@ -95,6 +100,12 @@ fn write_ui_font_family(font: SharedString, cx: &mut App) {
let fs = <dyn Fs>::global(cx);
update_settings_file::<ThemeSettings>(fs, cx, move |theme_settings, _| {
telemetry::event!(
"Welcome Font Changed",
type = "ui font",
old = theme_settings.ui_font_family,
new = font.clone()
);
theme_settings.ui_font_family = Some(FontFamilyName(font.into()));
});
}
@ -119,6 +130,13 @@ fn write_buffer_font_family(font_family: SharedString, cx: &mut App) {
let fs = <dyn Fs>::global(cx);
update_settings_file::<ThemeSettings>(fs, cx, move |theme_settings, _| {
telemetry::event!(
"Welcome Font Changed",
type = "editor font",
old = theme_settings.buffer_font_family,
new = font_family.clone()
);
theme_settings.buffer_font_family = Some(FontFamilyName(font_family.into()));
});
}
@ -197,7 +215,7 @@ fn render_setting_import_button(
.color(Color::Muted)
.size(IconSize::XSmall),
)
.child(Label::new(label)),
.child(Label::new(label.clone())),
)
.when(imported, |this| {
this.child(
@ -212,7 +230,10 @@ fn render_setting_import_button(
)
}),
)
.on_click(move |_, window, cx| window.dispatch_action(action.boxed_clone(), cx)),
.on_click(move |_, window, cx| {
telemetry::event!("Welcome Import Settings", import_source = label,);
window.dispatch_action(action.boxed_clone(), cx);
}),
)
}
@ -605,7 +626,13 @@ fn render_popular_settings_section(
ui::ToggleState::Unselected
},
|toggle_state, _, cx| {
write_font_ligatures(toggle_state == &ToggleState::Selected, cx);
let enabled = toggle_state == &ToggleState::Selected;
telemetry::event!(
"Welcome Font Ligature",
options = if enabled { "on" } else { "off" },
);
write_font_ligatures(enabled, cx);
},
)
.tab_index({
@ -625,7 +652,13 @@ fn render_popular_settings_section(
ui::ToggleState::Unselected
},
|toggle_state, _, cx| {
write_format_on_save(toggle_state == &ToggleState::Selected, cx);
let enabled = toggle_state == &ToggleState::Selected;
telemetry::event!(
"Welcome Format On Save Changed",
options = if enabled { "on" } else { "off" },
);
write_format_on_save(enabled, cx);
},
)
.tab_index({
@ -644,7 +677,13 @@ fn render_popular_settings_section(
ui::ToggleState::Unselected
},
|toggle_state, _, cx| {
write_inlay_hints(toggle_state == &ToggleState::Selected, cx);
let enabled = toggle_state == &ToggleState::Selected;
telemetry::event!(
"Welcome Inlay Hints Changed",
options = if enabled { "on" } else { "off" },
);
write_inlay_hints(enabled, cx);
},
)
.tab_index({
@ -663,7 +702,13 @@ fn render_popular_settings_section(
ui::ToggleState::Unselected
},
|toggle_state, _, cx| {
set_git_blame(toggle_state == &ToggleState::Selected, cx);
let enabled = toggle_state == &ToggleState::Selected;
telemetry::event!(
"Welcome Git Blame Changed",
options = if enabled { "on" } else { "off" },
);
write_git_blame(enabled, cx);
},
)
.tab_index({