Add j/k shortcuts for scrolling and update help instructions in TUI

fixes #18
This commit is contained in:
2025-09-30 01:10:29 +02:00
parent 8409bf646a
commit 2731a3a878
2 changed files with 6 additions and 2 deletions

View File

@@ -328,10 +328,12 @@ impl ChatApp {
self.mode = InputMode::Editing;
self.sync_buffer_to_textarea();
}
(KeyCode::Up, KeyModifiers::NONE) => {
(KeyCode::Up, KeyModifiers::NONE)
| (KeyCode::Char('k'), KeyModifiers::NONE) => {
self.on_scroll(-1isize);
}
(KeyCode::Down, KeyModifiers::NONE) => {
(KeyCode::Down, KeyModifiers::NONE)
| (KeyCode::Char('j'), KeyModifiers::NONE) => {
self.on_scroll(1isize);
}
(KeyCode::Esc, KeyModifiers::NONE) => {

View File

@@ -849,6 +849,8 @@ fn render_help(frame: &mut Frame<'_>) {
Line::from(" i / Enter → start typing"),
Line::from(" Enter → send message"),
Line::from(" Ctrl+J → newline"),
Line::from(" j / ↓ → scroll down"),
Line::from(" k / ↑ → scroll up"),
Line::from(" m → select model"),
Line::from(" n → new conversation"),
Line::from(" c → clear conversation"),