2026-04-03 19:30:26 -04:00
|
|
|
// thalamus_screen.rs — F5: presence, idle state, and channel status
|
2026-04-03 17:25:59 -04:00
|
|
|
|
|
|
|
|
use ratatui::{
|
|
|
|
|
layout::Rect,
|
|
|
|
|
style::{Color, Style},
|
2026-04-03 18:46:14 -04:00
|
|
|
text::{Line, Span},
|
2026-04-03 17:25:59 -04:00
|
|
|
widgets::{Block, Borders, Paragraph, Wrap},
|
|
|
|
|
Frame,
|
2026-04-06 19:33:18 -04:00
|
|
|
crossterm::event::KeyCode,
|
2026-04-03 17:25:59 -04:00
|
|
|
};
|
|
|
|
|
|
2026-04-06 19:33:18 -04:00
|
|
|
use super::{App, ScreenView, screen_legend};
|
2026-04-03 17:25:59 -04:00
|
|
|
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
pub(crate) struct ThalamusScreen {
|
|
|
|
|
sampling_selected: usize,
|
|
|
|
|
scroll: u16,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl ThalamusScreen {
|
|
|
|
|
pub fn new() -> Self {
|
|
|
|
|
Self { sampling_selected: 0, scroll: 0 }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl ScreenView for ThalamusScreen {
|
|
|
|
|
fn label(&self) -> &'static str { "thalamus" }
|
|
|
|
|
|
|
|
|
|
fn tick(&mut self, frame: &mut Frame, area: Rect,
|
2026-04-05 23:04:10 -04:00
|
|
|
events: &[ratatui::crossterm::event::Event], app: &mut App) {
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
// Handle keys
|
2026-04-05 23:04:10 -04:00
|
|
|
for event in events {
|
|
|
|
|
if let ratatui::crossterm::event::Event::Key(key) = event {
|
|
|
|
|
if key.kind != ratatui::crossterm::event::KeyEventKind::Press { continue; }
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
match key.code {
|
|
|
|
|
KeyCode::Up => { self.sampling_selected = self.sampling_selected.saturating_sub(1); }
|
|
|
|
|
KeyCode::Down => { self.sampling_selected = (self.sampling_selected + 1).min(2); }
|
|
|
|
|
KeyCode::Right => {
|
2026-04-07 13:55:30 -04:00
|
|
|
let _delta = match self.sampling_selected {
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
0 => 0.05, 1 => 0.05, 2 => 5.0, _ => 0.0,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
KeyCode::Left => {
|
2026-04-07 13:55:30 -04:00
|
|
|
let _delta = match self.sampling_selected {
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
0 => -0.05, 1 => -0.05, 2 => -5.0, _ => 0.0,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
_ => {}
|
|
|
|
|
}
|
2026-04-05 23:04:10 -04:00
|
|
|
}
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Draw
|
2026-04-03 17:25:59 -04:00
|
|
|
let section = Style::default().fg(Color::Yellow);
|
2026-04-03 18:46:14 -04:00
|
|
|
let dim = Style::default().fg(Color::DarkGray);
|
2026-04-03 17:25:59 -04:00
|
|
|
let mut lines: Vec<Line> = Vec::new();
|
2026-04-03 18:46:14 -04:00
|
|
|
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
// Presence / idle state
|
2026-04-03 19:30:26 -04:00
|
|
|
lines.push(Line::styled("── Presence ──", section));
|
|
|
|
|
lines.push(Line::raw(""));
|
|
|
|
|
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
if let Some(ref idle) = app.idle_info {
|
2026-04-03 19:30:26 -04:00
|
|
|
let presence = if idle.user_present {
|
|
|
|
|
Span::styled("present", Style::default().fg(Color::Green))
|
|
|
|
|
} else {
|
|
|
|
|
Span::styled("away", Style::default().fg(Color::DarkGray))
|
|
|
|
|
};
|
|
|
|
|
lines.push(Line::from(vec![
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
Span::raw(" User: "), presence,
|
2026-04-03 19:30:26 -04:00
|
|
|
Span::raw(format!(" (last {:.0}s ago)", idle.since_activity)),
|
|
|
|
|
]));
|
|
|
|
|
lines.push(Line::raw(format!(" Activity: {:.1}%", idle.activity_ewma * 100.0)));
|
|
|
|
|
lines.push(Line::raw(format!(" Idle state: {}", idle.block_reason)));
|
|
|
|
|
if idle.dreaming {
|
|
|
|
|
lines.push(Line::styled(" ◆ dreaming", Style::default().fg(Color::Magenta)));
|
|
|
|
|
}
|
|
|
|
|
if idle.sleeping {
|
|
|
|
|
lines.push(Line::styled(" ◆ sleeping", Style::default().fg(Color::Blue)));
|
2026-04-03 18:46:14 -04:00
|
|
|
}
|
2026-04-03 19:30:26 -04:00
|
|
|
} else {
|
|
|
|
|
lines.push(Line::styled(" not initialized", dim));
|
2026-04-03 18:46:14 -04:00
|
|
|
}
|
2026-04-03 19:30:26 -04:00
|
|
|
lines.push(Line::raw(""));
|
2026-04-03 18:46:14 -04:00
|
|
|
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
// Sampling parameters
|
2026-04-04 14:06:42 -04:00
|
|
|
lines.push(Line::styled("── Sampling (←/→ adjust) ──", section));
|
2026-04-04 13:48:24 -04:00
|
|
|
lines.push(Line::raw(""));
|
2026-04-04 14:06:42 -04:00
|
|
|
let params = [
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
format!("temperature: {:.2}", app.temperature),
|
|
|
|
|
format!("top_p: {:.2}", app.top_p),
|
|
|
|
|
format!("top_k: {}", app.top_k),
|
2026-04-04 14:06:42 -04:00
|
|
|
];
|
|
|
|
|
for (i, label) in params.iter().enumerate() {
|
|
|
|
|
let prefix = if i == self.sampling_selected { "▸ " } else { " " };
|
|
|
|
|
let style = if i == self.sampling_selected {
|
|
|
|
|
Style::default().fg(Color::Cyan)
|
|
|
|
|
} else {
|
|
|
|
|
Style::default()
|
|
|
|
|
};
|
|
|
|
|
lines.push(Line::styled(format!("{}{}", prefix, label), style));
|
|
|
|
|
}
|
2026-04-04 13:48:24 -04:00
|
|
|
lines.push(Line::raw(""));
|
|
|
|
|
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
// Channel status
|
2026-04-03 18:46:14 -04:00
|
|
|
lines.push(Line::styled("── Channels ──", section));
|
2026-04-03 17:25:59 -04:00
|
|
|
lines.push(Line::raw(""));
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
if app.channel_status.is_empty() {
|
2026-04-03 18:46:14 -04:00
|
|
|
lines.push(Line::styled(" no channels configured", dim));
|
|
|
|
|
} else {
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
for ch in &app.channel_status {
|
|
|
|
|
let (symbol, color) = if ch.connected { ("●", Color::Green) } else { ("○", Color::Red) };
|
|
|
|
|
let unread_str = if ch.unread > 0 { format!(" ({} unread)", ch.unread) } else { String::new() };
|
2026-04-03 18:46:14 -04:00
|
|
|
lines.push(Line::from(vec![
|
|
|
|
|
Span::raw(" "),
|
|
|
|
|
Span::styled(symbol, Style::default().fg(color)),
|
2026-04-03 19:05:48 -04:00
|
|
|
Span::raw(format!(" {:<24}", ch.name)),
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
Span::styled(if ch.connected { "connected" } else { "disconnected" }, Style::default().fg(color)),
|
2026-04-03 19:05:48 -04:00
|
|
|
Span::styled(unread_str, Style::default().fg(Color::Yellow)),
|
2026-04-03 18:46:14 -04:00
|
|
|
]));
|
|
|
|
|
}
|
2026-04-03 17:25:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let block = Block::default()
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
.title_top(Line::from(screen_legend()).left_aligned())
|
2026-04-03 17:25:59 -04:00
|
|
|
.title_top(Line::from(" thalamus ").right_aligned())
|
|
|
|
|
.borders(Borders::ALL)
|
|
|
|
|
.border_style(Style::default().fg(Color::Cyan));
|
|
|
|
|
|
|
|
|
|
let para = Paragraph::new(lines)
|
|
|
|
|
.block(block)
|
|
|
|
|
.wrap(Wrap { trim: false })
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
.scroll((self.scroll, 0));
|
2026-04-03 17:25:59 -04:00
|
|
|
|
user: ScreenView trait, overlay screens extracted from App
Convert F2-F5 screens to ScreenView trait with tick() method.
Each screen owns its view state (scroll, selection, expanded).
State persists across screen switches.
- ThalamusScreen: owns sampling_selected, scroll
- ConsciousScreen: owns scroll, selected, expanded
- SubconsciousScreen: owns selected, log_view, scroll
- UnconsciousScreen: owns scroll
Removed from App: Screen enum, debug_scroll, debug_selected,
debug_expanded, agent_selected, agent_log_view, sampling_selected,
set_screen(), per-screen key handling, draw dispatch.
App now only draws the interact (F1) screen. Overlay screens are
drawn by the event loop via ScreenView::tick. F-key routing and
screen instantiation to be wired in event_loop next.
InteractScreen (state-driven, reading from agent entries) is the
next step — will eliminate the input display race condition.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-04-05 17:54:40 -04:00
|
|
|
frame.render_widget(para, area);
|
2026-04-03 17:25:59 -04:00
|
|
|
}
|
|
|
|
|
}
|