pub struct App {
pub mode: AppMode,
pub data: AppData,
pub actions: Actions,
}Expand description
Main application state
Fields§
§mode: AppModeCurrent application mode (typed).
data: AppDataPersistent application data.
actions: ActionsAction handler context.
Implementations§
Source§impl App
impl App
Sourcepub fn start_command_palette(&mut self)
pub fn start_command_palette(&mut self)
Enter slash command palette mode and pre-fill the leading /
Sourcepub fn filtered_slash_commands(&self) -> Vec<SlashCommand>
pub fn filtered_slash_commands(&self) -> Vec<SlashCommand>
Return the list of slash commands filtered by the current palette input.
Sourcepub fn submit_slash_command_palette(&mut self)
pub fn submit_slash_command_palette(&mut self)
Execute the currently-typed slash command (called when user presses Enter).
Sourcepub fn run_slash_command(&mut self, cmd: SlashCommand)
pub fn run_slash_command(&mut self, cmd: SlashCommand)
Execute a resolved slash command.
Sourcepub fn select_next_slash_command(&mut self)
pub fn select_next_slash_command(&mut self)
Select the next slash command in the filtered list.
Sourcepub fn select_prev_slash_command(&mut self)
pub fn select_prev_slash_command(&mut self)
Select the previous slash command in the filtered list.
Sourcepub const fn reset_slash_command_selection(&mut self)
pub const fn reset_slash_command_selection(&mut self)
Reset the slash command selection back to the first entry.
Sourcepub fn selected_slash_command(&self) -> Option<SlashCommand>
pub fn selected_slash_command(&self) -> Option<SlashCommand>
Get the currently selected slash command (based on filter + selection index).
Sourcepub fn confirm_slash_command_selection(&mut self)
pub fn confirm_slash_command_selection(&mut self)
Run the currently highlighted command in the palette (fallbacks to parsing the input).
Source§impl App
impl App
Sourcepub fn start_push(&mut self, agent_id: Uuid, branch_name: String)
pub fn start_push(&mut self, agent_id: Uuid, branch_name: String)
Start the push flow - show confirmation dialog
Sourcepub fn start_rename(
&mut self,
agent_id: Uuid,
current_name: String,
is_root: bool,
)
pub fn start_rename( &mut self, agent_id: Uuid, current_name: String, is_root: bool, )
Start the rename flow
For root agents (is_root=true): Renames branch + agent title + session
For sub-agents (is_root=false): Renames agent title + window only
Sourcepub fn confirm_rename_branch(&mut self) -> bool
pub fn confirm_rename_branch(&mut self) -> bool
Confirm the branch rename (update branch_name from input_buffer)
Sourcepub fn start_open_pr(
&mut self,
agent_id: Uuid,
branch_name: String,
base_branch: String,
has_unpushed: bool,
)
pub fn start_open_pr( &mut self, agent_id: Uuid, branch_name: String, base_branch: String, has_unpushed: bool, )
Start the open PR flow - may show push confirmation first
Sourcepub fn clear_git_op_state(&mut self)
pub fn clear_git_op_state(&mut self)
Clear all git operation state
Sourcepub fn start_rebase(
&mut self,
agent_id: Uuid,
current_branch: String,
branches: Vec<BranchInfo>,
)
pub fn start_rebase( &mut self, agent_id: Uuid, current_branch: String, branches: Vec<BranchInfo>, )
Start the rebase flow - show branch selector to choose target branch
Sourcepub fn start_merge(
&mut self,
agent_id: Uuid,
current_branch: String,
branches: Vec<BranchInfo>,
)
pub fn start_merge( &mut self, agent_id: Uuid, current_branch: String, branches: Vec<BranchInfo>, )
Start the merge flow - show branch selector to choose source branch
Sourcepub fn confirm_rebase_merge_branch(&mut self) -> bool
pub fn confirm_rebase_merge_branch(&mut self) -> bool
Confirm branch selection for rebase/merge and set target branch
Source§impl App
impl App
Sourcepub fn apply_mode(&mut self, next: AppMode)
pub fn apply_mode(&mut self, next: AppMode)
Apply a mode transition to the application, running any required entry/exit hooks.
Sourcepub fn enter_mode(&mut self, mode: AppMode)
pub fn enter_mode(&mut self, mode: AppMode)
Enter a new application mode.
Sourcepub fn set_error(&mut self, message: impl Into<String>)
pub fn set_error(&mut self, message: impl Into<String>)
Set an error message and show the error modal.
Sourcepub fn clear_error(&mut self)
pub fn clear_error(&mut self)
Clear the current error message.
Sourcepub fn dismiss_error(&mut self)
pub fn dismiss_error(&mut self)
Dismiss the error modal and clear the stored error message.
Sourcepub fn set_status(&mut self, message: impl Into<String>)
pub fn set_status(&mut self, message: impl Into<String>)
Set a status message to display.
Sourcepub fn clear_status(&mut self)
pub fn clear_status(&mut self)
Clear the current status message.
Sourcepub fn show_success(&mut self, message: impl Into<String>)
pub fn show_success(&mut self, message: impl Into<String>)
Show success modal with message.
Sourcepub fn dismiss_success(&mut self)
pub fn dismiss_success(&mut self)
Dismiss success modal.
Sourcepub const fn should_show_keyboard_remap_prompt(&self) -> bool
pub const fn should_show_keyboard_remap_prompt(&self) -> bool
Check if keyboard remap prompt should be shown at startup Returns true if terminal doesn’t support enhancement AND user hasn’t been asked yet
Sourcepub fn show_keyboard_remap_prompt(&mut self)
pub fn show_keyboard_remap_prompt(&mut self)
Show the keyboard remap prompt modal
Sourcepub fn accept_keyboard_remap(&mut self)
pub fn accept_keyboard_remap(&mut self)
Accept the keyboard remap (Ctrl+M -> Ctrl+N)
Sourcepub fn decline_keyboard_remap(&mut self)
pub fn decline_keyboard_remap(&mut self)
Decline the keyboard remap
Sourcepub const fn is_merge_key_remapped(&self) -> bool
pub const fn is_merge_key_remapped(&self) -> bool
Check if merge key should use Ctrl+N instead of Ctrl+M
Source§impl App
impl App
Sourcepub fn start_model_selector(&mut self)
pub fn start_model_selector(&mut self)
Enter the /agents selector modal.
Sourcepub fn filtered_model_programs(&self) -> Vec<AgentProgram>
pub fn filtered_model_programs(&self) -> Vec<AgentProgram>
Return the filtered model/program list for the selector UI.
Sourcepub fn select_next_model_program(&mut self)
pub fn select_next_model_program(&mut self)
Select next model/program in filtered list.
Sourcepub fn select_prev_model_program(&mut self)
pub fn select_prev_model_program(&mut self)
Select previous model/program in filtered list.
Sourcepub fn handle_model_filter_char(&mut self, c: char)
pub fn handle_model_filter_char(&mut self, c: char)
Handle typing in the /agents filter.
Sourcepub fn handle_model_filter_backspace(&mut self)
pub fn handle_model_filter_backspace(&mut self)
Handle backspace in the /agents filter.
Sourcepub fn selected_model_program(&self) -> Option<AgentProgram>
pub fn selected_model_program(&self) -> Option<AgentProgram>
Get the currently highlighted model/program (in /agents).
Sourcepub fn confirm_model_program_selection(&mut self)
pub fn confirm_model_program_selection(&mut self)
Confirm the current /agents selection.
Sourcepub fn start_custom_agent_command_prompt(&mut self)
pub fn start_custom_agent_command_prompt(&mut self)
Open the custom agent command prompt (used when selecting custom).
Sourcepub fn set_agent_program_and_save(&mut self, program: AgentProgram)
pub fn set_agent_program_and_save(&mut self, program: AgentProgram)
Set the agent program and persist settings to disk.
Sourcepub fn set_custom_agent_command_and_save(&mut self, command: String)
pub fn set_custom_agent_command_and_save(&mut self, command: String)
Update the custom agent command, select custom, and persist settings.
Sourcepub fn agent_spawn_command(&self) -> String
pub fn agent_spawn_command(&self) -> String
The base command used when spawning new agents (based on user settings).
Source§impl App
impl App
Sourcepub fn selected_agent(&self) -> Option<&Agent>
pub fn selected_agent(&self) -> Option<&Agent>
Get the currently selected agent (from visible agents list)
Sourcepub fn selected_agent_mut(&mut self) -> Option<&mut Agent>
pub fn selected_agent_mut(&mut self) -> Option<&mut Agent>
Get a mutable reference to the currently selected agent
Sourcepub fn select_next(&mut self)
pub fn select_next(&mut self)
Move selection to the next agent (in visible list)
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Move selection to the previous agent (in visible list)
Sourcepub fn switch_tab(&mut self)
pub fn switch_tab(&mut self)
Switch between detail pane tabs (forward)
Sourcepub fn validate_selection(&mut self)
pub fn validate_selection(&mut self)
Ensure the selection index is valid for the current visible agents
Sourcepub fn ensure_agent_list_scroll(&mut self)
pub fn ensure_agent_list_scroll(&mut self)
Ensure the agent list scroll offset keeps the selected agent visible.
Sourcepub fn toggle_selected_collapse(&mut self)
pub fn toggle_selected_collapse(&mut self)
Toggle collapse state of the selected agent
Sourcepub fn selected_has_children(&self) -> bool
pub fn selected_has_children(&self) -> bool
Check if selected agent has children (for UI)
Sourcepub fn selected_depth(&self) -> usize
pub fn selected_depth(&self) -> usize
Get depth of the selected agent (for UI)
Sourcepub fn has_running_agents(&self) -> bool
pub fn has_running_agents(&self) -> bool
Check if there are any running agents
Sourcepub fn running_agent_count(&self) -> usize
pub fn running_agent_count(&self) -> usize
Get the count of currently running agents
Source§impl App
impl App
Sourcepub fn start_review(&mut self, branches: Vec<BranchInfo>)
pub fn start_review(&mut self, branches: Vec<BranchInfo>)
Start the review flow - show info if no agent selected, otherwise proceed to count
Sourcepub fn show_review_info(&mut self)
pub fn show_review_info(&mut self)
Show the review info modal (when no agent is selected)
Sourcepub fn proceed_to_branch_selector(&mut self)
pub fn proceed_to_branch_selector(&mut self)
Proceed from review count to branch selector
Sourcepub fn filtered_review_branches(&self) -> Vec<&BranchInfo>
pub fn filtered_review_branches(&self) -> Vec<&BranchInfo>
Get filtered branches based on current filter
Sourcepub fn select_next_branch(&mut self)
pub fn select_next_branch(&mut self)
Select next branch in filtered list
Sourcepub fn select_prev_branch(&mut self)
pub fn select_prev_branch(&mut self)
Select previous branch in filtered list
Sourcepub fn selected_branch(&self) -> Option<&BranchInfo>
pub fn selected_branch(&self) -> Option<&BranchInfo>
Get the currently selected branch
Sourcepub fn handle_branch_filter_char(&mut self, c: char)
pub fn handle_branch_filter_char(&mut self, c: char)
Handle character input in branch filter
Sourcepub fn handle_branch_filter_backspace(&mut self)
pub fn handle_branch_filter_backspace(&mut self)
Handle backspace in branch filter
Sourcepub fn confirm_branch_selection(&mut self) -> bool
pub fn confirm_branch_selection(&mut self) -> bool
Confirm branch selection and set review_base_branch
Sourcepub fn clear_review_state(&mut self)
pub fn clear_review_state(&mut self)
Clear all review-related state
Source§impl App
impl App
Sourcepub fn reset_scroll(&mut self)
pub fn reset_scroll(&mut self)
Reset scroll positions for both panes Preview is pinned to bottom (with follow enabled), Diff is pinned to top
Sourcepub fn scroll_down(&mut self, amount: usize)
pub fn scroll_down(&mut self, amount: usize)
Scroll down in the active pane by the given amount
Sourcepub fn scroll_to_top(&mut self)
pub fn scroll_to_top(&mut self)
Scroll to the top of the active pane
Sourcepub const fn scroll_to_bottom(
&mut self,
content_lines: usize,
visible_lines: usize,
)
pub const fn scroll_to_bottom( &mut self, content_lines: usize, visible_lines: usize, )
Scroll to the bottom of the active pane
Sourcepub const fn set_preview_dimensions(&mut self, width: u16, height: u16)
pub const fn set_preview_dimensions(&mut self, width: u16, height: u16)
Set the preview pane dimensions for mux window sizing
Source§impl App
impl App
Sourcepub const fn increment_child_count(&mut self)
pub const fn increment_child_count(&mut self)
Increment child count (for ChildCount mode)
Sourcepub const fn decrement_child_count(&mut self)
pub const fn decrement_child_count(&mut self)
Decrement child count (minimum 1)
Sourcepub fn start_spawning_under(&mut self, parent_id: Uuid)
pub fn start_spawning_under(&mut self, parent_id: Uuid)
Start spawning children under a specific agent
Sourcepub fn start_spawning_root(&mut self)
pub fn start_spawning_root(&mut self)
Start spawning a new root agent with children (no plan prompt)
Sourcepub fn start_planning_swarm(&mut self)
pub fn start_planning_swarm(&mut self)
Start spawning a planning swarm under the selected agent
Sourcepub fn proceed_to_child_prompt(&mut self)
pub fn proceed_to_child_prompt(&mut self)
Proceed from ChildCount to ChildPrompt mode
Sourcepub fn next_terminal_name(&mut self) -> String
pub fn next_terminal_name(&mut self) -> String
Get the next terminal name and increment the counter
Sourcepub fn start_terminal_prompt(&mut self)
pub fn start_terminal_prompt(&mut self)
Start prompting for a terminal startup command
Source§impl App
impl App
Sourcepub const fn is_text_input_mode(&self) -> bool
pub const fn is_text_input_mode(&self) -> bool
Check if the current mode accepts text input
This is used to consolidate the mode check that was previously
duplicated across handle_char, handle_backspace, and handle_delete.
Sourcepub fn handle_char(&mut self, c: char)
pub fn handle_char(&mut self, c: char)
Handle a character input in text input modes
Sourcepub fn handle_backspace(&mut self)
pub fn handle_backspace(&mut self)
Handle backspace in text input modes
Sourcepub fn handle_delete(&mut self)
pub fn handle_delete(&mut self)
Handle delete key in text input modes (delete char at cursor)
Sourcepub fn input_cursor_left(&mut self)
pub fn input_cursor_left(&mut self)
Move cursor left in text input
Sourcepub fn input_cursor_right(&mut self)
pub fn input_cursor_right(&mut self)
Move cursor right in text input
Sourcepub fn input_cursor_up(&mut self)
pub fn input_cursor_up(&mut self)
Move cursor up one line in text input
Sourcepub fn input_cursor_down(&mut self)
pub fn input_cursor_down(&mut self)
Move cursor down one line in text input
Sourcepub fn input_cursor_home(&mut self)
pub fn input_cursor_home(&mut self)
Move cursor to start of line
Sourcepub fn input_cursor_end(&mut self)
pub fn input_cursor_end(&mut self)
Move cursor to end of line
Trait Implementations§
Auto Trait Implementations§
impl Freeze for App
impl RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnwindSafe for App
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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