Rename the generic `Event` enum to `AppEvent` and propagate the change
through `app.rs`, `mod.rs`, and `main.rs`. Adjust function signatures,
imports, and channel usage to use the new name and the `read` helper
from crossterm. Ensure all senders/receivers now work with `AppEvent`.
App now stores CLI arguments and an optional GameStates, initializing
the
states lazily on the first window resize. Skirmish board logic is moved
to
a new BoardState module with dedicated helpers (cells_area_helper and
updated cell size handling). Views and keybindings are updated to use
the
optional state accessors.
Extract Offset and FocusedCell structs from skirmish.rs into a new
skirmish_states module. Re-export the structs from the top-level states
module and adjust imports in skirmish.rs.
- 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
Introduce a new `zoom_level` module containing the `CellSizes` enum and
`cell_size_helper` function to map `ZoomLevel` values to width and
height
dimensions. Export the helper from `mod.rs` and refactor `BoardWidget`
to
import and use `cell_size_helper`, eliminating duplicated match
statements.
- Initialize FocusedCell with map dimensions and start near the map
centre.
- Store max rows/cols in FocusedCell and clamp moves to these bounds.
- Scroll actions now adjust the corresponding offset and also move the
focused cell, keeping navigation consistent.
- Zoom actions modify the vertical offset to keep the view centered
after
changing zoom levels.
- Cell widget now uses a Padding widget with dynamic top padding based
on
the area height.
Introduce `col_to_letters` to convert a zero‑based column index into
Excel‑style
letters. Add `display_coords` that returns the column letters followed
by the
row number. Update `render` to use this formatted coordinate as the
block
title instead of the previous row/col placeholder.
Extensive doc comments were added to keybindings, CLI options, logging,
and
widget modules. The `count_largest_group` function was introduced to
compute
the largest group size among actions. CLI validation for
`skill_points_limit`
was broadened to a 90‑690 range. Imports and signatures for `Display`
were
adjusted accordingly.
Introduce ZoomIn/ZoomOut actions and a Zoom group with corresponding
keybindings.
Add a CLI option to set the initial zoom level and a ZoomLevel enum.
Expose a utility to compute the largest keybinding group size for layout
sizing.
Refactor board widget to adjust cell dimensions based on zoom level and
simplify offset calculations.
Update views to use the new layout sizing helper and integrate zoom
handling in skirmish logic.
Add `value_initiated` and `max_initiated` flags to prevent
repeated assignments. Provide `set_initial_value` for one‑time
initialisation and use it to centre the vertical offset when
creating the board widget. Remove stale comments on cell size constants.
Extracted common quit/esc handling into `common_keybindings`. Introduced
`Group::CtrlMovement` for Ctrl‑arrow keys and updated keybinding
definitions.
Removed duplicated quit logic in main_menu and skirmish modules. Bumped
clap to 4.6.0 and updated Cargo.lock. Added range‑checked parsers for
map
size, resources, supply limit, XP modifier and skill points in the CLI.
- Create `GameStates` from a `&Cli` and initialize the skirmish board in
`App::new`.
- Move map dimensions to `SkirmishState` and add a `board_cells` vector
populated by `CellWidget`s.
- Refactor `SettingsState` to store only user‑specific settings (fields
are cloned).
- Update `BoardWidget` to hold a reference to the cell vector and use
the new dimensions.
- Adjust CLI defaults: map width to 50 and map height to 25.
Introduce Offset type to track scroll positions and replace
ScrollbarState fields in SkirmishState
Update keybindings, App::draw, Widget impl, and BoardWidget::new
to use mutable references and the new Offset struct.
Adjust imports accordingly.
Introduce directional and scroll actions, update keybindings, add
scrollbar
state to SkirmishState, and render the board with a new BoardWidget.
Adjust CLI
defaults and layout heights accordingly.
Removed the settings UI and its keybinding logic, added a skirmish view
and corresponding keybindings, simplified the SettingsState to hold
skirmish configuration, updated module exports, and changed the CLI
default map height from 25 to 21. Also fixed the main menu selection
limit.
- Rename `GameMode::Frontlines` to `FrontLines`.
- Introduce `SettingsValue` enum and `SettingsOption` vector for
typed settings.
- Implement `Display` for `SettingsValue`, `GameMode`, and
`PerkDecks`.
- Enhance settings keybindings: navigation with Up/Down, value
parsing on Enter, and error messages.
- Update settings view to render options list, selection marker,
and popup with error feedback.
- Restyle main menu selector and keybindings widget title.
- Add required imports and minor layout adjustments.
The settings model now separates generic settings from game‑specific
fields by
introducing `GameSettingsState`. All game‑related fields are moved into
this
struct and `SettingsState` now holds a `game_settings` field.
Initialization in
`GameStates::new` is updated accordingly. The UI popup is rendered
directly
with added padding and a resized rectangle, and the unused `popup_area`
variable is removed.
Replace the old `GameStates` struct with a new `states` module, rename
the
field in `App` to `states`, and update construction to pass CLI args.
Remove the now‑unused `game_states.rs` file and adjust imports
accordingly.
Update keybinding definitions: change the wildcard symbol to "[All]" and
simplify the wildcard detection logic by dropping the modifiers check.
Introduce a `selected_setting_new_value` field in `SettingsState` and
initialize it.
Add `Backspace` and `WildCard(char)` actions with an `Input` group, and
corresponding keybindings.
Update `event_to_action` to map wildcard characters to
`Action::WildCard`.
Handle backspace and character input in `settings_keybindings` to edit
the new field.
Display the edited value in the settings popup and include the new
actions in the UI.
Views now pass a list of `Action` values to `KeybindingsWidget` instead
of
pre‑resolved `KeyBinding` references. The widget resolves the bindings
internally using `binding_for`, simplifying import statements and view
logic.
- Derive `ValueEnum` for `Group` and remove its custom `iter` method.
- Update keybindings widget to use `Group::value_variants()` and adjust
containment and filtering logic.
- Replace view option generation with a `format_view_string` helper that
inserts a space before the second capital letter, eliminating the
previous filter for “MAIN MENU”.
- Adjust imports to include `clap::ValueEnum` where needed.
Move the `View` enum to a dedicated module and implement `Widget` for
`&App` there.
Rename `default_view_keybindings` to `default_keybindings` and adjust
its
signature. Redesign `KeybindingsWidget` to accept an explicit list of
bindings instead of a `View`. Update imports, function signatures, and
rendering
logic across the codebase to reflect these changes.
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.
- Introduce `KeybindingsWidget::new(view)` constructor and remove the
standalone `keybindings_widget` function.
- Update all imports and call sites to use `KeybindingsWidget` directly.
- Reorder `Group` enum to place `Quit` after `Select` and adjust its
iterator accordingly.
Return the set of used groups from `binding_for_view` and adjust
`keybindings_widget` to render only those groups. Introduce a vertical
layout in the main widget to display a placeholder paragraph above
the keybindings area, and update imports and border logic accordingly.
Use `recv_timeout` to prevent UI blocking, forward terminal resize
events,
adjust keybinding width calculation, and replace percentage layout with
fill/length for the main menu.
Introduce a `Group` enum to categorize actions and add `group` and
`symbol`
fields to `KeyBinding`. Extend `Action` with `Up`, `Down`, `Space`, and
`Esc`, updating all keybinding definitions accordingly.
Update `binding_for_view` to return the new actions per view and handle
`Esc` by returning to the main menu.
Rewrite the keybindings widget as a custom `Widget` that renders grouped
paragraphs with proper layout.
Adjust the main menu layout percentages to accommodate the new widget.
- 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.
Replace the `default_window` string field with a `View` enum throughout
the
application. Introduce a new keybinding module providing `Action`,
`KeyBinding` structs and helper functions, and integrate a keybindings
widget
into the main menu. Update the CLI to accept a `View` value enum and
adjust
imports and event handling accordingly. Add a release profile in
`Cargo.toml` with LTO, single codegen unit, higher optimisation level
and
binary stripping for smaller, faster builds.
- Expanded `Cli` with arguments for username, game mode, map size, perk
deck, resources, supply limit, XP modifier, and skill points limit.
- Enabled the `cli` module in `lib.rs` and activated argument parsing in
`main.rs`.
- Added placeholder (commented) fields to `App` for future configuration
integration.