eazygit 0.5.1

A fast TUI for Git with staging, conflicts, rebase, and palette-first UX
Documentation
mod navigation;
mod log_menu;
mod input;
mod rebase;

use crate::app::{actions::Action, state::AppState};

pub fn reduce(state: AppState, action: &Action) -> Option<AppState> {
    if let Some(new_state) = navigation::handle_navigation(state.clone(), action) {
        return Some(new_state);
    }
    if let Some(new_state) = log_menu::handle_log_menu(state.clone(), action) {
        return Some(new_state);
    }
    if let Some(new_state) = input::handle_input(state.clone(), action) {
        return Some(new_state);
    }
    if let Some(new_state) = rebase::handle_rebase(state.clone(), action) {
        return Some(new_state);
    }
    
    // If none matched, return None to indicate no change managed by this reducer
    None
}