user: InteractScreen extracted, all screens use ScreenView trait

InteractScreen in chat.rs owns conversation/autonomous/tools panes,
textarea, input history, scroll state. App is now just shared state
(status, sampling params, agent_state, channel_status, idle_info).

Event loop holds InteractScreen separately for UiMessage routing.
Overlay screens (F2-F5) in screens vec. F-key switching preserves
state across screen changes.

handle_ui_message moved from App to InteractScreen.
handle_key split: global keys on App, screen keys in tick().
draw dispatch eliminated — each screen draws itself.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2026-04-05 18:57:54 -04:00
parent 8418bc9bc9
commit 68f115b880
8 changed files with 276 additions and 259 deletions

View file

@ -26,7 +26,7 @@ impl ScreenView for ThalamusScreen {
fn label(&self) -> &'static str { "thalamus" }
fn tick(&mut self, frame: &mut Frame, area: Rect,
key: Option<KeyEvent>, app: &App) -> Option<ScreenAction> {
key: Option<KeyEvent>, app: &mut App) -> Option<ScreenAction> {
// Handle keys
if let Some(key) = key {
match key.code {