pub struct AppState {Show 23 fields
pub repos: Vec<Repo>,
pub repo_list: SearchableList,
pub loading_repos: bool,
pub selected_repo_idx: Option<usize>,
pub branches: Vec<BranchEntry>,
pub branch_list: SearchableList,
pub base_branch_selection: Option<BaseBranchSelection>,
pub help_overlay: Option<HelpOverlayState>,
pub setup: Option<SetupState>,
pub split_command: Option<String>,
pub mode: Mode,
pub loading_branches: bool,
pub fetching_remotes: bool,
pub error: Option<String>,
pub pending_worktree_deletes: Vec<PendingWorktreeDelete>,
pub session_activity: HashMap<String, u64>,
pub agent_poller_cancel: Option<Arc<AtomicBool>>,
pub agent_enabled: bool,
pub agent_poll_interval: Duration,
pub agent_labels: AgentLabelsConfig,
pub current_repo_path: Option<PathBuf>,
pub cwd_worktree_path: Option<PathBuf>,
pub seen_repo_paths: HashSet<PathBuf>,
/* private fields */
}Expand description
Central application state. Components read from this, actions modify it.
Fields§
§repos: Vec<Repo>§repo_list: SearchableList§loading_repos: bool§selected_repo_idx: Option<usize>§branches: Vec<BranchEntry>§branch_list: SearchableList§base_branch_selection: Option<BaseBranchSelection>§help_overlay: Option<HelpOverlayState>§setup: Option<SetupState>§split_command: Option<String>§mode: Mode§loading_branches: bool§fetching_remotes: bool§error: Option<String>§pending_worktree_deletes: Vec<PendingWorktreeDelete>§session_activity: HashMap<String, u64>§agent_poller_cancel: Option<Arc<AtomicBool>>Cancel token for the active agent status poller thread.
Setting this flag stops the current poller; clearing it (via cancel_agent_poller)
prepares for a new one.
agent_enabled: boolWhether agent status detection is enabled (configurable via [agent] enabled).
agent_poll_interval: DurationAgent poll interval (configurable via [agent] poll_interval_ms).
agent_labels: AgentLabelsConfigLabel text for each agent state shown in the branch picker.
current_repo_path: Option<PathBuf>Main repo root path from CWD (for repo ordering)
cwd_worktree_path: Option<PathBuf>CWD resolved to repo/worktree root (for branch current detection)
seen_repo_paths: HashSet<PathBuf>Tracks repo paths already seen during streaming discovery (O(1) dedup). Cleared when a new scan starts.
Implementations§
Source§impl AppState
impl AppState
pub fn new(repos: Vec<Repo>, split_command: Option<String>) -> Self
pub fn new_loading(loading_message: &str, split_command: Option<String>) -> Self
pub fn set_error(&mut self, msg: &str)
pub fn clear_error(&mut self)
pub fn new_setup() -> Self
Sourcepub fn cancel_agent_poller(&mut self)
pub fn cancel_agent_poller(&mut self)
Signal the current agent poller thread to stop and clear the cancel token.
Sourcepub fn active_text_input(&mut self) -> Option<&mut TextInput>
pub fn active_text_input(&mut self) -> Option<&mut TextInput>
Get the active text input for the current mode (mutable).
Works for both SearchableList modes and Setup mode.
Sourcepub fn active_list_mut(&mut self) -> Option<&mut SearchableList>
pub fn active_list_mut(&mut self) -> Option<&mut SearchableList>
Get the active searchable list for the current mode (mutable)
Sourcepub fn active_list(&self) -> Option<&SearchableList>
pub fn active_list(&self) -> Option<&SearchableList>
Get the active searchable list for the current mode (immutable)
pub fn active_help_list_mut(&mut self) -> Option<&mut SearchableList>
pub fn active_help_list(&self) -> Option<&SearchableList>
pub fn is_branch_pending_delete( &self, repo_path: &Path, branch_name: &str, ) -> bool
pub fn set_active_list_page_rows(&mut self, rows: usize)
pub fn active_list_page_rows(&self) -> usize
pub fn mark_pending_worktree_delete(&mut self, pending: PendingWorktreeDelete)
pub fn clear_pending_worktree_delete_by_path( &mut self, worktree_path: &Path, ) -> bool
pub fn clear_pending_worktree_delete_by_branch( &mut self, repo_path: &Path, branch_name: &str, ) -> bool
Sourcepub fn reconcile_pending_worktree_deletes(&mut self) -> bool
pub fn reconcile_pending_worktree_deletes(&mut self) -> bool
Drop stale pending delete entries that no longer correspond to an existing worktree.