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.

Indicate which extension version is installed when on an older version (#10574)

Marshall Bowersfda21232ae47
diff --git a/crates/extensions_ui/src/extensions_ui.rs b/crates/extensions_ui/src/extensions_ui.rs
index b9b78173091..314a7559d5e 100644
--- a/crates/extensions_ui/src/extensions_ui.rs
+++ b/crates/extensions_ui/src/extensions_ui.rs
@@ -421,8 +421,14 @@ impl ExtensionsPage {
let extension_id = extension.id.clone();
let (install_or_uninstall_button, upgrade_button) =
self.buttons_for_entry(extension, &status, cx);
+ let version = extension.manifest.version.clone();
let repository_url = extension.manifest.repository.clone();
+ let installed_version = match status {
+ ExtensionStatus::Installed(installed_version) => Some(installed_version),
+ _ => None,
+ };
+
ExtensionCard::new()
.child(
h_flex()
@@ -435,9 +441,14 @@ impl ExtensionsPage {
Headline::new(extension.manifest.name.clone())
.size(HeadlineSize::Medium),
)
- .child(
- Headline::new(format!("v{}", extension.manifest.version))
- .size(HeadlineSize::XSmall),
+ .child(Headline::new(format!("v{version}")).size(HeadlineSize::XSmall))
+ .children(
+ installed_version
+ .filter(|installed_version| *installed_version != version)
+ .map(|installed_version| {
+ Headline::new(format!("(v{installed_version} installed)",))
+ .size(HeadlineSize::XSmall)
+ }),
),
)
.child(