pub struct Autom8App {
pub config_state: ConfigTabState,
/* private fields */
}Expand description
The main GUI application state.
This struct holds all UI state and loaded data, similar to the TUI’s MonitorApp.
Data is refreshed at a configurable interval (default 500ms).
Fields§
§config_state: ConfigTabStateState for the Config tab (scope selection, cached configs, etc.). Public for test access.
Implementations§
Source§impl Autom8App
impl Autom8App
Sourcepub fn with_refresh_interval(refresh_interval: Duration) -> Self
pub fn with_refresh_interval(refresh_interval: Duration) -> Self
Create a new application instance with a custom refresh interval.
§Arguments
refresh_interval- How often to refresh data from disk
Sourcepub fn is_initial_load_complete(&self) -> bool
pub fn is_initial_load_complete(&self) -> bool
Returns whether the initial data load has completed.
Sourcepub fn current_tab(&self) -> Tab
pub fn current_tab(&self) -> Tab
Returns the currently selected tab.
Sourcepub fn projects(&self) -> &[ProjectData]
pub fn projects(&self) -> &[ProjectData]
Returns the loaded projects.
Sourcepub fn sessions(&self) -> &[SessionData]
pub fn sessions(&self) -> &[SessionData]
Returns the active sessions.
Sourcepub fn has_active_runs(&self) -> bool
pub fn has_active_runs(&self) -> bool
Returns whether there are any active runs.
Sourcepub fn refresh_interval(&self) -> Duration
pub fn refresh_interval(&self) -> Duration
Returns the current refresh interval.
Sourcepub fn set_refresh_interval(&mut self, interval: Duration)
pub fn set_refresh_interval(&mut self, interval: Duration)
Sets the refresh interval.
Returns whether the sidebar is collapsed.
Sets the sidebar collapsed state.
Toggles the sidebar collapsed state.
Sourcepub fn selected_config_scope(&self) -> &ConfigScope
pub fn selected_config_scope(&self) -> &ConfigScope
Returns the currently selected config scope.
Sourcepub fn set_selected_config_scope(&mut self, scope: ConfigScope)
pub fn set_selected_config_scope(&mut self, scope: ConfigScope)
Sets the selected config scope.
Sourcepub fn config_scope_projects(&self) -> &[String]
pub fn config_scope_projects(&self) -> &[String]
Returns the cached list of project names for config scope selection.
Sourcepub fn project_has_config(&self, project_name: &str) -> bool
pub fn project_has_config(&self, project_name: &str) -> bool
Returns whether a project has its own config file.
Sourcepub fn cached_global_config(&self) -> Option<&Config>
pub fn cached_global_config(&self) -> Option<&Config>
Returns the cached global config, if loaded.
Sourcepub fn global_config_error(&self) -> Option<&str>
pub fn global_config_error(&self) -> Option<&str>
Returns the global config error, if any.
Sourcepub fn cached_project_config(&self, project_name: &str) -> Option<&Config>
pub fn cached_project_config(&self, project_name: &str) -> Option<&Config>
Returns the cached project config for a specific project, if loaded.
Sourcepub fn project_config_error(&self) -> Option<&str>
pub fn project_config_error(&self) -> Option<&str>
Returns the project config error, if any.
Returns whether the context menu is currently open.
Returns a reference to the context menu state, if open.
Open the context menu for a project at the given position.
Close the context menu.
Sourcepub fn selected_project(&self) -> Option<&str>
pub fn selected_project(&self) -> Option<&str>
Returns the currently selected project name.
Sourcepub fn toggle_project_selection(&mut self, project_name: &str)
pub fn toggle_project_selection(&mut self, project_name: &str)
Toggles the selection of a project. If the project is already selected, it becomes deselected. If a different project is selected, it becomes the new selection. Also loads/clears run history for the selected project.
Sourcepub fn run_history(&self) -> &[RunHistoryEntry]
pub fn run_history(&self) -> &[RunHistoryEntry]
Returns the run history for the selected project.
Sourcepub fn is_run_history_loading(&self) -> bool
pub fn is_run_history_loading(&self) -> bool
Returns whether run history is currently loading.
Sourcepub fn run_history_error(&self) -> Option<&str>
pub fn run_history_error(&self) -> Option<&str>
Returns the run history error message, if any.
Sourcepub fn is_project_selected(&self, project_name: &str) -> bool
pub fn is_project_selected(&self, project_name: &str) -> bool
Returns whether a project is currently selected.
Sourcepub fn active_tab_id(&self) -> &TabId
pub fn active_tab_id(&self) -> &TabId
Returns the currently active tab ID.
Sourcepub fn closable_tab_count(&self) -> usize
pub fn closable_tab_count(&self) -> usize
Returns the number of closable (dynamic) tabs.
Sourcepub fn set_active_tab(&mut self, tab_id: TabId)
pub fn set_active_tab(&mut self, tab_id: TabId)
Set the active tab by ID. Also updates the legacy current_tab field for backward compatibility. Tracks the previous tab for returning after closing the new tab.
Sourcepub fn open_run_detail_tab(&mut self, run_id: &str, run_label: &str) -> bool
pub fn open_run_detail_tab(&mut self, run_id: &str, run_label: &str) -> bool
Open a new dynamic tab for run details. If a tab with this run_id already exists, switches to it instead of creating a duplicate. Returns true if a new tab was created, false if an existing tab was activated.
Sourcepub fn open_run_detail_from_entry(
&mut self,
entry: &RunHistoryEntry,
run_state: Option<RunState>,
)
pub fn open_run_detail_from_entry( &mut self, entry: &RunHistoryEntry, run_state: Option<RunState>, )
Open a run detail tab from a RunHistoryEntry. Caches the run state for rendering and opens the tab.
Sourcepub fn open_command_output_tab(
&mut self,
project: &str,
command: &str,
) -> CommandOutputId
pub fn open_command_output_tab( &mut self, project: &str, command: &str, ) -> CommandOutputId
Open a new command output tab. Creates a new CommandExecution and opens a tab for it. Returns the CommandOutputId for the new execution (to be used for updates).
Sourcepub fn get_command_execution(
&self,
cache_key: &str,
) -> Option<&CommandExecution>
pub fn get_command_execution( &self, cache_key: &str, ) -> Option<&CommandExecution>
Get a command execution by cache key.
Sourcepub fn get_command_execution_mut(
&mut self,
cache_key: &str,
) -> Option<&mut CommandExecution>
pub fn get_command_execution_mut( &mut self, cache_key: &str, ) -> Option<&mut CommandExecution>
Get a mutable command execution by cache key.
Sourcepub fn add_command_stdout(&mut self, cache_key: &str, line: String)
pub fn add_command_stdout(&mut self, cache_key: &str, line: String)
Update a command execution with new stdout output.
Sourcepub fn add_command_stderr(&mut self, cache_key: &str, line: String)
pub fn add_command_stderr(&mut self, cache_key: &str, line: String)
Update a command execution with new stderr output.
Sourcepub fn complete_command(&mut self, cache_key: &str, exit_code: i32)
pub fn complete_command(&mut self, cache_key: &str, exit_code: i32)
Mark a command execution as completed.
Sourcepub fn fail_command(&mut self, cache_key: &str, error_message: String)
pub fn fail_command(&mut self, cache_key: &str, error_message: String)
Mark a command execution as failed.
Sourcepub fn spawn_status_command(&mut self, project_name: &str)
pub fn spawn_status_command(&mut self, project_name: &str)
Load status for a project by calling the data layer directly. Opens a new command output tab and populates it with session data.
US-002: Replaces subprocess spawning with direct StateManager calls.
Sourcepub fn spawn_describe_command(&mut self, project_name: &str)
pub fn spawn_describe_command(&mut self, project_name: &str)
Get project description and display in a command output tab.
US-003: Calls data layer directly instead of spawning subprocess. Opens a new command output tab and formats ProjectDescription as plain text.
Sourcepub fn show_resume_info(&mut self, project_name: &str, session_id: &str)
pub fn show_resume_info(&mut self, project_name: &str, session_id: &str)
Show resume session information in the output tab.
US-005: Shows session info instead of spawning subprocess. Info includes: session ID, branch, worktree path, current state. Shows message with instructions on how to resume in terminal.
Sourcepub fn spawn_clean_worktrees_command(&mut self, project_name: &str)
pub fn spawn_clean_worktrees_command(&mut self, project_name: &str)
Clean completed/failed sessions with worktrees by calling the data layer directly. Opens a new command output tab and populates it with cleanup results.
US-004: Replaces subprocess spawning with direct clean_worktrees_direct() call. Note: The clean operation respects safety filters - only Completed/Failed/Interrupted sessions are cleaned, not Running/InProgress ones.
Sourcepub fn spawn_clean_orphaned_command(&mut self, project_name: &str)
pub fn spawn_clean_orphaned_command(&mut self, project_name: &str)
Clean orphaned sessions by calling the data layer directly. Orphaned sessions are those where the worktree has been deleted but the session state remains. Opens a new command output tab and populates it with cleanup results.
US-004: Replaces subprocess spawning with direct clean_orphaned_direct() call.
Sourcepub fn spawn_clean_data_command(&mut self, project_name: &str)
pub fn spawn_clean_data_command(&mut self, project_name: &str)
Clean data (specs and archived runs) for a project by calling the data layer directly. Opens a new command output tab and populates it with cleanup results.
US-003: Implements the clean data action for specs and archived runs.
Sourcepub fn spawn_remove_project_command(&mut self, project_name: &str)
pub fn spawn_remove_project_command(&mut self, project_name: &str)
Remove a project from autom8 entirely by calling the data layer directly. This removes all worktrees (except active runs), session state, specs, and project configuration. Opens a new command output tab and populates it with removal results.
US-004: Implements the actual removal logic using remove_project_direct().
Sourcepub fn close_tab(&mut self, tab_id: &TabId) -> bool
pub fn close_tab(&mut self, tab_id: &TabId) -> bool
Close a tab by ID. Returns true if the tab was closed, false if the tab doesn’t exist or is not closable. If the closed tab was active, switches to the previous tab (if available and still open), otherwise falls back to adjacent tab logic or Projects tab.
Sourcepub fn close_all_dynamic_tabs(&mut self) -> usize
pub fn close_all_dynamic_tabs(&mut self) -> usize
Close all closable (dynamic) tabs. Returns the number of tabs closed.
Sourcepub fn get_cached_run_state(&self, run_id: &str) -> Option<&RunState>
pub fn get_cached_run_state(&self, run_id: &str) -> Option<&RunState>
Get cached run state for a run detail tab.
Sourcepub fn maybe_refresh(&mut self)
pub fn maybe_refresh(&mut self)
Refresh data from disk if the refresh interval has elapsed.
This method is called on every frame and only performs actual file I/O when the refresh interval has passed.
Sourcepub fn refresh_data(&mut self)
pub fn refresh_data(&mut self)
Refresh all data from disk.
Loads project and session data, handling errors gracefully.
Missing or corrupted files are captured as load_error strings
rather than causing failures.
Source§impl Autom8App
impl Autom8App
Sourcepub fn add_chat_message(&mut self, message: ChatMessage)
pub fn add_chat_message(&mut self, message: ChatMessage)
Add a message to the chat and trigger scroll to bottom (US-003).
This method is used by other parts of the system to add messages to the conversation.
Sourcepub fn add_user_message(&mut self, content: impl Into<String>)
pub fn add_user_message(&mut self, content: impl Into<String>)
Add a user message to the chat (US-003).
Sourcepub fn add_claude_message(&mut self, content: impl Into<String>)
pub fn add_claude_message(&mut self, content: impl Into<String>)
Add a Claude message to the chat (US-003).
Sourcepub fn clear_chat_messages(&mut self)
pub fn clear_chat_messages(&mut self)
Clear all chat messages (US-003).
Trait Implementations§
Source§impl App for Autom8App
impl App for Autom8App
Source§fn update(&mut self, ctx: &Context, _frame: &mut Frame)
fn update(&mut self, ctx: &Context, _frame: &mut Frame)
Source§fn save(&mut self, _storage: &mut dyn Storage)
fn save(&mut self, _storage: &mut dyn Storage)
Source§fn on_exit(&mut self, _gl: Option<&Context>)
fn on_exit(&mut self, _gl: Option<&Context>)
Self::save. Read moreSource§fn auto_save_interval(&self) -> Duration
fn auto_save_interval(&self) -> Duration
Self::saveSource§fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]
fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]
gl.clearColor. Read moreSource§fn persist_egui_memory(&self) -> bool
fn persist_egui_memory(&self) -> bool
Source§fn raw_input_hook(&mut self, _ctx: &Context, _raw_input: &mut RawInput)
fn raw_input_hook(&mut self, _ctx: &Context, _raw_input: &mut RawInput)
Self::update. Read moreAuto Trait Implementations§
impl Freeze for Autom8App
impl RefUnwindSafe for Autom8App
impl Send for Autom8App
impl !Sync for Autom8App
impl Unpin for Autom8App
impl UnwindSafe for Autom8App
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> 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