From 2731a3a878cca4ae437fb37b46f4ddd617da1c1d Mon Sep 17 00:00:00 2001 From: vikingowl Date: Tue, 30 Sep 2025 01:10:29 +0200 Subject: [PATCH] Add `j`/`k` shortcuts for scrolling and update help instructions in TUI fixes #18 --- crates/owlen-tui/src/chat_app.rs | 6 ++++-- crates/owlen-tui/src/ui.rs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/owlen-tui/src/chat_app.rs b/crates/owlen-tui/src/chat_app.rs index b16ff73..caad429 100644 --- a/crates/owlen-tui/src/chat_app.rs +++ b/crates/owlen-tui/src/chat_app.rs @@ -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) => { diff --git a/crates/owlen-tui/src/ui.rs b/crates/owlen-tui/src/ui.rs index a998c19..b269f24 100644 --- a/crates/owlen-tui/src/ui.rs +++ b/crates/owlen-tui/src/ui.rs @@ -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"),