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:
GarandPLG committed 2026-03-13 09:31:55 +01:00
1 parent 7226a09bb4
commit d563bbc966
9 files changed
+123 -27

No files matched your search

+9 -3
View File
@@ -26,9 +26,15 @@ impl KeybindingsWidget {
let grouped_lines: Vec<Line<'_>> = keybindings
.iter()
.filter(|b| b.group == group)
.map(|b| {
Line::from_iter([b.symbol.red().bold(), " - ".into(), b.description.into()])
.filter(|b| b.as_ref().map_or(false, |kb| kb.group == group))
.filter_map(|b| {
b.as_ref().map(|kb| {
Line::from_iter([
kb.symbol.red().bold(),
" - ".into(),
kb.description.into(),
])
})
})
.collect();