Skip to main content

AppState

Struct AppState 

Source
pub struct AppState {
Show 18 fields pub input: InputState, pub view: ViewState, pub selection: SelectionState, pub web: WebState, pub agents: HashMap<String, MonitoredAgent>, pub agent_order: Vec<String>, pub sort_by: SortBy, pub monitor_scope: MonitorScope, pub current_session: Option<String>, pub current_window: Option<u32>, pub teams: HashMap<String, TeamSnapshot>, pub target_to_pane_id: HashMap<String, String>, pub create_process: Option<CreateProcessState>, pub confirmation_state: Option<ConfirmationState>, pub error_message: Option<String>, pub last_poll: Option<DateTime<Utc>>, pub running: bool, pub show_activity_name: bool,
}
Expand description

Application state

Fields§

§input: InputState

Input-related state

§view: ViewState

UI view state (overlays, scroll, animations)

§selection: SelectionState

Selection/navigation state

§web: WebState

Web-related state

§agents: HashMap<String, MonitoredAgent>

All monitored agents by target ID

§agent_order: Vec<String>

Order of agents for display

§sort_by: SortBy

Current sort method

§monitor_scope: MonitorScope

Monitor scope for filtering panes

§current_session: Option<String>

Current session name (for scope display)

§current_window: Option<u32>

Current window index (for scope display)

§teams: HashMap<String, TeamSnapshot>

Team snapshots by team name

§target_to_pane_id: HashMap<String, String>

Mapping of tmux target (e.g. “main:0.1”) to pane_id (e.g. “5”) for IPC

§create_process: Option<CreateProcessState>

Create process flow state (None if not in create mode)

§confirmation_state: Option<ConfirmationState>

Confirmation dialog state (None if not showing)

§error_message: Option<String>

Error message to display

§last_poll: Option<DateTime<Utc>>

Last poll timestamp

§running: bool

Whether the app is running

§show_activity_name: bool

Show activity name (tool/verb) during Processing instead of generic “Processing”

Implementations§

Source§

impl AppState

Source

pub fn new() -> Self

Create a new application state

Source

pub fn tick_spinner(&mut self)

Advance the spinner animation frame (time-based, ~150ms per frame)

Source

pub fn spinner_char(&self) -> char

Get the current spinner character

Source

pub fn tick_marquee(&mut self)

Advance the marquee scroll offset (time-based)

Source

pub fn reset_marquee(&mut self, new_id: Option<String>)

Reset marquee state when selection changes

Source

pub fn marquee_offset(&self) -> usize

Get the current marquee scroll offset

Source

pub fn shared() -> SharedState

Create a shared state

Source

pub fn selected_agent(&self) -> Option<&MonitoredAgent>

Get the currently selected agent

Source

pub fn selected_agent_mut(&mut self) -> Option<&mut MonitoredAgent>

Get a mutable reference to the selected agent

Source

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

Get the selected agent’s target ID

Source

pub fn update_agents(&mut self, agents: Vec<MonitoredAgent>)

Update agents from a new list

Source

pub fn cycle_sort(&mut self)

Cycle through sort methods

Source

pub fn cycle_monitor_scope(&mut self)

Cycle through monitor scopes

Source

pub fn get_group_key(&self, agent: &MonitoredAgent) -> Option<String>

Get the current group key for an agent (for display headers)

Source

pub fn toggle_group_collapse(&mut self, group_key: &str)

Toggle collapse state for a group

Source

pub fn is_group_collapsed(&self, group_key: &str) -> bool

Check if a group is collapsed

Source

pub fn select_previous(&mut self)

Move selection up

Source

pub fn select_next(&mut self)

Move selection down

Source

pub fn select_first(&mut self)

Select first entry

Source

pub fn select_last(&mut self)

Select last entry

Source

pub fn update_selectable_entries( &mut self, selectable_count: usize, agent_index: Option<usize>, )

Update selectable count and sync entry index

Source

pub fn get_known_directories(&self) -> Vec<String>

Get all unique directories from current agents

Source

pub fn toggle_help(&mut self)

Toggle help screen

Source

pub fn toggle_qr(&mut self)

Toggle QR code screen

Source

pub fn init_web(&mut self, token: String, port: u16)

Initialize web settings

Source

pub fn get_web_url(&self) -> Option<String>

Get web URL for QR code

In WSL environments, returns Windows host IP instead of WSL internal IP, since external devices (phones) cannot access WSL’s internal network directly.

Source

pub fn scroll_help_down(&mut self, amount: u16)

Scroll help screen down

Source

pub fn scroll_help_up(&mut self, amount: u16)

Scroll help screen up

Source

pub fn scroll_preview_down(&mut self, amount: u16)

Scroll preview down

Source

pub fn scroll_preview_up(&mut self, amount: u16)

Scroll preview up

Source

pub fn agents_needing_attention(&self) -> Vec<&MonitoredAgent>

Get agents that need attention (awaiting approval or error)

Source

pub fn attention_count(&self) -> usize

Get count of agents needing attention

Source

pub fn set_error(&mut self, message: String)

Set error message

Source

pub fn clear_error(&mut self)

Clear error message

Source

pub fn quit(&mut self)

Stop the application

Source

pub fn enter_input_mode(&mut self)

Enter input mode

Source

pub fn enter_passthrough_mode(&mut self)

Enter passthrough mode

Source

pub fn exit_input_mode(&mut self)

Exit input mode and clear buffer

Source

pub fn is_input_mode(&self) -> bool

Check if in input mode

Source

pub fn is_passthrough_mode(&self) -> bool

Check if in passthrough mode

Source

pub fn get_input(&self) -> &str

Get the input buffer

Source

pub fn get_cursor_position(&self) -> usize

Get cursor position

Source

pub fn input_char(&mut self, c: char)

Insert a character at cursor position

Source

pub fn input_backspace(&mut self)

Delete character before cursor (backspace)

Source

pub fn input_delete(&mut self)

Delete character at cursor (delete key)

Source

pub fn cursor_left(&mut self)

Move cursor left

Source

pub fn cursor_right(&mut self)

Move cursor right

Source

pub fn cursor_home(&mut self)

Move cursor to start

Source

pub fn cursor_end(&mut self)

Move cursor to end

Source

pub fn take_input(&mut self) -> String

Take the input buffer content and clear it

Source

pub fn start_create_process( &mut self, group_key: String, panes: Vec<PaneInfo>, config: &CreateProcessSettings, )

Start create process flow from a group

Source

pub fn toggle_tree_node(&mut self, key: &str)

Toggle a node’s collapsed state in the create process tree

Source

pub fn cancel_create_process(&mut self)

Cancel create process flow

Source

pub fn is_create_process_mode(&self) -> bool

Check if in create process mode

Source

pub fn show_confirmation(&mut self, action: ConfirmAction, message: String)

Show a confirmation dialog

Source

pub fn cancel_confirmation(&mut self)

Cancel the confirmation dialog

Source

pub fn is_showing_confirmation(&self) -> bool

Check if confirmation dialog is showing

Source

pub fn get_confirmation_action(&self) -> Option<ConfirmAction>

Get the confirmation action (for execution)

Source

pub fn create_process_cursor_up(&mut self)

Move cursor up in create process popup (skips headers in directory step)

Source

pub fn create_process_cursor_down(&mut self, max: usize)

Move cursor down in create process popup (skips headers in directory step)

Source

pub fn create_process_cursor(&self) -> usize

Get create process cursor position

Trait Implementations§

Source§

impl Debug for AppState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AppState

Source§

fn default() -> Self

Returns the “default value” for a 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> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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, 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<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