//! Framework-owned navigation and focus-cycle vocabulary.
//!
//! [`ListNavigation`] is the direction enum the framework uses internally
//! when it routes resolved navigation actions to a focused list-style
//! pane (today: [`Toasts`](crate::Toasts)). The binary translates a
//! resolved [`NavAction`](crate::NavAction) into [`ListNavigation`] and
//! calls [`Toasts::on_navigation`](crate::Toasts::on_navigation), so the
//! framework operates on the direction set without naming the binary's
//! dispatch.
//!
//! [`CycleDirection`] is the closed direction set the focus cycler
//! uses for [`GlobalAction::NextPane`](crate::GlobalAction::NextPane) /
//! [`GlobalAction::PrevPane`](crate::GlobalAction::PrevPane) steps and
//! the corresponding pre-globals consume hook on
//! [`Toasts`](crate::Toasts).

/// Resolved navigation step the framework hands to a focused list-style
/// pane.
///
/// Reused by future framework list panes that need the same vocabulary.
/// Closed enum: the framework owns the directional set; the binary
/// supplies the keys via its [`Navigation`](crate::Navigation) impl.
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum ListNavigation {
    /// Move the cursor / viewport one step toward the start.
    Up,
    /// Move the cursor / viewport one step toward the end.
    Down,
    /// Jump to the first entry.
    Home,
    /// Jump to the last entry.
    End,
    /// Move up by one page step.
    PageUp,
    /// Move down by one page step.
    PageDown,
    /// Move up by one half-page step.
    HalfPageUp,
    /// Move down by one half-page step.
    HalfPageDown,
}

/// Direction of a focus-cycle step.
///
/// Used by the focus cycler and by
/// [`Toasts::try_consume_cycle_step`](crate::Toasts::try_consume_cycle_step)
/// so the consume-while-scrollable behavior can act differently on
/// "scroll down before advancing" vs. "scroll up before retreating."
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum CycleDirection {
    /// Forward step (`GlobalAction::NextPane`).
    Next,
    /// Backward step (`GlobalAction::PrevPane`).
    Prev,
}
