pub struct AppState {Show 19 fields
pub should_quit: bool,
pub commits: Vec<CommitInfo>,
pub selection_index: usize,
pub reverse: bool,
pub full_fragmap: bool,
pub squashable_scope: SquashableScope,
pub reference_oid: String,
pub fragmap: Option<FragMap>,
pub fragmap_scroll_offset: usize,
pub mode: AppMode,
pub detail_scroll_offset: usize,
pub max_detail_scroll: usize,
pub detail_h_scroll_offset: usize,
pub max_detail_h_scroll: usize,
pub commit_list_visible_height: usize,
pub detail_visible_height: usize,
pub status_message: Option<String>,
pub status_is_error: bool,
pub separator_offset: i16,
}Expand description
Application state for the TUI.
Manages the overall state of the interactive terminal interface, including quit flag and commit list state.
Fields§
§should_quit: bool§commits: Vec<CommitInfo>§selection_index: usize§reverse: bool§full_fragmap: boolShow all hunk-group columns without deduplication (–full flag).
squashable_scope: SquashableScopeControls what the squashable connector symbol means in the fragmap.
reference_oid: StringThe reference OID (merge-base) used when the session started. Stored here so ‘u’ update can rescan from HEAD down to the same base.
fragmap: Option<FragMap>Optional fragmap visualization data. None if fragmap computation failed or was not performed.
fragmap_scroll_offset: usizeHorizontal scroll offset for the fragmap grid.
mode: AppModeCurrent display mode.
detail_scroll_offset: usizeVertical scroll offset for the detail view.
max_detail_scroll: usizeMaximum vertical scroll offset for the detail view (updated during render).
detail_h_scroll_offset: usizeHorizontal scroll offset for the detail view.
max_detail_h_scroll: usizeMaximum horizontal scroll offset for the detail view (updated during render).
commit_list_visible_height: usizeVisible height of the commit list area (updated during render).
detail_visible_height: usizeVisible height of the detail view area (updated during render).
status_message: Option<String>Transient status message shown in the footer (cleared on next keypress).
status_is_error: boolWhether the current status message represents an error (red) or success (green).
separator_offset: i16User-controlled offset for the vertical separator bar (positive = right, negative = left).
Implementations§
Source§impl AppState
impl AppState
Sourcepub fn with_commits(commits: Vec<CommitInfo>) -> Self
pub fn with_commits(commits: Vec<CommitInfo>) -> Self
Create a new AppState with the given commits, selecting the last one (HEAD).
Sourcepub fn move_up(&mut self)
pub fn move_up(&mut self)
Move selection up (decrement index) with lower bound check. Does nothing if already at top or commits list is empty.
Sourcepub fn move_down(&mut self)
pub fn move_down(&mut self)
Move selection down (increment index) with upper bound check. Does nothing if already at bottom or commits list is empty.
Sourcepub fn scroll_fragmap_left(&mut self)
pub fn scroll_fragmap_left(&mut self)
Scroll fragmap grid left.
Sourcepub fn scroll_fragmap_right(&mut self)
pub fn scroll_fragmap_right(&mut self)
Scroll fragmap grid right.
Sourcepub fn scroll_detail_up(&mut self)
pub fn scroll_detail_up(&mut self)
Scroll detail view up (decrease offset).
Sourcepub fn scroll_detail_down(&mut self)
pub fn scroll_detail_down(&mut self)
Scroll detail view down (increase offset).
Sourcepub fn scroll_detail_left(&mut self)
pub fn scroll_detail_left(&mut self)
Scroll detail view left (decrease horizontal offset).
Sourcepub fn scroll_detail_right(&mut self)
pub fn scroll_detail_right(&mut self)
Scroll detail view right (increase horizontal offset).
Sourcepub fn page_up(&mut self, visible_height: usize)
pub fn page_up(&mut self, visible_height: usize)
Scroll commit list up by one page (visible_height lines).
Sourcepub fn page_down(&mut self, visible_height: usize)
pub fn page_down(&mut self, visible_height: usize)
Scroll commit list down by one page (visible_height lines).
Sourcepub fn scroll_detail_page_up(&mut self, visible_height: usize)
pub fn scroll_detail_page_up(&mut self, visible_height: usize)
Scroll detail view up by one page (visible_height lines).
Sourcepub fn scroll_detail_page_down(&mut self, visible_height: usize)
pub fn scroll_detail_page_down(&mut self, visible_height: usize)
Scroll detail view down by one page (visible_height lines).
Sourcepub fn enter_split_confirm(
&mut self,
strategy: SplitStrategy,
commit_oid: String,
head_oid: String,
count: usize,
)
pub fn enter_split_confirm( &mut self, strategy: SplitStrategy, commit_oid: String, head_oid: String, count: usize, )
Enter the large-split confirmation dialog.
Sourcepub fn cancel_split_confirm(&mut self)
pub fn cancel_split_confirm(&mut self)
Cancel the large-split confirmation and return to CommitList.
Sourcepub fn enter_drop_confirm(
&mut self,
commit_oid: String,
commit_summary: String,
head_oid: String,
)
pub fn enter_drop_confirm( &mut self, commit_oid: String, commit_summary: String, head_oid: String, )
Enter the drop confirmation dialog.
Sourcepub fn cancel_drop_confirm(&mut self)
pub fn cancel_drop_confirm(&mut self)
Cancel the drop confirmation and return to CommitList.
Sourcepub fn enter_rebase_conflict(&mut self, state: ConflictState)
pub fn enter_rebase_conflict(&mut self, state: ConflictState)
Enter the rebase-conflict resolution dialog.
Sourcepub fn enter_split_select(&mut self)
pub fn enter_split_select(&mut self)
Enter split strategy selection mode. Only allowed for real commits (not staged/unstaged synthetic rows).
Sourcepub fn enter_squash_select(&mut self)
pub fn enter_squash_select(&mut self)
Enter squash target selection mode. Only allowed for real commits (not staged/unstaged synthetic rows).
Sourcepub fn enter_fixup_select(&mut self)
pub fn enter_fixup_select(&mut self)
Enter fixup target selection mode (same UI as squash, keeps target msg).
Sourcepub fn cancel_squash_select(&mut self)
pub fn cancel_squash_select(&mut self)
Cancel squash selection and return to CommitList.
Sourcepub fn enter_move_select(&mut self)
pub fn enter_move_select(&mut self)
Enter move commit selection mode. The insertion cursor starts one position before the source (i.e. one slot earlier in the commit list, which visually means “above” in chronological order).
Sourcepub fn cancel_move_select(&mut self)
pub fn cancel_move_select(&mut self)
Cancel move selection and return to CommitList.
Sourcepub fn set_success_message(&mut self, msg: impl Into<String>)
pub fn set_success_message(&mut self, msg: impl Into<String>)
Set a success status message (shown with green background).
Sourcepub fn set_error_message(&mut self, msg: impl Into<String>)
pub fn set_error_message(&mut self, msg: impl Into<String>)
Set an error status message (shown with red background).
Sourcepub fn clear_status_message(&mut self)
pub fn clear_status_message(&mut self)
Clear the transient status message.
Sourcepub fn split_select_up(&mut self)
pub fn split_select_up(&mut self)
Move split strategy selection up.
Sourcepub fn split_select_down(&mut self)
pub fn split_select_down(&mut self)
Move split strategy selection down.
Sourcepub fn selected_split_strategy(&self) -> SplitStrategy
pub fn selected_split_strategy(&self) -> SplitStrategy
Get the currently selected split strategy.
Sourcepub fn toggle_detail_view(&mut self)
pub fn toggle_detail_view(&mut self)
Toggle between CommitList and CommitDetail modes.
Sourcepub fn close_help(&mut self)
pub fn close_help(&mut self)
Close help dialog and return to previous mode.
Sourcepub fn toggle_help(&mut self)
pub fn toggle_help(&mut self)
Toggle help dialog on/off.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
impl UnwindSafe for AppState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more