tui: settings change propagation via EventBus #123

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

User story

As a user, I want settings changes (backend URL, plugin selection, generation defaults) to take effect immediately across all screens, so that I don't have to restart the app or navigate back and forth.

Problem

The Settings screen saves to disk via loom_core::config::save_settings() and updates the shared Arc<RwLock<AppSettings>>, but no event is published. Other screens read ctx.settings but have no trigger to re-read or react to changes. Specifically:

  • Changing generation_plugin/generation_backend doesn't reconfigure the PluginBridge
  • Changing browsing_plugins doesn't refresh the Model Browser's source list
  • Changing sharing_plugins doesn't update the Sharing overlay's platform availability
  • Changing prompt_plugin doesn't affect AI job dispatch

Acceptance criteria

  • Add LoomEvent::SettingsChanged variant to the event bus
  • Settings screen publishes SettingsChanged after each successful save
  • App-level handler for SettingsChanged:
    • Reconfigures PluginBridge generation backend if generation_plugin/generation_backend changed
    • Calls bridge.set_browsing_plugins() if browsing_plugins changed
    • Calls bridge.set_sharing_plugins() if sharing_plugins changed
    • Calls bridge.set_prompt_plugin() if prompt_plugin changed
  • Model Browser screen refreshes its source configuration on SettingsChanged
  • Generate screen picks up new default resolution/preset on SettingsChanged

Out of scope

  • Hot-reloading tui.toml (keybinds, navigation preset) — requires app restart
  • Settings sync between GTK and TUI frontends

References

  • crates/loom-tui/src/screens/settings.rsapply_edit(), toggle_bool()
  • crates/loom-core/src/event_bus.rsLoomEvent enum
  • crates/loom-tui/src/main.rsbootstrap_core() plugin configuration sequence
## User story As a user, I want settings changes (backend URL, plugin selection, generation defaults) to take effect immediately across all screens, so that I don't have to restart the app or navigate back and forth. ## Problem The Settings screen saves to disk via `loom_core::config::save_settings()` and updates the shared `Arc<RwLock<AppSettings>>`, but no event is published. Other screens read `ctx.settings` but have no trigger to re-read or react to changes. Specifically: - Changing `generation_plugin`/`generation_backend` doesn't reconfigure the PluginBridge - Changing `browsing_plugins` doesn't refresh the Model Browser's source list - Changing `sharing_plugins` doesn't update the Sharing overlay's platform availability - Changing `prompt_plugin` doesn't affect AI job dispatch ## Acceptance criteria - [ ] Add `LoomEvent::SettingsChanged` variant to the event bus - [ ] Settings screen publishes `SettingsChanged` after each successful save - [ ] App-level handler for `SettingsChanged`: - Reconfigures PluginBridge generation backend if `generation_plugin`/`generation_backend` changed - Calls `bridge.set_browsing_plugins()` if `browsing_plugins` changed - Calls `bridge.set_sharing_plugins()` if `sharing_plugins` changed - Calls `bridge.set_prompt_plugin()` if `prompt_plugin` changed - [ ] Model Browser screen refreshes its source configuration on `SettingsChanged` - [ ] Generate screen picks up new default resolution/preset on `SettingsChanged` ## Out of scope - Hot-reloading `tui.toml` (keybinds, navigation preset) — requires app restart - Settings sync between GTK and TUI frontends ## References - `crates/loom-tui/src/screens/settings.rs` — `apply_edit()`, `toggle_bool()` - `crates/loom-core/src/event_bus.rs` — `LoomEvent` enum - `crates/loom-tui/src/main.rs` — `bootstrap_core()` plugin configuration sequence
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#123
No description provided.