Skip to main content

Autom8App

Struct Autom8App 

Source
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: ConfigTabState

State for the Config tab (scope selection, cached configs, etc.). Public for test access.

Implementations§

Source§

impl Autom8App

Source

pub fn new() -> Self

Create a new application instance.

Source

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
Source

pub fn is_initial_load_complete(&self) -> bool

Returns whether the initial data load has completed.

Source

pub fn current_tab(&self) -> Tab

Returns the currently selected tab.

Source

pub fn projects(&self) -> &[ProjectData]

Returns the loaded projects.

Source

pub fn sessions(&self) -> &[SessionData]

Returns the active sessions.

Source

pub fn has_active_runs(&self) -> bool

Returns whether there are any active runs.

Source

pub fn refresh_interval(&self) -> Duration

Returns the current refresh interval.

Source

pub fn set_refresh_interval(&mut self, interval: Duration)

Sets the refresh interval.

Source

pub fn is_sidebar_collapsed(&self) -> bool

Returns whether the sidebar is collapsed.

Source

pub fn set_sidebar_collapsed(&mut self, collapsed: bool)

Sets the sidebar collapsed state.

Source

pub fn toggle_sidebar(&mut self)

Toggles the sidebar collapsed state.

Source

pub fn selected_config_scope(&self) -> &ConfigScope

Returns the currently selected config scope.

Source

pub fn set_selected_config_scope(&mut self, scope: ConfigScope)

Sets the selected config scope.

Source

pub fn config_scope_projects(&self) -> &[String]

Returns the cached list of project names for config scope selection.

Source

pub fn project_has_config(&self, project_name: &str) -> bool

Returns whether a project has its own config file.

Source

pub fn cached_global_config(&self) -> Option<&Config>

Returns the cached global config, if loaded.

Source

pub fn global_config_error(&self) -> Option<&str>

Returns the global config error, if any.

Source

pub fn cached_project_config(&self, project_name: &str) -> Option<&Config>

Returns the cached project config for a specific project, if loaded.

Source

pub fn project_config_error(&self) -> Option<&str>

Returns the project config error, if any.

Source

pub fn is_context_menu_open(&self) -> bool

Returns whether the context menu is currently open.

Source

pub fn context_menu(&self) -> Option<&ContextMenuState>

Returns a reference to the context menu state, if open.

Source

pub fn open_context_menu(&mut self, position: Pos2, project_name: String)

Open the context menu for a project at the given position.

Source

pub fn close_context_menu(&mut self)

Close the context menu.

Source

pub fn selected_project(&self) -> Option<&str>

Returns the currently selected project name.

Source

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.

Source

pub fn run_history(&self) -> &[RunHistoryEntry]

Returns the run history for the selected project.

Source

pub fn is_run_history_loading(&self) -> bool

Returns whether run history is currently loading.

Source

pub fn run_history_error(&self) -> Option<&str>

Returns the run history error message, if any.

Source

pub fn is_project_selected(&self, project_name: &str) -> bool

Returns whether a project is currently selected.

Source

pub fn tabs(&self) -> &[TabInfo]

Returns all open tabs.

Source

pub fn active_tab_id(&self) -> &TabId

Returns the currently active tab ID.

Source

pub fn tab_count(&self) -> usize

Returns the number of open tabs.

Source

pub fn closable_tab_count(&self) -> usize

Returns the number of closable (dynamic) tabs.

Source

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.

Source

pub fn has_tab(&self, tab_id: &TabId) -> bool

Check if a tab with the given ID exists.

Source

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.

Source

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.

Source

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).

Source

pub fn get_command_execution( &self, cache_key: &str, ) -> Option<&CommandExecution>

Get a command execution by cache key.

Source

pub fn get_command_execution_mut( &mut self, cache_key: &str, ) -> Option<&mut CommandExecution>

Get a mutable command execution by cache key.

Source

pub fn add_command_stdout(&mut self, cache_key: &str, line: String)

Update a command execution with new stdout output.

Source

pub fn add_command_stderr(&mut self, cache_key: &str, line: String)

Update a command execution with new stderr output.

Source

pub fn complete_command(&mut self, cache_key: &str, exit_code: i32)

Mark a command execution as completed.

Source

pub fn fail_command(&mut self, cache_key: &str, error_message: String)

Mark a command execution as failed.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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().

Source

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.

Source

pub fn close_all_dynamic_tabs(&mut self) -> usize

Close all closable (dynamic) tabs. Returns the number of tabs closed.

Source

pub fn get_cached_run_state(&self, run_id: &str) -> Option<&RunState>

Get cached run state for a run detail tab.

Source

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.

Source

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

Source

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.

Source

pub fn add_user_message(&mut self, content: impl Into<String>)

Add a user message to the chat (US-003).

Source

pub fn add_claude_message(&mut self, content: impl Into<String>)

Add a Claude message to the chat (US-003).

Source

pub fn clear_chat_messages(&mut self)

Clear all chat messages (US-003).

Trait Implementations§

Source§

impl App for Autom8App

Source§

fn update(&mut self, ctx: &Context, _frame: &mut Frame)

Called each time the UI needs repainting, which may be many times per second. Read more
Source§

fn save(&mut self, _storage: &mut dyn Storage)

Called on shutdown, and perhaps at regular intervals. Allows you to save state. Read more
Source§

fn on_exit(&mut self, _gl: Option<&Context>)

Called once on shutdown, after Self::save. Read more
Source§

fn auto_save_interval(&self) -> Duration

Time between automatic calls to Self::save
Source§

fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]

Background color values for the app, e.g. what is sent to gl.clearColor. Read more
Source§

fn persist_egui_memory(&self) -> bool

Controls whether or not the egui memory (window positions etc) will be persisted (only if the “persistence” feature is enabled).
Source§

fn raw_input_hook(&mut self, _ctx: &Context, _raw_input: &mut RawInput)

A hook for manipulating or filtering raw input before it is processed by Self::update. Read more
Source§

impl Default for Autom8App

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for Autom8App

Implement Drop to ensure Claude subprocess is terminated when GUI closes.

US-008: Closing GUI terminates any active Claude subprocess cleanly. This prevents orphaned Claude processes from lingering after the GUI exits.

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more