Hide unused extension types from the extension UI (#34166)
This PR hides "slash commands" and "indexed docs providers" from the extensions UI as these are virtually completely unused types of extensions. Release Notes: - N/A
This commit is contained in:
parent
95784d53ca
commit
dc591fe7c7
1 changed files with 47 additions and 31 deletions
|
@ -718,24 +718,34 @@ impl ExtensionsPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
parent.child(
|
parent.child(
|
||||||
h_flex().gap_2().children(
|
h_flex().gap_1().children(
|
||||||
extension
|
extension
|
||||||
.manifest
|
.manifest
|
||||||
.provides
|
.provides
|
||||||
.iter()
|
.iter()
|
||||||
.map(|provides| {
|
.filter_map(|provides| {
|
||||||
div()
|
match provides {
|
||||||
.bg(cx.theme().colors().element_background)
|
ExtensionProvides::SlashCommands
|
||||||
.px_0p5()
|
| ExtensionProvides::IndexedDocsProviders => {
|
||||||
.border_1()
|
return None;
|
||||||
.border_color(cx.theme().colors().border)
|
}
|
||||||
.rounded_sm()
|
_ => {}
|
||||||
.child(
|
}
|
||||||
Label::new(extension_provides_label(
|
|
||||||
*provides,
|
Some(
|
||||||
))
|
div()
|
||||||
.size(LabelSize::XSmall),
|
.px_1()
|
||||||
)
|
.border_1()
|
||||||
|
.rounded_sm()
|
||||||
|
.border_color(cx.theme().colors().border)
|
||||||
|
.bg(cx.theme().colors().element_background)
|
||||||
|
.child(
|
||||||
|
Label::new(extension_provides_label(
|
||||||
|
*provides,
|
||||||
|
))
|
||||||
|
.size(LabelSize::XSmall),
|
||||||
|
),
|
||||||
|
)
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>(),
|
.collect::<Vec<_>>(),
|
||||||
),
|
),
|
||||||
|
@ -744,8 +754,7 @@ impl ExtensionsPage {
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_2()
|
.gap_1()
|
||||||
.justify_between()
|
|
||||||
.children(buttons.upgrade)
|
.children(buttons.upgrade)
|
||||||
.children(buttons.configure)
|
.children(buttons.configure)
|
||||||
.child(buttons.install_or_uninstall),
|
.child(buttons.install_or_uninstall),
|
||||||
|
@ -1452,23 +1461,30 @@ impl Render for ExtensionsPage {
|
||||||
this.change_provides_filter(None, cx);
|
this.change_provides_filter(None, cx);
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
.children(ExtensionProvides::iter().map(|provides| {
|
.children(ExtensionProvides::iter().filter_map(|provides| {
|
||||||
|
match provides {
|
||||||
|
ExtensionProvides::SlashCommands
|
||||||
|
| ExtensionProvides::IndexedDocsProviders => return None,
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
|
||||||
let label = extension_provides_label(provides);
|
let label = extension_provides_label(provides);
|
||||||
Button::new(
|
let button_id = SharedString::from(format!("filter-category-{}", label));
|
||||||
SharedString::from(format!("filter-category-{}", label)),
|
|
||||||
label,
|
Some(
|
||||||
|
Button::new(button_id, label)
|
||||||
|
.style(if self.provides_filter == Some(provides) {
|
||||||
|
ButtonStyle::Filled
|
||||||
|
} else {
|
||||||
|
ButtonStyle::Subtle
|
||||||
|
})
|
||||||
|
.toggle_state(self.provides_filter == Some(provides))
|
||||||
|
.on_click({
|
||||||
|
cx.listener(move |this, _event, _, cx| {
|
||||||
|
this.change_provides_filter(Some(provides), cx);
|
||||||
|
})
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
.style(if self.provides_filter == Some(provides) {
|
|
||||||
ButtonStyle::Filled
|
|
||||||
} else {
|
|
||||||
ButtonStyle::Subtle
|
|
||||||
})
|
|
||||||
.toggle_state(self.provides_filter == Some(provides))
|
|
||||||
.on_click({
|
|
||||||
cx.listener(move |this, _event, _, cx| {
|
|
||||||
this.change_provides_filter(Some(provides), cx);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
.child(self.render_feature_upsells(cx))
|
.child(self.render_feature_upsells(cx))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue