pub struct AppState {Show 24 fields
pub screen: Screen,
pub status_msg: Option<String>,
pub should_quit: bool,
pub project: Project,
pub settings: Settings,
pub theme: Theme,
pub active_contexts: HashSet<String>,
pub file_index: SharedFileIndex,
pub stashed_commit_window: Option<Box<CommitWindow>>,
pub stashed_primary: Option<Screen>,
pub stashed_terminal: Option<Box<TerminalView>>,
pub registers: Registers,
pub clipboard: Option<Clipboard>,
pub schema_cache: HashMap<String, Arc<Value>>,
pub file_selector_search: Option<JoinHandle<()>>,
pub file_watcher: FileWatcher,
pub issue_registry: IssueRegistry,
pub task_registry: TaskRegistry,
pub task_executor: TaskExecutor,
pub log_store: LogStore,
pub task_config: Option<TasksFile>,
pub status_bar_clicks: StatusBarClickState,
pub context_menu: Option<ContextMenu>,
pub project_search_cancel: Option<CancellationToken>,
}Fields§
§screen: Screen§status_msg: Option<String>§should_quit: bool§project: Project§settings: Settings§theme: Theme§active_contexts: HashSet<String>Derived each frame by recompute_contexts — never mutated directly.
file_index: SharedFileIndexBackground file index shared with every FileSelector instance.
None while the initial walk is still running.
stashed_commit_window: Option<Box<CommitWindow>>Stashed CommitWindow — preserved when navigating to another screen so state (staged files, message, cursor, etc.) survives a round-trip.
stashed_primary: Option<Screen>Stashed primary screen — preserved when opening a modal so that a
primary view (Editor, Terminal, CommitWindow, GitHistory) can be
restored when modals close. Stores the full Screen value.
stashed_terminal: Option<Box<TerminalView>>Stashed TerminalView — preserved when navigating away so PTY sessions survive switching to the file selector or editor and back.
registers: RegistersAuthoritative clipboard history (yank ring).
clipboard: Option<Clipboard>System clipboard handle — initialised once at startup, best-effort.
None when the OS clipboard is unavailable (headless systems, etc.).
schema_cache: HashMap<String, Arc<Value>>Parsed schema cache: maps schema JSON -> parsed Value. Primary cache
stored on AppState so completion tasks can reuse the same parsed tree.
This map is mutated only on the main thread while AppState is mutable
(e.g., when handling operations); background tasks must be given a
cloned Arc<serde_json::Value> to avoid concurrent mutation.
file_selector_search: Option<JoinHandle<()>>Handle for the currently in-flight async file-selector search task. Aborted (and replaced) each time the filter changes.
file_watcher: FileWatcherGlobal file watcher for detecting external modifications.
issue_registry: IssueRegistryCentral in-memory store for all IDE issues (ephemeral + persistent).
Ephemeral issues are cleared on IDE restart (new registry = empty).
The Persistent Component populates this via load_persistent at startup.
task_registry: TaskRegistryCentral scheduler for all named-queue tasks (build, lint, test, etc.).
Lives on the main thread; async workers communicate results via op_tx.
task_executor: TaskExecutorAsync process runner — spawns tasks and streams their output.
log_store: LogStoreOn-disk log storage for task output.
task_config: Option<TasksFile>Parsed task configuration from .oo/tasks.yaml.
None if the file does not exist or failed validation.
status_bar_clicks: StatusBarClickStateClick regions produced by the last status-bar render.
Used by handle_mouse to dispatch menu/cancel actions.
Currently open context menu, if any.
Set by Operation::OpenContextMenu, cleared by Operation::CloseContextMenu
or when the user selects an item. app.rs intercepts input and renders
the menu as a floating overlay when this is Some.
project_search_cancel: Option<CancellationToken>Cancellation token for any in-flight project-wide search spawned from the editor’s Expanded search bar. Replaced (and the old token cancelled) each time a new search starts.
Implementations§
Source§impl AppState
impl AppState
pub fn new( screen: Screen, project: Project, settings: Settings, file_index: SharedFileIndex, ) -> Self
Sourcepub fn recompute_contexts(&mut self)
pub fn recompute_contexts(&mut self)
Called once per frame, after operations are applied. Each subsystem contributes its own tags — no push/pop anywhere else.
Source§impl AppState
impl AppState
Sourcepub fn open_file_preserving_stash(&mut self, path: PathBuf) -> bool
pub fn open_file_preserving_stash(&mut self, path: PathBuf) -> bool
Replace the active screen.
Opens a file while preserving any stashed primary view state.
This is the state-management core of Operation::OpenFile: it flushes
any stashed editor into project.editor_state so that take_buffer can
restore unsaved changes, cursor, and undo history for the target file.
Returns true if the file was opened successfully, false on I/O error.
Sourcepub fn set_screen(&mut self, new_screen: Screen) -> Option<Screen>
pub fn set_screen(&mut self, new_screen: Screen) -> Option<Screen>
If transitioning from a Primary -> Modal view and no primary is currently
stashed, move the previous screen into stashed_primary and return None
(caller should not attempt to consume the previous screen).
Otherwise return Some(prev) so callers can run consume_prev_screen.
Auto Trait Implementations§
impl !Freeze for AppState
impl !RefUnwindSafe for AppState
impl Send for AppState
impl !Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
impl !UnwindSafe for AppState
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> 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