diff --git a/crates/pinakes-plugin-api/src/ui_schema.rs b/crates/pinakes-plugin-api/src/ui_schema.rs index f6c1e8d..783237e 100644 --- a/crates/pinakes-plugin-api/src/ui_schema.rs +++ b/crates/pinakes-plugin-api/src/ui_schema.rs @@ -230,6 +230,37 @@ impl UiPage { } } +/// A widget that plugins can inject into existing host pages. +/// +/// Widgets differ from pages in that they are embedded at a specific +/// `target` location within built-in views rather than occupying a full page. +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct UiWidget { + /// Unique identifier for this widget within the plugin + pub id: String, + + /// Target injection point (matches `widget_location` constants) + pub target: String, + + /// Content to render at the injection point + pub content: UiElement, +} + +/// String constants for widget injection locations. +/// +/// Use these with `UiWidget::target` in plugin manifests: +/// ```toml +/// [[ui.widgets]] +/// id = "my-widget" +/// target = "library_header" +/// ``` +pub mod widget_location { + pub const LIBRARY_HEADER: &str = "library_header"; + pub const LIBRARY_SIDEBAR: &str = "library_sidebar"; + pub const DETAIL_PANEL: &str = "detail_panel"; + pub const SEARCH_FILTERS: &str = "search_filters"; +} + /// Core UI element enum - the building block of all plugin UIs /// /// Elements are categorized into groups: