Skip to main content

Module app

Module app 

Source

Structs§

App
Main application state.
BulkTagApplyResult
Outcome of applying a bulk tag edit.
BulkTagEditorState
Snapshot state for the bulk tag editor overlay.
BulkTagRow
A single row in the bulk tag editor.
ConflictState
Form conflict detection mtimes.
ContainerActionRequest
Pending non-interactive container action (restart, stop). Same shape as ContainerExecRequest but plus an action tag and minus the askpass handling for an interactive shell. these run in a worker thread, not the foreground TUI. Reuses containers::ContainerAction so the command formatter (container_action_command) is shared.
ContainerExecRequest
Pending request to drop the user into a remote container shell. Set by the handler when Enter is pressed on a running container; drained by handle_pending_container_exec in the main loop, which suspends the TUI, runs ssh -t <alias> <runtime> exec -it <id> sh -c 'bash || sh', then restores the TUI on exit.
ContainerHit
ContainerLogsRequest
Pending request to fetch container logs from a remote host. Drained by the main loop into a background SSH thread; the result returns via AppEvent::ContainerLogsComplete and lands on the Screen::ContainerLogs overlay the user opened with l.
ContainerLogsSearch
Search state for the container logs viewer. None on Screen::ContainerLogs.search means no search is active.
ContainerSession
Per-host overlay session state; only valid while the containers overlay is open.
ContainerState
Always-present container-domain state: cache and cross-host pending operations. Separate from ContainerSession, which is the per-host overlay session state.
ContainersOverviewState
DeletedHost
Stores a deleted host for undo.
FileBrowserState
Persistent per-host file-browser state: last-visited paths per alias.
FormBaseline
Baseline snapshot of host form content for dirty-check on Esc.
FormState
Host-form and bulk-tag editor state grouped off the App god-struct. Holds the add/edit host form, its dirty-check baseline, the bulk-tag editor, the last-apply snapshot used by u to revert bulk-tag changes and the pending-discard confirmation flag. Pure state container.
HostForm
Form state for adding/editing a host.
HostHit
HostState
Host, group, sort and view state grouped off the App god-struct. Holds the parsed ~/.ssh/config, the resolved host + pattern entries, the display list built from them, the render cache, the undo stack for deletions, the multi-select set for bulk snippet runs and all sort / group / view UI-state. Pure state container.
InspectCacheEntry
One cached docker inspect result, paired with the wall-clock seconds at which it was fetched. The detail panel treats entries older than INSPECT_CACHE_TTL_SECS as stale and re-fires the SSH call.
JumpAction
JumpState
KeyPushState
Push state owned by App. Empty between push runs.
KeysState
LogsCacheEntry
One cached docker logs --tail N result. Same TTL semantics as InspectCacheEntry: the LOGS card on the detail panel re-fires the SSH call once the entry is older than LOGS_CACHE_TTL_SECS.
PendingLabelMigration
State carried between step 1 (label both configs) and step 2 (fill in the new labeled config form) of the lazy-migration add flow.
PingState
Ping/health-check state for all hosts.
ProviderFormBaseline
Baseline snapshot of provider form content for dirty-check on Esc.
ProviderFormFields
Form state for configuring a provider.
ProviderState
Provider-owned state grouped off the App god-struct. Holds the provider config, the edit form, the in-flight sync tracking (cancel flags, completed names, error aggregate), the pending delete alias, the on-disk sync history and the dirty-check baseline. Pure state container.
RecentRef
Stable reference to a hit, used for the on-disk MRU log and for dispatching jumps.
RecentsFile
On-disk schema for ~/.purple/recents.json. Versioned so future shape changes can rev without dropping user state.
RefreshBatch
State of a R batch refresh. None when no batch is active. Drives a windowed concurrency: at most MAX_PARALLEL listings are in flight at any time. Each ContainerListing event decrements in_flight and pops the next queued item; the batch ends when queue is empty and in_flight drops to zero.
RefreshQueueItem
One queued host in a R batch refresh: everything the listing thread needs to spawn an SSH docker ps for that alias.
ReloadState
Auto-reload mtime tracking.
SearchState
Search mode state.
SnippetForm
Form state for adding/editing a snippet.
SnippetFormBaseline
Baseline snapshot of snippet form content for dirty-check on Esc.
SnippetHit
SnippetHostOutput
Output from snippet execution, per host.
SnippetOutputState
State for the snippet output screen.
SnippetParamFormState
Form state for snippet parameter input.
SnippetState
Snippet-owned state grouped off the App god-struct. Holds the on-disk snippet store, the edit form, the pending execution payload, the output screen state, the param form, the terminal-submit flag, the dirty-check baseline and the pending-delete index. Pure state container.
StackMember
One running compose-stack member surfaced in the stack-restart confirm dialog. Carried so the confirm body can list every container that will be cycled, identity-and-state-clear.
StatusCenter
Status/toast-owned state grouped off the App god-struct. Contains the footer status message, the active toast and the toast queue. Pure state container plus the routing helpers that only touch these three fields. tick_status stays on App because it must read syncing_providers to suppress expiry during in-flight provider syncs.
StatusMessage
Status message displayed as toast overlay or in the footer.
SyncRecord
Record of the last sync result for a provider.
TagState
Tag editor state.
TunnelForm
Form state for adding/editing a tunnel.
TunnelFormBaseline
Baseline snapshot of tunnel form content for dirty-check on Esc.
TunnelHit
TunnelState
Tunnel-owned state grouped off the App god-struct. Contains the rule list, the edit form, the live child-process map, form baseline for the dirty check, the pending delete index and the cached per-host summary strings. Pure state container; behaviour lives on App or on dedicated methods here.
UiSelection
UpdateState
Update availability state.
VaultState
Vault SSH certificate and signing state.
WhatsNewState
State for the What’s New overlay.

