Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Map "feature upsell" events to the new "Noun Verbed" format (#20787)

Nathan Soboee207ab77ecd
diff --git a/crates/collab/src/api/events.rs b/crates/collab/src/api/events.rs
index 3b7a3b39003..053657a8d11 100644
--- a/crates/collab/src/api/events.rs
+++ b/crates/collab/src/api/events.rs
@@ -1520,7 +1520,22 @@ fn for_snowflake(
properties["is_first_for_channel"] = json!(true);
"App First Opened For Release Channel".to_string()
}
- _ => format!("Unknown App Event: {}", e.operation),
+ "feature upsell: toggle vim" => {
+ properties["source"] = json!("Feature Upsell");
+ "Vim Mode Toggled".to_string()
+ }
+ _ => e
+ .operation
+ .strip_prefix("feature upsell: viewed docs (")
+ .and_then(|s| s.strip_suffix(')'))
+ .map_or_else(
+ || format!("Unknown App Event: {}", e.operation),
+ |docs_url| {
+ properties["url"] = json!(docs_url);
+ properties["source"] = json!("Feature Upsell");
+ "Documentation Viewed".to_string()
+ },
+ ),
};
(event_type, properties)
}