TUI-only value owner for the Traditional Git-status sidebar.
The shared git status panel data stays frontend-neutral. This struct tracks terminal presentation concerns such as cursor position, collapsed sections, and pending TUI confirmations.
Summary
Functions
Clamps cursor position to the current flattened entry list.
Clears pending discard confirmation state.
Returns the flattened row at the current cursor.
Returns the flattened rows rendered by the TUI sidebar.
Builds initial TUI view state.
Moves the cursor to the next visible row.
Moves the cursor to the next section header.
Moves the cursor to the previous visible row.
Moves the cursor to the previous section header.
Clamps cursor position after the shared git entry list changes.
Stores the pending destructive discard confirmation.
Returns the selected file entry, if the cursor is on a file row.
Toggles the currently selected section when the cursor is on a section header.
Types
@type discard_confirmation() :: {Minga.Git.StatusEntry.t(), String.t()} | nil
@type flat_entry() :: {:section_header, atom(), non_neg_integer()} | {:file, atom(), Minga.Git.StatusEntry.t()}
@type t() :: %MingaEditor.GitStatus.TUIState{ collapsed: %{required(atom()) => true}, cursor_index: non_neg_integer(), discard_confirmation: discard_confirmation() }
Functions
Clamps cursor position to the current flattened entry list.
Clears pending discard confirmation state.
@spec current_entry(t(), [Minga.Git.StatusEntry.t()]) :: flat_entry() | nil
Returns the flattened row at the current cursor.
@spec flat_entries(t(), [Minga.Git.StatusEntry.t()]) :: [flat_entry()]
Returns the flattened rows rendered by the TUI sidebar.
@spec new() :: t()
Builds initial TUI view state.
Moves the cursor to the next visible row.
Moves the cursor to the next section header.
Moves the cursor to the previous visible row.
Moves the cursor to the previous section header.
Clamps cursor position after the shared git entry list changes.
Stores the pending destructive discard confirmation.
@spec selected_file(t(), [Minga.Git.StatusEntry.t()]) :: Minga.Git.StatusEntry.t() | nil
Returns the selected file entry, if the cursor is on a file row.
Toggles the currently selected section when the cursor is on a section header.