Add Settings view, widget, and keybindings

Introduce Settings view handling in key events and widgets.
Add `Enter` action with its keybinding.
Refactor keybinding lookup to use `Option<&KeyBinding>` for missing
entries.
Update view option generation to safely filter possible values.
Export `settings_keybindings` and `settings_widget` from their modules.
This commit is contained in:
2026-03-13 09:31:55 +01:00
parent 7226a09bb4
commit d563bbc966
9 changed files with 123 additions and 27 deletions
+16
View File
@@ -0,0 +1,16 @@
use crate::app::{
App, View,
keybindings::{Action, event_to_action},
};
use ratatui::crossterm::event::KeyEvent;
pub fn settings_keybindings(app: &mut App, key_event: &KeyEvent) {
if let Some(action) = event_to_action(&key_event) {
match action {
Action::Quit => app.exit = true,
Action::Quit2 => app.exit = true,
Action::Esc => app.view = View::MainMenu,
_ => (),
}
}
}