feat: configurable tab labels and search nouns from plugin metadata

Script plugins can now declare tab_label and search_noun in their
plugin.toml [[providers]] section. These flow through the Provider
trait, IPC ProviderDesc, and into the UI via provider_meta::resolve().
Unknown plugins auto-generate labels from type_id instead of showing
a generic "Plugin" label.
This commit is contained in:
2026-04-09 21:16:36 +02:00
parent 34d156fb7d
commit 774b2a4700
21 changed files with 358 additions and 90 deletions

View File

@@ -41,6 +41,8 @@ pub struct ScriptProviderInfo {
pub default_icon: RString,
pub is_static: bool,
pub prefix: owlry_plugin_api::ROption<RString>,
pub tab_label: owlry_plugin_api::ROption<RString>,
pub search_noun: owlry_plugin_api::ROption<RString>,
}
// Type alias for backwards compatibility
@@ -273,6 +275,14 @@ impl Provider for RuntimeProvider {
fn items(&self) -> &[LaunchItem] {
&self.items
}
fn tab_label(&self) -> Option<&str> {
self.info.tab_label.as_ref().map(|s| s.as_str()).into()
}
fn search_noun(&self) -> Option<&str> {
self.info.search_noun.as_ref().map(|s| s.as_str()).into()
}
}
// RuntimeProvider is Send + Sync because: