eazygit 0.5.1

A fast TUI for Git with staging, conflicts, rebase, and palette-first UX
Documentation
#![allow(unused_imports)]
//! Core module implementing The Elm Architecture (TEA) pattern.
//!
//! This module provides the foundational types for unidirectional data flow:
//! - **Msg**: Messages that describe intents or events
//! - **Effect**: Side effects that need to be executed
//! - **update**: Pure function that transforms state based on messages
//!
//! ## Architecture
//!
//! ```text
//! User Input → Msg → update(State, Msg) → (NewState, Option<Effect>)
//!//!                                      Effect Handler
//!//!                                    Result Msg → update...
//! ```

pub mod effects;
pub mod msg;
pub mod update;
// pub mod runtime;  // TODO: implement
// pub mod bridge;  // TODO: implement after Runtime
pub mod recovery;
pub mod events;
pub mod queue;
pub mod undo;
pub mod notifications;
pub mod throttle;
pub mod selectors;
pub mod focus;
pub mod clipboard;
pub mod help;

#[cfg(test)]
mod tests;

pub use effects::Effect;
pub use msg::Msg;
pub use update::update;
// pub use runtime::Runtime;  // TODO: implement
// pub use bridge::TeaBridge;  // TODO: implement
pub use recovery::{RecoverableError, RecoverableResult, ErrorCategory};
pub use events::EventBus;
pub use queue::CommandQueue;
pub use undo::UndoStack;
pub use notifications::NotificationManager;
pub use throttle::{Throttle, Debounce};
pub use focus::{FocusManager, Panel};
pub use clipboard::ClipboardManager;
pub use help::HelpSystem;

/// Result of the update function: new state changes + optional effect to execute.
/// 
/// This follows the Elm pattern where update returns both state changes
/// and commands (effects) that need to be run.
#[derive(Debug, Clone)]
pub struct UpdateResult {
    /// Optional effect to execute after state update.
    pub effect: Option<Effect>,
}

impl UpdateResult {
    /// No effect needed.
    pub fn none() -> Self {
        Self { effect: None }
    }
    
    /// Execute an effect after state update.
    pub fn with_effect(effect: Effect) -> Self {
        Self { effect: Some(effect) }
    }
}