Skip to main content

App

Struct App 

Source
pub struct App {
Show 27 fields pub nav: NavigationState, pub catalog: CatalogStore, pub search_engine: SearchEngine, pub search_query: String, pub search_active: bool, pub filtered_indices: Vec<usize>, pub subprocess_output: Vec<OutputLine>, pub subprocess_handle: Option<SubprocessHandle>, pub validation_gates: Vec<ValidationGate>, pub export_state: ExportBuilderState, pub model_policy_state: ModelPolicyBuilderState, pub model_policy_stage: Option<ModelPolicyStage>, pub status_message: Option<(String, Instant)>, pub session_id: Uuid, pub should_quit: bool, pub no_color: bool, pub theme_mode: ThemeMode, pub workspace_root: PathBuf, pub running_gate: Option<String>, pub running_gate_start: Option<Instant>, pub pending_subprocess: Option<Receiver<Result<SubprocessHandle>>>, pub provider_filter: Option<String>, pub harness_filter: Option<String>, pub show_help_overlay: bool, pub completion_suggestions: Vec<String>, pub completion_index: usize, pub dirty: bool,
}
Expand description

Main application state.

Fields§

§nav: NavigationState§catalog: CatalogStore§search_engine: SearchEngine§search_query: String§search_active: bool§filtered_indices: Vec<usize>§subprocess_output: Vec<OutputLine>§subprocess_handle: Option<SubprocessHandle>§validation_gates: Vec<ValidationGate>§export_state: ExportBuilderState§model_policy_state: ModelPolicyBuilderState§model_policy_stage: Option<ModelPolicyStage>

Set while a model-policy subprocess (apply or chained integrity refresh) is running; drives completion handling in tick().

§status_message: Option<(String, Instant)>§session_id: Uuid§should_quit: bool§no_color: bool§theme_mode: ThemeMode

Resolved theme mode (Dark/Light) for the session; toggled at runtime via the t keybinding (Req 35.6). Defaults to Dark; main overrides it from the --theme flag / system detection.

§workspace_root: PathBuf§running_gate: Option<String>

Name of the currently running validation gate (for status tracking). When set, prevents concurrent execution of the same gate.

§running_gate_start: Option<Instant>

Timestamp when the currently running gate started (for animated indicator).

§pending_subprocess: Option<Receiver<Result<SubprocessHandle>>>

Pending subprocess spawn result — polled in tick() to avoid block_on inside tokio runtime.

§provider_filter: Option<String>§harness_filter: Option<String>§show_help_overlay: bool§completion_suggestions: Vec<String>§completion_index: usize§dirty: bool

Dirty flag for async event loop — render only when true (250ms tick resets).

Implementations§

Source§

impl App

Source

pub fn new( catalog: CatalogStore, workspace_root: PathBuf, session_id: Uuid, no_color: bool, ) -> Self

Source

pub fn handle_key_event(&mut self, key: KeyEvent)

Handle a key event. Dispatches based on search mode and current view.

Source

pub fn mark_dirty(&mut self)

Mark the app as dirty (needs rendering) — used by async event loop.

Source

pub fn reload_catalog(&mut self)

Reload the entire catalog from the workspace root and refresh the filtered view (Task 9.1 — live reload on filesystem change).

Best-effort: catalog load errors are surfaced via the status message but never panic, so a malformed edit keeps the previous render usable.

Source

pub fn reload_catalog_file(&mut self, path: &Path) -> ReloadOutcome

Reload a single changed catalog file in place (Task 9.1).

Returns the [ReloadOutcome] so callers (and tests) can observe whether the file was reloaded, retained on parse error, or unchanged.

Source

pub fn tick(&mut self)

Tick: clear expired status messages, drain subprocess output with sanitization, and check subprocess timeout and completion.

Source

pub fn render(&mut self, frame: &mut Frame<'_>)

Render the full UI — v2 primary surface: tab bar + tab body.

Source

pub fn render_tab(&self, area: Rect, frame: &mut Frame<'_>, theme: &Theme)

Render the active v2 operator-console tab into area (Task 11.3).

Dispatches to the v2 widgets based on self.nav.current_tab. The Dependencies tab renders the real catalog dependency graph and Overview a catalog summary; tabs whose live data depends on a workspace scan/index (coverage, violations, audit) render their widget with empty data until that pipeline is wired into the TUI flow.

Source§

impl App

Source

pub fn update_completion_suggestions(&mut self)

Update tab completion suggestions based on current export builder field.

Source

pub fn get_provider_list(&self) -> Vec<(String, usize)>

Get provider list with counts.

Source

pub fn get_role_list(&self) -> Vec<(String, String, usize)>

Get role list with labels and agent counts.

Auto Trait Implementations§

§

impl !RefUnwindSafe for App

§

impl !UnwindSafe for App

§

impl Freeze for App

§

impl Send for App

§

impl Sync for App

§

impl Unpin for App

§

impl UnsafeUnpin for App

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> 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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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