edit predictions: Onboarding funnel telemetry (#24237)
Release Notes: - N/A
This commit is contained in:
parent
0a89d1a479
commit
630d0add19
10 changed files with 82 additions and 15 deletions
|
@ -29,6 +29,7 @@ workspace.workspace = true
|
|||
zed_actions.workspace = true
|
||||
zeta.workspace = true
|
||||
client.workspace = true
|
||||
telemetry.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
copilot = { workspace = true, features = ["test-support"] }
|
||||
|
|
|
@ -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"
|
||||
);
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue