edit predictions: Onboarding funnel telemetry (#24237)

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga
2025-02-05 15:26:11 +00:00
committed by GitHub
parent 0a89d1a479
commit 630d0add19
10 changed files with 82 additions and 15 deletions
@@ -256,6 +256,10 @@ impl Render for InlineCompletionButton {
)
})
.on_click(cx.listener(move |_, _, window, cx| {
telemetry::event!(
"Pending ToS Clicked",
source = "Edit Prediction Status Button"
);
window.dispatch_action(
zed_actions::OpenZedPredictOnboarding.boxed_clone(),
cx,
@@ -426,6 +430,8 @@ impl InlineCompletionButton {
if data_collection.is_supported() {
let provider = provider.clone();
let enabled = data_collection.is_enabled();
menu = menu
.separator()
.header("Help Improve The Model")
@@ -434,9 +440,21 @@ impl InlineCompletionButton {
// TODO: We want to add something later that communicates whether
// the current project is open-source.
ContextMenuEntry::new("Share Training Data")
.toggleable(IconPosition::Start, data_collection.is_enabled())
.toggleable(IconPosition::Start, enabled)
.handler(move |_, cx| {
provider.toggle_data_collection(cx);
if !enabled {
telemetry::event!(
"Data Collection Enabled",
source = "Edit Prediction Status Menu"
);
} else {
telemetry::event!(
"Data Collection Disabled",
source = "Edit Prediction Status Menu"
);
}
}),
);
}