pub struct AppShell {
pub config: ShellConfig,
pub registry: ScreenRegistry,
pub active_screen: Option<ScreenId>,
pub keymap: Keymap,
pub overlays: OverlayManager,
pub palette: CommandPalette,
pub status_line: StatusLine,
pub should_quit: bool,
/* private fields */
}Expand description
The main app shell that manages screens, chrome, and input dispatch.
Fields§
§config: ShellConfigShell configuration.
registry: ScreenRegistryScreen registry.
active_screen: Option<ScreenId>Currently active screen ID.
keymap: KeymapKeymap for input resolution.
overlays: OverlayManagerOverlay manager.
palette: CommandPaletteCommand palette.
status_line: StatusLineStatus line content.
should_quit: boolWhether the app should quit.
Implementations§
Source§impl AppShell
impl AppShell
Sourcepub fn new(config: ShellConfig) -> Self
pub fn new(config: ShellConfig) -> Self
Create a new app shell with the given config.
Navigate to a screen by ID.
Sourcepub fn next_screen(&mut self)
pub fn next_screen(&mut self)
Navigate to the next screen in tab order.
Sourcepub fn prev_screen(&mut self)
pub fn prev_screen(&mut self)
Navigate to the previous screen in tab order.
Sourcepub fn screen_context(&self, area: Rect) -> ScreenContext
pub fn screen_context(&self, area: Rect) -> ScreenContext
Build the screen context for the current state.
Sourcepub fn handle_input(&mut self, event: &InputEvent) -> bool
pub fn handle_input(&mut self, event: &InputEvent) -> bool
Handle an input event. Returns true if the app should quit.
Returns the confirmed palette action ID if the user selected a command.
Callers should check last_palette_action() after calling this.
Sourcepub fn last_palette_action(&self) -> Option<&str>
pub fn last_palette_action(&self) -> Option<&str>
Get the last palette action confirmed by the user.
Returns Some(action_id) if the user selected an action from the
command palette during the last handle_input() call.