ai onboarding: Add telemetry event capturing (#34960)
Release Notes: - N/A Co-authored-by: Katie Geer <katie@zed.dev> Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
This commit is contained in:
parent
3b428e2ecc
commit
fdcd86617a
4 changed files with 37 additions and 6 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -347,6 +347,7 @@ dependencies = [
|
||||||
"proto",
|
"proto",
|
||||||
"serde",
|
"serde",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
|
"telemetry",
|
||||||
"ui",
|
"ui",
|
||||||
"workspace-hack",
|
"workspace-hack",
|
||||||
"zed_actions",
|
"zed_actions",
|
||||||
|
|
|
@ -910,6 +910,10 @@ impl MessageEditor {
|
||||||
.on_click({
|
.on_click({
|
||||||
let focus_handle = focus_handle.clone();
|
let focus_handle = focus_handle.clone();
|
||||||
move |_event, window, cx| {
|
move |_event, window, cx| {
|
||||||
|
telemetry::event!(
|
||||||
|
"Agent Message Sent",
|
||||||
|
agent = "zed",
|
||||||
|
);
|
||||||
focus_handle.dispatch_action(
|
focus_handle.dispatch_action(
|
||||||
&Chat, window, cx,
|
&Chat, window, cx,
|
||||||
);
|
);
|
||||||
|
|
|
@ -22,6 +22,7 @@ language_model.workspace = true
|
||||||
proto.workspace = true
|
proto.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
smallvec.workspace = true
|
smallvec.workspace = true
|
||||||
|
telemetry.workspace = true
|
||||||
ui.workspace = true
|
ui.workspace = true
|
||||||
workspace-hack.workspace = true
|
workspace-hack.workspace = true
|
||||||
zed_actions.workspace = true
|
zed_actions.workspace = true
|
||||||
|
|
|
@ -183,6 +183,7 @@ impl ZedAiOnboarding {
|
||||||
.full_width()
|
.full_width()
|
||||||
.style(ButtonStyle::Tinted(ui::TintColor::Accent))
|
.style(ButtonStyle::Tinted(ui::TintColor::Accent))
|
||||||
.on_click(move |_, _window, cx| {
|
.on_click(move |_, _window, cx| {
|
||||||
|
telemetry::event!("Upgrade To Pro Clicked", state = "young-account");
|
||||||
cx.open_url(&zed_urls::upgrade_to_zed_pro_url(cx))
|
cx.open_url(&zed_urls::upgrade_to_zed_pro_url(cx))
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
@ -210,6 +211,7 @@ impl ZedAiOnboarding {
|
||||||
.full_width()
|
.full_width()
|
||||||
.style(ButtonStyle::Tinted(ui::TintColor::Accent))
|
.style(ButtonStyle::Tinted(ui::TintColor::Accent))
|
||||||
.on_click(move |_, _window, cx| {
|
.on_click(move |_, _window, cx| {
|
||||||
|
telemetry::event!("Start Trial Clicked", state = "post-sign-in");
|
||||||
cx.open_url(&zed_urls::start_trial_url(cx))
|
cx.open_url(&zed_urls::start_trial_url(cx))
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
@ -234,7 +236,10 @@ impl ZedAiOnboarding {
|
||||||
.icon(IconName::ArrowUpRight)
|
.icon(IconName::ArrowUpRight)
|
||||||
.icon_color(Color::Muted)
|
.icon_color(Color::Muted)
|
||||||
.icon_size(IconSize::XSmall)
|
.icon_size(IconSize::XSmall)
|
||||||
.on_click(move |_, _window, cx| cx.open_url(&zed_urls::terms_of_service(cx))),
|
.on_click(move |_, _window, cx| {
|
||||||
|
telemetry::event!("Review Terms of Service Click");
|
||||||
|
cx.open_url(&zed_urls::terms_of_service(cx))
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
Button::new("accept_terms", "Accept")
|
Button::new("accept_terms", "Accept")
|
||||||
|
@ -242,7 +247,9 @@ impl ZedAiOnboarding {
|
||||||
.style(ButtonStyle::Tinted(TintColor::Accent))
|
.style(ButtonStyle::Tinted(TintColor::Accent))
|
||||||
.on_click({
|
.on_click({
|
||||||
let callback = self.accept_terms_of_service.clone();
|
let callback = self.accept_terms_of_service.clone();
|
||||||
move |_, window, cx| (callback)(window, cx)
|
move |_, window, cx| {
|
||||||
|
telemetry::event!("Accepted Terms of Service");
|
||||||
|
(callback)(window, cx)}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
|
@ -267,7 +274,10 @@ impl ZedAiOnboarding {
|
||||||
.style(ButtonStyle::Tinted(ui::TintColor::Accent))
|
.style(ButtonStyle::Tinted(ui::TintColor::Accent))
|
||||||
.on_click({
|
.on_click({
|
||||||
let callback = self.sign_in.clone();
|
let callback = self.sign_in.clone();
|
||||||
move |_, window, cx| callback(window, cx)
|
move |_, window, cx| {
|
||||||
|
telemetry::event!("Start Trial Clicked", state = "pre-sign-in");
|
||||||
|
callback(window, cx)
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
|
@ -294,7 +304,13 @@ impl ZedAiOnboarding {
|
||||||
IconButton::new("dismiss_onboarding", IconName::Close)
|
IconButton::new("dismiss_onboarding", IconName::Close)
|
||||||
.icon_size(IconSize::Small)
|
.icon_size(IconSize::Small)
|
||||||
.tooltip(Tooltip::text("Dismiss"))
|
.tooltip(Tooltip::text("Dismiss"))
|
||||||
.on_click(move |_, window, cx| callback(window, cx)),
|
.on_click(move |_, window, cx| {
|
||||||
|
telemetry::event!(
|
||||||
|
"Banner Dismissed",
|
||||||
|
source = "AI Onboarding",
|
||||||
|
);
|
||||||
|
callback(window, cx)
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
@ -331,7 +347,13 @@ impl ZedAiOnboarding {
|
||||||
IconButton::new("dismiss_onboarding", IconName::Close)
|
IconButton::new("dismiss_onboarding", IconName::Close)
|
||||||
.icon_size(IconSize::Small)
|
.icon_size(IconSize::Small)
|
||||||
.tooltip(Tooltip::text("Dismiss"))
|
.tooltip(Tooltip::text("Dismiss"))
|
||||||
.on_click(move |_, window, cx| callback(window, cx)),
|
.on_click(move |_, window, cx| {
|
||||||
|
telemetry::event!(
|
||||||
|
"Banner Dismissed",
|
||||||
|
source = "AI Onboarding",
|
||||||
|
);
|
||||||
|
callback(window, cx)
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
@ -359,7 +381,10 @@ impl ZedAiOnboarding {
|
||||||
.style(ButtonStyle::Outlined)
|
.style(ButtonStyle::Outlined)
|
||||||
.on_click({
|
.on_click({
|
||||||
let callback = self.continue_with_zed_ai.clone();
|
let callback = self.continue_with_zed_ai.clone();
|
||||||
move |_, window, cx| callback(window, cx)
|
move |_, window, cx| {
|
||||||
|
telemetry::event!("Banner Dismissed", source = "AI Onboarding");
|
||||||
|
callback(window, cx)
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue