Add arrow key support for folder navigation
All checks were successful
Build and Release / build-and-release (push) Successful in 54s

Add Left/Right arrow keys as alternatives to h/l for collapsing
and expanding folders in the file panel. Provides more intuitive
navigation for users not familiar with vim keybindings.

- Left arrow: Collapse selected folder (same as 'h')
- Right arrow: Expand selected folder (same as 'l')
This commit is contained in:
Christoffer Martinsson 2025-12-11 15:37:28 +01:00
parent b59d1aed65
commit 3e7707e883
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "cm-player"
version = "0.1.20"
version = "0.1.21"
edition = "2021"
[dependencies]

View File

@ -626,12 +626,12 @@ async fn handle_key_event<B: ratatui::backend::Backend>(terminal: &mut Terminal<
state.move_selection_down();
}
}
(KeyCode::Char('h'), _) => {
(KeyCode::Char('h'), _) | (KeyCode::Left, _) => {
if !state.focus_playlist {
state.collapse_selected();
}
}
(KeyCode::Char('l'), _) => {
(KeyCode::Char('l'), _) | (KeyCode::Right, _) => {
if !state.focus_playlist {
state.expand_selected();
}