Refactor keybinding handling and update widgets

- Remove the old `keybindings.rs` and stop re‑exporting its symbols.
- Add view‑specific handling: `App::handle_key_event` now delegates to
  `main_menu_keybindings` when the view is `MainMenu`.
- Update imports in `app.rs`, `widget.rs`, and widget modules to use the
  new `app::keybindings` path.
- Enhance `keybindings_widget` to display ↑, ↓ and “Space” for special
  keys.
- Change main menu layout percentages from 90/10 to 87/13.
- Reorder the `clap` import in `cli.rs` for consistency.
This commit is contained in:
2026-03-10 16:29:27 +01:00
parent de42569a51
commit ec1aa4fbe8
10 changed files with 112 additions and 65 deletions
+14
View File
@@ -0,0 +1,14 @@
use crate::app::{
App,
keybindings::{Action, event_to_action},
};
use ratatui::crossterm::event::KeyEvent;
pub fn main_menu_keybindings(app: &mut App, event: &KeyEvent) {
if let Some(action) = event_to_action(&event) {
match action {
Action::Quit => app.exit = true,
_ => (),
}
}
}