feat(tui): app-level event loop and state machine #49
No reviewers
Labels
No labels
area:agents
area:ai
area:config
area:dashboard
area:design
area:design-review
area:devtools
area:entities
area:gallery
area:generate
area:image
area:infra
area:meta
area:model-browser
area:navigation
area:presets
area:security
area:sessions
area:settings
area:sharing
area:test
area:ux
area:webhook
area:workdir
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/loom!49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "tui/event-loop-16"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Second PR in the loom-tui stack. Replaces the scaffold's one-off loop with a unified event model and a top-level
Appstate machine that screens and overlays plug into.Stacks on #48 (scaffold). Closes charles/loom#16.
What's in
event::Eventunifies keyboard/mouse/paste/focus/resize +Tick+CoreMsg(LoomEvent)+Quit/CoreLagevent::EventStreammerges crossterm input, a 250 msTick, and an optionaltokio::sync::broadcastsubscription fromloom_core::event_bus::EventBusinto one awaitable source. Test-onlynew_headlessskips the crossterm readerapp::Appholds a screen map (lazy-constructed), an overlay stack, atokio::sync::mpsc::UnboundedChannel<AppAction>for screens to enqueue navigation / overlay / quit / redraw requests, and a dirty flag so unchanged frames aren't re-drawnscreens::Screentrait +ScreenKindenum +StubScreenplaceholders for all six top-level screens (Generate, Gallery, ModelBrowser, Entities, Presets, Settings). Later tickets replace the stubsapp::Overlaytrait +OverlayKind::Help+ a minimalHelpOverlayso the overlay dispatch chain is live end-to-end (push on?, pop onEsc)q/Ctrl+Cquit,?help,g n m e p snavigate)Out of scope
tui.tomlconfig loading (#43)PluginBridge/EventBusare NOT yet constructed and wired throughAppCtx— that happens once navigation + config land.EventStream::new(None)reflects this.Test plan
cargo test -p loom-tui— 8 tests pass (event tick/quit/core, app navigate/quit/overlay)cargo clippy -p loom-tui --all-targets -- -D warningscleanjust qagreencargo run -p loom-tui, verify?opens help,Esccloses,gnavigates to Gallery stub,qexitsNotes
AppAction::Navigate / PushOverlay / Quit / Redrawvariants carry#[allow(dead_code)]in this PR because onlyPopOverlayis wired so far. They come online in tickets #17/#18/#42Eventvariants carry the same allow for the same reasonScreen::kind()is unused in the dispatch chain but kept on the trait so #17's sidebar can ask "which screen is this trait object?" without downcasting