Indicate which extension version is installed when on an older version (#10574)
This PR adds an indicator to show what extension version is currently installed when on an extension version that is not the latest. <img width="1156" alt="Screenshot 2024-04-15 at 2 10 33 PM" src="https://github.com/zed-industries/zed/assets/1486634/61c5e4cf-a0b8-48fc-8e52-f04f1c351794"> Release Notes: - Added an indicator to show the currently-installed extension version when not on the latest version.
This commit is contained in:
parent
57a736d74a
commit
fda21232ae
1 changed files with 14 additions and 3 deletions
|
@ -421,8 +421,14 @@ impl ExtensionsPage {
|
||||||
let extension_id = extension.id.clone();
|
let extension_id = extension.id.clone();
|
||||||
let (install_or_uninstall_button, upgrade_button) =
|
let (install_or_uninstall_button, upgrade_button) =
|
||||||
self.buttons_for_entry(extension, &status, cx);
|
self.buttons_for_entry(extension, &status, cx);
|
||||||
|
let version = extension.manifest.version.clone();
|
||||||
let repository_url = extension.manifest.repository.clone();
|
let repository_url = extension.manifest.repository.clone();
|
||||||
|
|
||||||
|
let installed_version = match status {
|
||||||
|
ExtensionStatus::Installed(installed_version) => Some(installed_version),
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
|
|
||||||
ExtensionCard::new()
|
ExtensionCard::new()
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
|
@ -435,9 +441,14 @@ impl ExtensionsPage {
|
||||||
Headline::new(extension.manifest.name.clone())
|
Headline::new(extension.manifest.name.clone())
|
||||||
.size(HeadlineSize::Medium),
|
.size(HeadlineSize::Medium),
|
||||||
)
|
)
|
||||||
.child(
|
.child(Headline::new(format!("v{version}")).size(HeadlineSize::XSmall))
|
||||||
Headline::new(format!("v{}", extension.manifest.version))
|
.children(
|
||||||
.size(HeadlineSize::XSmall),
|
installed_version
|
||||||
|
.filter(|installed_version| *installed_version != version)
|
||||||
|
.map(|installed_version| {
|
||||||
|
Headline::new(format!("(v{installed_version} installed)",))
|
||||||
|
.size(HeadlineSize::XSmall)
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue