feat(tui): bootstrap loom-core — plugin registry, storage & event bus #97

Merged
claude-desktop merged 1 commit from tui/bootstrap-84 into main 2026-04-12 15:36:22 +00:00
Collaborator

Summary

  • Initialize loom-core services at TUI startup: PluginBridge, GalleryStorage (SQLite), EventBus, JobQueue, and AppSettings
  • Bundle all handles in CoreHandles and thread to every screen via AppCtx
  • Bootstrap is non-fatal: if init fails, TUI runs in degraded UI-only mode with a notification
  • EventStream now receives the EventBus broadcast subscription for core event routing

Test plan

  • All 113 existing tests pass (no regressions)
  • cargo clippy -p loom-tui -- -D warnings clean
  • Full just qa passes
  • Manual: loom-tui starts and shows screens with/without A1111 backend running

Closes charles/loom#84

🤖 Generated with Claude Code

## Summary - Initialize loom-core services at TUI startup: `PluginBridge`, `GalleryStorage` (SQLite), `EventBus`, `JobQueue`, and `AppSettings` - Bundle all handles in `CoreHandles` and thread to every screen via `AppCtx` - Bootstrap is non-fatal: if init fails, TUI runs in degraded UI-only mode with a notification - `EventStream` now receives the `EventBus` broadcast subscription for core event routing ## Test plan - [x] All 113 existing tests pass (no regressions) - [x] `cargo clippy -p loom-tui -- -D warnings` clean - [x] Full `just qa` passes - [ ] Manual: `loom-tui` starts and shows screens with/without A1111 backend running Closes charles/loom#84 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(tui): bootstrap loom-core — plugin registry, storage & event bus
All checks were successful
QA / qa (pull_request) Successful in 26m53s
0ac244d482
Initialize loom-core services at TUI startup: PluginBridge, GalleryStorage
(SQLite), EventBus, JobQueue, and AppSettings. All handles are bundled in
CoreHandles and threaded to every screen via AppCtx.

Bootstrap is non-fatal: if loom-core init fails the TUI runs in degraded
UI-only mode with a notification. Plugin discovery, loading, and backend
configuration happen before the terminal is entered so errors surface
cleanly.

Closes charles/loom#84

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
Collaborator

Review — PR #97: bootstrap loom-core

Overall: solid. Clean bootstrap sequence with correct error handling (fatal vs degraded). A few notes:

Observation

  • ctx() in the None (degraded) arm creates fresh Arc<RwLock<AppSettings>> and Arc<RwLock<JobQueue>> on every call. Since ctx() is called per-event, this allocates throwaway Arcs in a loop. Consider storing default handles once in App (e.g. a lazy degraded_settings: Arc<RwLock<AppSettings>> field) so ctx() just clones the Arc.

Nit

  • drop(renderer) was removed from run() — the renderer now lives inside CoreHandles and gets dropped with App. This is fine, but the flush comment was useful context. Consider a brief comment on CoreHandles noting that drop order matters for the renderer's session cleanup.

Cross-PR concern

  • Multiple downstream PRs (#101, #107, #109) change AppHandle.tx from tx to pub(crate) tx independently. Since they all target tui/image-ctx-85, you'll hit merge conflicts. Consider making that visibility change in this PR or #98 so the downstream ones don't each repeat it.

LGTM with the above as optional improvements.

## Review — PR #97: bootstrap loom-core **Overall: solid.** Clean bootstrap sequence with correct error handling (fatal vs degraded). A few notes: ### Observation - `ctx()` in the `None` (degraded) arm creates **fresh `Arc<RwLock<AppSettings>>` and `Arc<RwLock<JobQueue>>`** on every call. Since `ctx()` is called per-event, this allocates throwaway Arcs in a loop. Consider storing default handles once in `App` (e.g. a lazy `degraded_settings: Arc<RwLock<AppSettings>>` field) so `ctx()` just clones the Arc. ### Nit - `drop(renderer)` was removed from `run()` — the renderer now lives inside `CoreHandles` and gets dropped with `App`. This is fine, but the flush comment was useful context. Consider a brief comment on `CoreHandles` noting that drop order matters for the renderer's session cleanup. ### Cross-PR concern - Multiple downstream PRs (#101, #107, #109) change `AppHandle.tx` from `tx` to `pub(crate) tx` independently. Since they all target `tui/image-ctx-85`, you'll hit merge conflicts. Consider making that visibility change in this PR or #98 so the downstream ones don't each repeat it. LGTM with the above as optional improvements.
claude-desktop deleted branch tui/bootstrap-84 2026-04-12 15:36:23 +00:00
Sign in to join this conversation.
No reviewers
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!97
No description provided.