rendering
This commit is contained in:
parent
36d698a3e1
commit
49cd6d6ab6
8 changed files with 178 additions and 157 deletions
|
|
@ -760,11 +760,14 @@ impl ScreenView for InteractScreen {
|
|||
fn label(&self) -> &'static str { "interact" }
|
||||
|
||||
fn tick(&mut self, frame: &mut Frame, area: Rect,
|
||||
key: Option<KeyEvent>, app: &mut App) -> Option<ScreenAction> {
|
||||
// Handle keys
|
||||
if let Some(key) = key {
|
||||
events: &[ratatui::crossterm::event::Event], app: &mut App) {
|
||||
use ratatui::crossterm::event::Event;
|
||||
// Handle events
|
||||
for event in events {
|
||||
match event {
|
||||
Event::Key(key) if key.kind == ratatui::crossterm::event::KeyEventKind::Press => {
|
||||
match key.code {
|
||||
KeyCode::Esc => return Some(ScreenAction::Hotkey(HotkeyAction::Interrupt)),
|
||||
KeyCode::Esc => { let _ = self.mind_tx.send(crate::mind::MindCommand::Interrupt); }
|
||||
KeyCode::Enter if !key.modifiers.contains(KeyModifiers::ALT) && !key.modifiers.contains(KeyModifiers::SHIFT) => {
|
||||
let input: String = self.textarea.lines().join("\n");
|
||||
if !input.is_empty() {
|
||||
|
|
@ -809,7 +812,11 @@ impl ScreenView for InteractScreen {
|
|||
ActivePane::Conversation => ActivePane::Autonomous,
|
||||
};
|
||||
}
|
||||
_ => { self.textarea.input(key); }
|
||||
_ => { self.textarea.input(*key); }
|
||||
}
|
||||
}
|
||||
Event::Mouse(mouse) => { self.handle_mouse(*mouse); }
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -835,7 +842,6 @@ impl ScreenView for InteractScreen {
|
|||
|
||||
// Draw
|
||||
self.draw_main(frame, area, app);
|
||||
None
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue