tui: plugin lifecycle events — screens react to plugin load/unload #126

Closed
opened 2026-04-12 22:03:15 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As a user, I want the Model Browser and Sharing overlay to update automatically when plugins are loaded or unloaded, so that available backends and sharing platforms are always current.

Problem

Plugin discovery runs once at startup in bootstrap_core(). If a plugin fails to load and is later retried (or a new plugin is added to the plugins directory), no screen is notified. The Model Browser shows stale source availability, and the Sharing overlay may offer platforms whose plugins aren't loaded.

Acceptance criteria

  • Add LoomEvent::PluginLoaded { plugin_id } and LoomEvent::PluginUnloaded { plugin_id } to the event bus
  • PluginBridge::load_plugin() and unload_plugin() publish these events
  • Model Browser screen handles PluginLoaded/PluginUnloaded — refreshes available sources
  • Sharing overlay checks plugin availability on open (already does credential check, add plugin check)
  • Settings screen's "Generation plugin" field validates against loaded plugins
  • Generate screen re-checks backend availability on PluginLoaded

Out of scope

  • Hot-reloading plugin Lua code without restart
  • Plugin marketplace / auto-install

References

  • crates/loom-core/src/plugin/bridge.rsload_plugin(), unload_plugin()
  • crates/loom-core/src/event_bus.rsLoomEvent enum
  • crates/loom-tui/src/screens/model_browser.rs — source tab handling
  • crates/loom-tui/src/components/sharing.rs — platform availability
## User story As a user, I want the Model Browser and Sharing overlay to update automatically when plugins are loaded or unloaded, so that available backends and sharing platforms are always current. ## Problem Plugin discovery runs once at startup in `bootstrap_core()`. If a plugin fails to load and is later retried (or a new plugin is added to the plugins directory), no screen is notified. The Model Browser shows stale source availability, and the Sharing overlay may offer platforms whose plugins aren't loaded. ## Acceptance criteria - [ ] Add `LoomEvent::PluginLoaded { plugin_id }` and `LoomEvent::PluginUnloaded { plugin_id }` to the event bus - [ ] `PluginBridge::load_plugin()` and `unload_plugin()` publish these events - [ ] Model Browser screen handles `PluginLoaded`/`PluginUnloaded` — refreshes available sources - [ ] Sharing overlay checks plugin availability on open (already does credential check, add plugin check) - [ ] Settings screen's "Generation plugin" field validates against loaded plugins - [ ] Generate screen re-checks backend availability on `PluginLoaded` ## Out of scope - Hot-reloading plugin Lua code without restart - Plugin marketplace / auto-install ## References - `crates/loom-core/src/plugin/bridge.rs` — `load_plugin()`, `unload_plugin()` - `crates/loom-core/src/event_bus.rs` — `LoomEvent` enum - `crates/loom-tui/src/screens/model_browser.rs` — source tab handling - `crates/loom-tui/src/components/sharing.rs` — platform availability
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/loom#126
No description provided.