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.

Display extension download counts (#7864)

Marshall Bowers23132b5ab139
diff --git a/crates/extension/src/extension_store.rs b/crates/extension/src/extension_store.rs
index bceb51e532a..f340d8211b1 100644
--- a/crates/extension/src/extension_store.rs
+++ b/crates/extension/src/extension_store.rs
@@ -42,6 +42,7 @@ pub struct Extension {
pub description: Option<String>,
pub authors: Vec<String>,
pub repository: String,
+ pub download_count: usize,
}
#[derive(Clone)]
diff --git a/crates/extensions_ui/src/extensions_ui.rs b/crates/extensions_ui/src/extensions_ui.rs
index b5fb0ae5e61..8151d05b72f 100644
--- a/crates/extensions_ui/src/extensions_ui.rs
+++ b/crates/extensions_ui/src/extensions_ui.rs
@@ -236,18 +236,24 @@ impl ExtensionsPage {
),
)
.child(
- h_flex().justify_between().child(
- Label::new(format!(
- "{}: {}",
- if extension.authors.len() > 1 {
- "Authors"
- } else {
- "Author"
- },
- extension.authors.join(", ")
- ))
- .size(LabelSize::Small),
- ),
+ h_flex()
+ .justify_between()
+ .child(
+ Label::new(format!(
+ "{}: {}",
+ if extension.authors.len() > 1 {
+ "Authors"
+ } else {
+ "Author"
+ },
+ extension.authors.join(", ")
+ ))
+ .size(LabelSize::Small),
+ )
+ .child(
+ Label::new(format!("Downloads: {}", extension.download_count))
+ .size(LabelSize::Small),
+ ),
)
.child(
h_flex()