Enums§

BulkTagAction
User action per tag row in the bulk tag editor.
ContainersSortMode
Sort order for the containers overview screen. Cycled with s.
FormField
GroupBy
Group mode for the host list.
HostListItem
An item in the display list (hosts + group headers).
JumpActionTarget
JumpHit
One row in the unified jump bar. Each variant carries enough state for the dispatch step to navigate the user to the matched item.
JumpMode
Which command set the jump bar displays. Determined by the screen that opened the jump bar so the action list matches what the underlying handler can dispatch.
LabelMigrationField
MatchSource
MessageClass
Classification of status messages for routing to toast overlay vs footer.
PingStatus
Ping status for a host.
ProviderFormField
Which provider form field is focused.
ProviderRow
One row in the tree-style provider list.
ProxyJumpCandidate
Item in the ProxyJump picker list. Scored hosts (used elsewhere as ProxyJump, matching a jump-host name pattern, or sharing the editing host’s domain suffix) are promoted above a visual separator so the likely pick is at the top and the rest stays alphabetical below. SectionLabel renders a non-selectable heading (e.g. “Suggestions”) above the scored section. Navigation skips both SectionLabel and Separator.
QueryScope
Screen
Which screen is currently displayed.
SnippetFormField
Which snippet form field is focused.
SortMode
Sort mode for the host list.
SourceKind
What kind of thing a jump hit represents. Drives the type-marker glyph rendered in the left column and the section grouping.
TopPage
Top-level page selected via the top navigation bar.
TunnelFormField
Which tunnel form field is focused.
TunnelSortMode
Sort order for the tunnels overview screen. Cycled with s.
ViewMode
View mode for the host list.

Constants§

LIST_CACHE_TTL_SECS
TTL for the per-host docker ps cache used by the auto-list-refresh helper. When the user scrolls to a row whose host has a stale (or missing) entry in container_cache, we re-fire the listing so the running/exited counts and uptime in the visible row reflect reality. Same value as the inspect TTL so the two refresh streams stay loosely in lockstep.
LOGS_TAIL
How many log lines the LOGS card requests via --tail. Sized for the worst-case panel height we expect (a tall terminal can fit dozens of lines inside the card); the renderer slices the trailing inner_capacity rows so a short panel only paints what fits.
PALETTE_PER_SECTION_CAP
Cap on hits rendered per section. Broad queries (e.g. one character) match thousands of candidates; capping keeps the jump bar legible without virtualizing the render. The selected hit always falls within the cap because results are sorted by score before truncation.
REFRESH_MAX_PARALLEL
Cap on parallel SSH connections during a R batch refresh. Picked to keep load on the local SSH agent and remote sshd reasonable while still amortising connection setup.

Functions§

classify_ping
Classify a ping result into a PingStatus based on RTT and threshold.
health_summary_spans
Build health summary spans: ●23 ▲2 ✖1 ○1 Only includes states with count > 0. Returns empty vec if no pings.
health_summary_spans_for
Build health summary spans for a subset of host aliases. Only includes states with count > 0. Returns empty vec if no pings.
match_source_for_host
Determine which field caused the host hit to match. The renderer uses this to append a via user, via proxy, vault: <role> hint to the row when the matched field is not part of the visible columns. Returns None if the alias/hostname (already visible) matched.
parse_query_scope
Field-prefix parser: user:eric → (Some(QueryScope::User), “eric”). Returns (None, query) for queries without a recognised scope.
ping_sort_key
Sort key for ping status: unreachable first, slow, reachable, unchecked last.
propagate_ping_to_dependents
Propagate a ping result to all hosts that use the given alias as ProxyJump bastion.
select_display_tags
Select up to 3 tags for display based on view mode and grouping. Returns a Vec of up to 3 DisplayTags (user tags first, then provider tags).
status_glyph
Status glyph for dual encoding (color + shape). ● online, ▲ slow, ✖ down. Checking uses animated spinner via tick.