Track window area and refactor keybinding APIs

- Track terminal size in `App::window_area` and update on resize
- Accept action slices in `count_largest_group` and
  `KeybindingsWidget::new`
- Add ACTIONS slices and layout helpers for default, main_menu, skirmish
- Add `main_menu_option_helper` for formatting menu strings and export
  it
This commit is contained in:
GarandPLG committed 2026-04-01 20:27:50 +02:00
1 parent bf8883934d
commit f405c3cde1
8 files changed
+82 -60

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
pub fn main_menu_option_helper(s: String) -> String {
if let Some(pos) = s
.char_indices()
.filter(|(_, c)| c.is_ascii_uppercase())
.nth(1)
.map(|(i, _)| i)
{
let (first, second) = s.split_at(pos);
format!("{first} {second}")
} else {
s
}
}