Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Add a note on how to check the telemetry
Mikayla Maki943ea61452a6
diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rsindex 524b7656268..d331ca80a9f 100644--- a/crates/theme/src/theme.rs+++ b/crates/theme/src/theme.rs@@ -869,6 +869,7 @@ pub struct WelcomeStyle {pub page_width: f32,pub logo: IconStyle,pub logo_subheading: ContainedText,+ pub usage_note: ContainedText,pub checkbox: CheckboxStyle,pub checkbox_container: ContainerStyle,pub button: Interactive<ContainedText>,diff --git a/crates/theme/src/ui.rs b/crates/theme/src/ui.rsindex 5396265ad8f..5441e711685 100644--- a/crates/theme/src/ui.rs+++ b/crates/theme/src/ui.rs@@ -4,7 +4,7 @@ use gpui::{ConstrainedBox, Container, ContainerStyle, Empty, Flex, KeystrokeLabel, Label,MouseEventHandler, ParentElement, Svg,},- Action, Element, EventContext, RenderContext, View,+ Action, Element, ElementBox, EventContext, RenderContext, View,};use serde::Deserialize;@@ -26,6 +26,21 @@ pub fn checkbox<T: 'static, V: View>(checked: bool,cx: &mut RenderContext<V>,change: fn(checked: bool, cx: &mut EventContext) -> (),+) -> MouseEventHandler<T> {+ let label = Label::new(label, style.label.text.clone())+ .contained()+ .with_style(style.label.container)+ .boxed();++ checkbox_with_label(label, style, checked, cx, change)+}++pub fn checkbox_with_label<T: 'static, V: View>(+ label: ElementBox,+ style: &CheckboxStyle,+ checked: bool,+ cx: &mut RenderContext<V>,+ change: fn(checked: bool, cx: &mut EventContext) -> (),) -> MouseEventHandler<T> {MouseEventHandler::<T>::new(0, cx, |state, _| {let indicator = if checked {@@ -55,10 +70,7 @@ pub fn checkbox<T: 'static, V: View>(}}).boxed(),- Label::new(label, style.label.text.clone())- .contained()- .with_style(style.label.container)- .boxed(),+ label,]).align_children_center().boxed()diff --git a/crates/welcome/src/welcome.rs b/crates/welcome/src/welcome.rsindex a1045ea1e8d..3a35920b889 100644--- a/crates/welcome/src/welcome.rs+++ b/crates/welcome/src/welcome.rs@@ -124,8 +124,25 @@ impl View for WelcomePage {.boxed(),Flex::column().with_children([- theme::ui::checkbox::<Metrics, Self>(- "Send anonymous usage data to improve Zed (View what we're sending via Help > View Telemetry Log)",+ theme::ui::checkbox_with_label::<Metrics, Self>(+ Flex::column()+ .with_children([+ Label::new(+ "Send anonymous usage data",+ theme.welcome.checkbox.label.text.clone(),+ )+ .contained()+ .with_style(theme.welcome.checkbox.label.container)+ .boxed(),+ Label::new(+ "Help > View Telemetry",+ theme.welcome.usage_note.text.clone(),+ )+ .contained()+ .with_style(theme.welcome.usage_note.container)+ .boxed(),+ ])+ .boxed(),&theme.welcome.checkbox,metrics,cx,diff --git a/crates/zed/src/menus.rs b/crates/zed/src/menus.rsindex 9381a909075..d5fb94b2b69 100644--- a/crates/zed/src/menus.rs+++ b/crates/zed/src/menus.rs@@ -137,7 +137,7 @@ pub fn menus() -> Vec<Menu<'static>> {items: vec![MenuItem::action("Command Palette", command_palette::Toggle),MenuItem::separator(),- MenuItem::action("View Telemetry Log", crate::OpenTelemetryLog),+ MenuItem::action("View Telemetry", crate::OpenTelemetryLog),MenuItem::action("View Dependency Licenses", crate::OpenLicenses),MenuItem::separator(),MenuItem::action(diff --git a/styles/src/styleTree/welcome.ts b/styles/src/styleTree/welcome.tsindex 7c437f110ef..4ad3e51cd84 100644--- a/styles/src/styleTree/welcome.ts+++ b/styles/src/styleTree/welcome.ts@@ -86,10 +86,19 @@ export default function welcome(colorScheme: ColorScheme) {border: border(layer, "active"),},},+ usageNote: {+ ...text(layer, "sans", "variant", { size: "2xs" }),+ margin: {+ top: -4+ }+ },checkboxContainer: {margin: {top: 4,},+ padding: {+ bottom: 8,+ }},checkbox: {label: {