pub struct App { /* private fields */ }Expand description
Main application state.
Implementations§
Source§impl App
impl App
Sourcepub fn new(
scripts: Scripts,
config: Config,
history: History,
project_name: String,
project_path: PathBuf,
runner: Runner,
) -> Self
pub fn new( scripts: Scripts, config: Config, history: History, project_name: String, project_path: PathBuf, runner: Runner, ) -> Self
Create a new application.
Sourcepub fn with_workspaces(
scripts: Scripts,
config: Config,
history: History,
project_name: String,
project_path: PathBuf,
runner: Runner,
workspaces: Vec<Workspace>,
) -> Self
pub fn with_workspaces( scripts: Scripts, config: Config, history: History, project_name: String, project_path: PathBuf, runner: Runner, workspaces: Vec<Workspace>, ) -> Self
Create a new application with workspace support.
Sourcepub fn should_quit(&self) -> bool
pub fn should_quit(&self) -> bool
Check if the app should quit.
Sourcepub fn script_to_run(&self) -> Option<&ScriptRun>
pub fn script_to_run(&self) -> Option<&ScriptRun>
Get the script to run after exit.
Sourcepub fn project_name(&self) -> &str
pub fn project_name(&self) -> &str
Get the project name.
Sourcepub fn project_path(&self) -> &PathBuf
pub fn project_path(&self) -> &PathBuf
Get the project path.
Sourcepub fn filter_text(&self) -> &str
pub fn filter_text(&self) -> &str
Get the current filter text.
Sourcepub fn selected_index(&self) -> usize
pub fn selected_index(&self) -> usize
Get the selected index.
Sourcepub fn scroll_offset(&self) -> usize
pub fn scroll_offset(&self) -> usize
Get the scroll offset.
Sourcepub fn visible_count(&self) -> usize
pub fn visible_count(&self) -> usize
Get the number of visible scripts.
Sourcepub fn is_monorepo(&self) -> bool
pub fn is_monorepo(&self) -> bool
Check if this is a monorepo.
Sourcepub fn workspaces(&self) -> &[Workspace]
pub fn workspaces(&self) -> &[Workspace]
Get the available workspaces.
Sourcepub fn workspace_context(&self) -> &WorkspaceContext
pub fn workspace_context(&self) -> &WorkspaceContext
Get the current workspace context.
Sourcepub fn workspace_selected(&self) -> usize
pub fn workspace_selected(&self) -> usize
Get the selected workspace index in the workspace selector.
Sourcepub fn current_workspace(&self) -> Option<&Workspace>
pub fn current_workspace(&self) -> Option<&Workspace>
Get the currently selected workspace (if any).
Get the breadcrumb path for display. Returns something like “monorepo > packages/web > scripts”
Sourcepub fn visible_scripts(&self) -> Vec<&Script>
pub fn visible_scripts(&self) -> Vec<&Script>
Get visible scripts after filtering and sorting.
Sourcepub fn selected_script(&self) -> Option<&Script>
pub fn selected_script(&self) -> Option<&Script>
Get the currently selected script.
Sourcepub fn get_visible_script(&self, index: usize) -> Option<&Script>
pub fn get_visible_script(&self, index: usize) -> Option<&Script>
Get a visible script by its display index (0-based).
Sourcepub fn toggle_filter_mode(&mut self)
pub fn toggle_filter_mode(&mut self)
Toggle filter mode.
Sourcepub fn enter_args_mode(&mut self)
pub fn enter_args_mode(&mut self)
Enter args input mode for the selected script.
Sourcepub fn toggle_multi_select(&mut self)
pub fn toggle_multi_select(&mut self)
Toggle multi-select mode.
Sourcepub fn toggle_help(&mut self)
pub fn toggle_help(&mut self)
Toggle help overlay.
Sourcepub fn enter_workspace_select(&mut self)
pub fn enter_workspace_select(&mut self)
Enter workspace selection mode.
Sourcepub fn exit_workspace_select(&mut self)
pub fn exit_workspace_select(&mut self)
Exit workspace selection and go to scripts.
Sourcepub fn select_workspace(&mut self, index: usize)
pub fn select_workspace(&mut self, index: usize)
Select a workspace and show its scripts.
Sourcepub fn select_current_workspace(&mut self)
pub fn select_current_workspace(&mut self)
Select the currently highlighted workspace.
Sourcepub fn back_to_workspace_select(&mut self)
pub fn back_to_workspace_select(&mut self)
Go back to workspace selection from script view.
Sourcepub fn workspace_move_up(&mut self)
pub fn workspace_move_up(&mut self)
Move workspace selection up.
Sourcepub fn workspace_move_down(&mut self)
pub fn workspace_move_down(&mut self)
Move workspace selection down.
Sourcepub fn workspace_move_left(&mut self)
pub fn workspace_move_left(&mut self)
Move workspace selection left (in grid).
Sourcepub fn workspace_move_right(&mut self)
pub fn workspace_move_right(&mut self)
Move workspace selection right (in grid).
Sourcepub fn select_workspace_by_number(&mut self, num: usize)
pub fn select_workspace_by_number(&mut self, num: usize)
Select workspace by number (1-9).
Sourcepub fn workspace_count(&self) -> usize
pub fn workspace_count(&self) -> usize
Get the count of items in workspace selector (root + workspaces).
Sourcepub fn set_filter(&mut self, text: String)
pub fn set_filter(&mut self, text: String)
Set the filter text.
Sourcepub fn push_filter_char(&mut self, c: char)
pub fn push_filter_char(&mut self, c: char)
Append a character to the filter text.
Sourcepub fn pop_filter_char(&mut self)
pub fn pop_filter_char(&mut self)
Remove the last character from the filter text.
Sourcepub fn clear_filter(&mut self)
pub fn clear_filter(&mut self)
Clear the filter text.
Sourcepub fn cycle_sort_mode(&mut self)
pub fn cycle_sort_mode(&mut self)
Cycle through sort modes: Recent -> Alphabetical -> Category -> Recent.
Sourcepub fn set_sort_mode(&mut self, mode: SortMode)
pub fn set_sort_mode(&mut self, mode: SortMode)
Set the sort mode.
Sourcepub fn update_visible_scripts(&mut self)
pub fn update_visible_scripts(&mut self)
Update the visible scripts based on current filter and sort mode.
Sourcepub fn update_columns(&mut self, width: u16)
pub fn update_columns(&mut self, width: u16)
Update the number of columns based on terminal width.
Sourcepub fn move_right(&mut self)
pub fn move_right(&mut self)
Move selection right by one column.
Sourcepub fn move_to_first(&mut self)
pub fn move_to_first(&mut self)
Move selection to the first item.
Sourcepub fn move_to_last(&mut self)
pub fn move_to_last(&mut self)
Move selection to the last item.
Sourcepub fn select_by_number(&mut self, num: usize)
pub fn select_by_number(&mut self, num: usize)
Select a script by number (1-9).
Sourcepub fn select_prev(&mut self)
pub fn select_prev(&mut self)
Move selection up (alias for move_up).
Sourcepub fn select_next(&mut self)
pub fn select_next(&mut self)
Move selection down (alias for move_down).
Sourcepub fn select_first(&mut self)
pub fn select_first(&mut self)
Move to first item (alias for move_to_first).
Sourcepub fn select_last(&mut self)
pub fn select_last(&mut self)
Move to last item (alias for move_to_last).
Sourcepub fn run_selected(&mut self) -> Option<ScriptRun>
pub fn run_selected(&mut self) -> Option<ScriptRun>
Run the currently selected script.
Sourcepub fn run_numbered(&mut self, num: usize) -> Option<ScriptRun>
pub fn run_numbered(&mut self, num: usize) -> Option<ScriptRun>
Run a script by number (1-9).
Sourcepub fn run_by_number(&mut self, num: usize)
pub fn run_by_number(&mut self, num: usize)
Run a script by number (alias for run_numbered, for compatibility).
Sourcepub fn run_with_args(&mut self, args: String) -> Option<ScriptRun>
pub fn run_with_args(&mut self, args: String) -> Option<ScriptRun>
Run the selected script with arguments.
Sourcepub fn toggle_current_selection(&mut self)
pub fn toggle_current_selection(&mut self)
Toggle selection of current item in multi-select mode.
Sourcepub fn multi_selected_indices(&self) -> Option<&HashSet<usize>>
pub fn multi_selected_indices(&self) -> Option<&HashSet<usize>>
Get selected indices in multi-select mode.
Sourcepub fn run_multi_selected(&mut self) -> Vec<ScriptRun>
pub fn run_multi_selected(&mut self) -> Vec<ScriptRun>
Run all selected scripts in multi-select mode.
Auto Trait Implementations§
impl Freeze for App
impl RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnwindSafe for App
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> 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