extensions_ui: Add ability to open the extensions view with a pre-selected filter (#27093)

This PR adds the ability to open the extensions view via the `zed:
extensions` action with a pre-selected filter.

The "Install Themes" and "Install Icon Themes" buttons in their
respective selectors take advantage of this to set the filter when
opening the view:


https://github.com/user-attachments/assets/2e345c0f-418a-47b6-811e-cabae6c616d1

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-03-19 13:26:46 -04:00 committed by GitHub
parent d51cd15e4d
commit d722067000
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 107 additions and 33 deletions

View file

@ -35,12 +35,32 @@ actions!(
Quit,
OpenKeymap,
About,
Extensions,
OpenLicenses,
OpenTelemetryLog,
]
);
#[derive(PartialEq, Clone, Copy, Debug, Deserialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExtensionCategoryFilter {
Themes,
IconThemes,
Languages,
Grammars,
LanguageServers,
ContextServers,
SlashCommands,
IndexedDocsProviders,
Snippets,
}
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema)]
pub struct Extensions {
/// Filters the extensions page down to extensions that are in the specified category.
#[serde(default)]
pub category_filter: Option<ExtensionCategoryFilter>,
}
#[derive(PartialEq, Clone, Default, Debug, Deserialize, JsonSchema)]
pub struct DecreaseBufferFontSize {
#[serde(default)]
@ -80,6 +100,7 @@ pub struct ResetUiFontSize {
impl_actions!(
zed,
[
Extensions,
DecreaseBufferFontSize,
IncreaseBufferFontSize,
ResetBufferFontSize,