Interactive terminal application
The interactive terminal application is the session coordinator for a live Kubernetes cluster. It joins terminal input, cluster data, navigation, and feature workflows so an engineer can inspect resources or take action without losing the current context.
Application role
The application is the shared state model between the terminal and the cluster. It keeps the active context, resource view, scope, selection, overlays, background work, and user feedback together while other tasks supply new data.
Session state
The App state in src/…/mod.rs represents one terminal session. It holds the current resource view and the temporary state around it, such as document views, prompts, running tasks, status claims, history, cached recent views, plugins, credential recovery, local manifest browsing, file transfers, port forwards, change notifications, and workflow settings. Input handlers and background results therefore update one user-visible session instead of separate copies of navigation state.
The state also gives each transient workflow a return mode and, when needed, a return selection. This lets logs, documents, reports, prompts, and pickers close without losing the object or view that started them. Named layouts and synthetic views use the same session state, so changing how a table is shown does not change the resource scope behind it.
References: src/…/mod.rs• L174-249 src/…/mod.rs• L1993-2081 src/…/mod.rs• L2374-2404 src/…/mod.rs• L2545-2603
Session startup
The startup path in src/main.rs prepares the cluster connection, resolves settings for the active context, creates the application, and selects the first resource view. It can start in a normal view, a context picker, or a disconnected state. The same entry point also supports connectivity checks and one-frame snapshot output.
Cluster setup must complete API discovery before the application treats a context as ready. The same discovery path is used at startup and after a context change, including kubeconfig files that use wrapped command output. A plugin can also reload the kubeconfig and reopen the context picker without changing the active context.
References: src/main.rs• L223-371 src/main.rs• L373-545 src/main.rs• L544-573 src/…/kubeconfig.rs• L3-73 src/…/kubeconfig.rs• L75-150
Event coordination
The application uses one event-driven loop to combine user input with asynchronous cluster and feature results. Input changes state directly. Watches and feature tasks send messages that the application accepts or rejects before the next render.
Event loop
The loop in src/main.rs receives terminal events, application messages, redraw timing, and maintenance signals. It keeps input responsive and groups busy update streams before drawing. Commands that need direct terminal control temporarily suspend the rendered interface and then return to the same session.
This diagram shows how terminal input and background work meet in application state before the screen is updated.
flowchart LR
T[Terminal events] --> L[Application event loop]
W[Cluster watches and feature tasks] --> Q[Message channel]
Q --> L
L --> S[App session state]
S --> R[Terminal rendering]
S --> C[Interactive command or workflow]
C --> W
References: src/main.rs• L1009-1044 src/main.rs• L1047-1164 src/…/mod.rs• L235-249 src/…/mod.rs• L2528-2537
Message validity
Each background operation belongs to the view generation that started it. A view change advances that generation and stops displaced work. The application ignores results from an older generation, so a slow request cannot replace data for a newer view.
The same rule applies to feature requests that have their own request number. This matters for namespace discovery, RBAC reports, adjacent-resource reports, PVC work, plugin output, log streams, rollout previews, and fleet summaries because each can finish after the user has moved elsewhere. Log streams use a separate lifecycle so opening or closing logs does not tear down the table watch. Persistent notification watches use a context epoch instead, so they can remain active while the user changes views without crossing into another cluster.
References: src/…/lifecycle.rs• L443-546 src/…/lifecycle.rs• L1059-1122 src/…/pickers.rs• L25-57 src/…/plugins.rs• L515-618 src/…/logs.rs• L1221-1301 src/…/fleet.rs• L119-155 src/…/mod.rs• L1991-1995 src/…/mod.rs• L2549-2562 src/…/rollout.rs• L405-450
Sleep recovery
The application treats a long machine sleep as a loss of watch freshness. It detects the gap with clocks that separate awake time from total elapsed time, then restarts the current table watch once the user is back at the table. An overlay or an in-flight context switch delays that restart so it does not disrupt the active workflow.
For a namespace pattern, recovery reuses the namespaces already resolved for the current selection. A failed context switch keeps its error visible and allows the old view to recover when control returns to it. Followed log streams also reconnect after wake and continue from their last known point.
References: src/…/resume.rs• L1-16 src/…/resume.rs• L59-97 src/…/resume.rs• L31-115 src/…/log_follow.rs• L280-313
Cluster data coordination
The application turns changing cluster data into a stable resource view. The active kind and scope define the watch. The store holds the current objects. The application adds selection, filtering, metrics, table columns, watch health, and access recovery around those objects.
Resource views
Each resource view has a kind, namespace scope, optional selectors, and a selected row. Starting a view resets transient selection state, starts the matching watch, and prepares related data sources. A complete recent snapshot can appear while the new watch loads, which makes navigation feel immediate without treating partial data as current.
The table-facing row view turns stored objects into the visible set. It applies owner and workload scope, server-side selectors already attached to the watch, local text or structured filters, and the selected sort. It also supplies derived cells such as metrics, status, and operational fields. The table can render only the current window while keeping selection and actions tied to the same row identity.
The application keeps only complete snapshots of recently left views. It keys each snapshot by the full watch scope and limits both the number of views and the total retained objects. A context switch clears these snapshots because rows from another cluster are not valid in the new session.
The table can also combine live objects with derived data. Wide mode adds operational columns. Named layouts select configured columns and initial sorting for a resource kind. Custom views add columns from object fields. Metrics and node pod counts enrich supported rows without changing the resource identity. Row filtering and ordering are rebuilt when their inputs change, while unchanged row data can be reused between draws.
The workloads view provides one aggregate view for common workload kinds. It shows top-level workload rows by default and can include owned rows when requested. Because rows from different kinds can share a name, actions keep the row kind with the selection and apply only to compatible marked rows.
References: src/…/lifecycle.rs• L443-546 src/…/lifecycle.rs• L548-599 src/…/layouts.rs• L5-112 src/…/rows.rs• L44-127 src/…/rows.rs• L552-779 src/…/rows.rs• L858-969 src/…/mod.rs• L1811-1851 src/…/mod.rs• L1974-2041 src/…/tests.rs• L683-741 src/…/workloads.rs• L134-196 src/…/workloads.rs• L246-356
When a command or resource query misses the known API catalog, the application can request fresh discovery and retry the lookup. It throttles these requests, ties the result to the current cluster and view, and refreshes command suggestions and access data when new kinds arrive. This lets resources installed during a running session become usable without a restart.
References: src/…/mod.rs• L2560-2570 src/…/mod.rs• L3121-3133 src/…/rediscovery.rs• L1-17 src/…/rediscovery.rs• L25-117
Scope and filtering
The application combines namespace scope, drill-down scope, and user filters to define the visible set. Label and field selectors can narrow the cluster request. Local text and column filters then shape the rows shown to the user. The same scope is kept as the user moves into related resources.
The filter status tells the user where filtering takes place. A pending label or field selector waits for confirmation before it changes the watch. Once applied, the view can show server filtering, local filtering, or both. This keeps a local search from being mistaken for a narrower cluster request.
Namespace patterns extend this model to a group of namespaces. A pattern such as *-crons is resolved to matching names. The application then runs separate watches and merges their objects while keeping the real namespace on each row. A failed member watch marks the combined view incomplete instead of making it look healthy. If discovery fails while restoring a saved pattern, the application keeps the pattern unresolved rather than silently loading the default namespace. A new discovery request supersedes an older one, so late discovery cannot change a newer selection.
The workloads view uses the same namespace pattern as its aggregate watches. A row from one namespace therefore remains distinct from an equal-named row in another namespace.
References: src/…/namespace_patterns.rs• L24-209 src/…/lifecycle.rs• L20-64 src/…/lifecycle.rs• L443-530 src/…/rows.rs• L44-127 src/…/rows.rs• L464-493 src/…/namespace_patterns.rs• L43-194 src/…/namespace_patterns.rs• L407-485 src/…/workloads.rs• L358-388 src/…/input.rs• L410-421
Watch health
Watch status is part of the session's meaning, not only a transport detail. The application keeps a failure visible until the matching watch recovers. A list or reset alone does not prove that the live stream works, and one failed namespace in a pattern keeps the combined scope incomplete. During a relist, the application preserves usable rows when possible and removes only the affected namespace's stale rows after that namespace finishes syncing.
Some supporting data uses a controlled fallback when a watch is forbidden. For example, node pod counts can start with a list and then poll at a paced interval instead of retrying a refused watch. A desync rebuilds counts from the new list so objects that disappeared do not remain as false data.
The application also separates access failure from a general API failure. When an exec-plugin certificate is near expiry or the server refuses credentials, it can retry credential renewal and replace the client. It reports the renewal error with the watch failure when that context explains the failure. A successful watch recovery cancels a refusal-driven renewal, while an expiry-driven renewal still completes so the next watch uses a valid client.
References: src/…/lifecycle.rs• L858-1015 src/…/lifecycle.rs• L1018-1057 src/…/lifecycle.rs• L1141-1235 src/…/credentials.rs• L27-175 src/…/tests.rs• L431-605 src/…/watch_status.rs• L3-29 src/…/credentials.rs• L154-216
Credential recovery
Credential recovery keeps a live session usable when an exec-plugin client certificate expires or the cluster refuses the credentials. The application starts one renewal attempt at a time, waits between failed attempts, rejects unusable or expired results, and restarts the active watch only after it installs a different usable client.
When a credential plugin needs terminal input, the application offers authentication without interrupting typing, filtering, or another picker. The user can accept the offer, run the plugin on the terminal, and return either to the current watch or to the context switch that requested the client. A declined switch returns to the context picker when no connection exists.
The recovery state belongs to the current context and watch. A context switch invalidates an old renewal result. A token client has no certificate expiry to renew, but a credentials-refused watch can still trigger the plugin. A renewal failure stays attached to credential-related watch errors while permission errors and ordinary outages keep their own meaning.
References: src/…/credentials.rs• L1-12 src/…/credentials.rs• L27-65 src/…/credentials.rs• L67-175 src/…/lifecycle.rs• L1024-1047 src/…/credentials.rs• L218-459 src/…/exec_auth.rs• L27-195
Selection pickers
Pickers turn common session changes into focused choices without leaving the application. Namespace and context pickers fetch current choices in the background, support fuzzy search, and keep favorites or recent namespaces useful for the active context. Sort, copy, layout, and container pickers use the current table or resource as their source, so a choice changes the view or starts a focused action without changing the underlying resource selection.
The context picker also provides a safe starting point when the current cluster is unreachable. A successful context change reloads cluster-specific settings and starts a fresh resource view, while a failed change leaves the error visible for another choice.
References: src/…/pickers.rs• L10-69 src/…/pickers.rs• L211-371 src/…/pickers.rs• L373-497 src/…/pickers.rs• L619-807 src/…/tests.rs• L1190-1245 src/…/tests.rs• L1240-1307
Feature workflows
Feature workflows extend the resource view without replacing the session coordinator. They start from the active selection or scope, use background work when needed, and return results through the same state and status paths.
Inspection workflows
The application turns a selected object into a document, stream, related view, or operational report. YAML, descriptions, diffs, events, logs, health explanations, timelines, GitOps views, adjacent resources, and RBAC views preserve a return point to the source view. This lets an engineer inspect a resource without rebuilding the surrounding session.
Log views can follow one pod, marked pods, or pods selected by a workload or service. They can also query an external log provider for data that survives pod restarts and covers deleted pods or whole namespaces. Structured JSON records can be shown as raw lines, compact records, or formatted JSON, while filtering, follow state, and horizontal position remain part of the same log session.
Followed logs track pod identity and container state while the user watches output. A restarted container resumes from the last known time without repeating lines. A recreated, deleted, failed, or no-longer-matching pod ends its stream with a clear notice. A workload log view can add new pods as a rollout creates them, while an access refusal stops retrying instead of hiding the failure.
The adjacent view explains direct relationships around an object. It can show owners, children, named objects, and objects that name the source. RBAC views explain stored bindings and role rules. They are not the same as a live access check: :can-i asks the cluster what the current identity may do in a chosen namespace or for one resource action.
References: src/…/adjacent.rs• L35-73 src/…/rbac.rs• L56-177 src/…/authz.rs• L8-131 src/…/logs.rs• L149-185 src/…/logs.rs• L933-1050 src/…/logs.rs• L1221-1385 src/…/mod.rs• L1362-1407 src/…/log_follow.rs• L128-278 src/…/log_follow.rs• L315-684
Cluster actions
Mutating workflows begin with a selected or marked resource and pass through one application boundary before reaching the cluster. The application chooses the resource-specific action, collects prompts or confirmations, checks read-only and guardrail policy, and reports progress or failure in the shared session.
The same boundary supports ordinary resource changes and controller-aware actions. It can warn when a controller will recreate an object. It can express actions such as scaling, restart, reconciliation, suspension, manual triggers, image changes, node changes, certificate approval, Helm operations, workload rollback, and debug sessions without changing the basic table flow.
Flux and Argo CD actions apply only to their matching API groups. GitOps actions can suspend, resume, reconcile, or sync managed resources while preserving controller-specific state. Rollout history is a scoped view of revisions owned by the selected workload. A preview compares a chosen revision with the live template before confirmation, and rollback checks that the target still matches the selected workload.
References: src/…/actions.rs• L18-203 src/…/actions.rs• L265-373 src/…/actions.rs• L622-795 src/…/helpers.rs• L22-180 src/…/overlays.rs• L95-222 src/…/flux.rs• L34-370 src/…/flux.rs• L373-565 src/…/rollout.rs• L148-313 src/…/rollout.rs• L315-582
Interactive operations
Some workflows leave the table for a short interactive operation. Shell access, editing, debugging, attaching, file transfer, and PVC access either suspend the terminal UI or keep a controlled background process alive. The application owns the return path and cleanup so helper pods, child processes, and temporary modes do not outlive the user-visible workflow.
Port forwarding is different from a foreground shell. It runs in the background so the engineer can keep browsing, records the cluster and target that it belongs to, and stops with the application. A picker uses declared ports when available and accepts a custom local-to-remote mapping when needed.
PVC browsing is a two-pane workflow for a bound filesystem volume. It first finds a pod that mounts the claim. If none exists, it can ask to create a temporary helper pod. The helper is removed when the browser or shell ends.
References: src/…/actions.rs• L376-436 src/…/actions.rs• L905-1231 src/…/actions.rs• L1284-1383 src/…/overlays.rs• L500-567 src/…/pvcexplore.rs• L176-419 src/…/input.rs• L111-139
Manifest workflows
The local manifest workflow lets an engineer browse files or directories, inspect a manifest, and apply or delete its rendered objects against the active cluster. It keeps the rendered snapshot from the preview through the guardrail check and final operation, so the reviewed input is the input sent to the cluster.
Apply actions show a cluster diff before confirmation. Delete and apply both use the discovered resource identity and object scope when checking guardrails. The workflow returns to the manifest browser after inspection or confirmation and rejects stale results when the selected path changes.
References: src/…/mod.rs• L233-244 src/…/mod.rs• L2380-2385 src/…/dir.rs• L1-8 src/…/dir.rs• L278-321 src/…/dir.rs• L450-556
Change notifications
Change notifications watch a selected object independently of the current table view. They report meaningful state changes through the status area and configured notification channels, then stop when the user disables them, changes cluster context, or ends the session.
The notification watcher records the initial object state without reporting it as a change. Later transitions are grouped into bounded messages. A context epoch prevents queued messages from the old cluster from reaching the new session.
References: src/…/mod.rs• L2549-2575 src/…/mod.rs• L2994-2997 src/…/notify.rs• L7-17 src/…/notify.rs• L69-159 src/…/notify.rs• L162-241
Extensible workflows
Plugins, bookmarks, and workspaces connect user-defined behavior to the same command and key surfaces as built-in features. A bookmark can restore a context, resource, namespace, layout, filter, sort, or dashboard. A plugin can target the current object, a marked set, or the context. Its inputs are checked before launch, and its output can be a terminal session, popup, report, or background activity.
Dashboards use the same coordinator for broader views. Pulse summarizes cluster health across namespaces. Xray builds an owner and child tree. Fleet gathers selected context summaries so an engineer can compare clusters and drill into a degraded Argo CD application without leaving the application model.
References: src/…/bookmarks.rs• L23-120 src/…/plugins.rs• L29-113 src/…/plugins.rs• L168-226 src/…/plugins.rs• L228-513 src/…/plugins.rs• L515-731 src/…/fleet.rs• L18-117 src/…/fleet.rs• L119-280 src/…/dashboards.rs• L3-109 src/…/dashboards.rs• L126-220
Release checks
Release checks are background services rather than cluster workflows. A startup check uses a cache and reports only a newer release, while an explicit command performs a fresh check and reports success or failure. The result remains available to the information view even after the short status notice expires, and it does not replace an existing warning.
References: src/…/update.rs• L1-220 src/…/update.rs• L20-96 src/…/update.rs• L98-193
Clipboard and field actions
The application treats copied text as a user action with its own result message. A selected row can copy a name or a chosen displayed field. A document or filtered log view can copy its visible content. The session reports success or failure after it selects an available host clipboard tool or terminal clipboard protocol.
References: src/…/actions.rs• L473-596 src/…/pickers.rs• L373-497 src/…/clipboard.rs• L7-25 src/…/clipboard.rs• L28-153
Navigation model
Navigation has two related forms: a breadcrumb stack for drilling into related resources and browser-like history for root views. Both preserve enough scope and selection state to make movement reversible.
Breadcrumb navigation
The application saves the current view before a drill-down. The new view carries the selector, owner relationship, or namespace that connects it to the selected object. Esc restores the saved frame and restarts its watch.
Built-in relationships cover common workload, namespace, pod, RBAC, Helm, and custom-resource paths. Configured drill rules extend the same model to user-defined resource relationships. A synthetic view such as Helm history still uses the same return behavior even when its displayed resource is derived from another Kubernetes kind. Workload drill-down carries the selected workload's label scope into the pod view and returns to the aggregate view with its filter intact.
References: src/…/lifecycle.rs• L314-403 src/…/navigation.rs• L18-128 src/…/navigation.rs• L153-234 src/…/actions.rs• L438-471 src/…/rbac.rs• L307-373 src/…/workloads.rs• L223-244 src/…/rollout.rs• L148-192
Root view history
Root changes such as switching resource kind, namespace, or layout are recorded separately from drill-down frames. Back and forward history reopens those saved views without creating new history entries. A new root change removes the forward branch.
References: src/…/lifecycle.rs• L255-357 src/…/layouts.rs• L50-86 src/…/input.rs• L412-426 src/…/input.rs• L508-528
Context changes
A context change replaces the cluster connection and re-resolves settings for the new cluster. The application clears old rows, cached views, permissions, discovery data, and view history before it starts the destination view, while deferred queries, bookmarks, workspaces, or remote targets wait for the new connection to land.
Authentication input can pause this transition. After the plugin succeeds, the application retries the original context switch or deferred navigation rather than treating authentication as a separate destination.
References: src/…/pickers.rs• L874-939 src/…/mod.rs• L946-1119 src/…/lifecycle.rs• L591-599 src/…/exec_auth.rs• L126-195
Related pages
The event-driven details of lifecycle handling, keyboard and mouse actions, overlays, and workspace transitions are documented in Application event loop and navigation. Terminal setup, drawing, key mapping, and input behavior are documented in Terminal rendering and input.
References: src/main.rs• L1047-1164 src/…/input.rs• L19-124 src/ui.rs• L91-120
Change checklist
When these files or sections are changed, remember to consider these:
- Keep every asynchronous result tied to both its view generation and its feature request. A feature can finish after its mode has closed even when the cluster watch is still current.
- Keep miss-triggered API discovery tied to the active context, request, and original lookup. A late discovery result must not retry a command in a new view or replace a newer catalog.
- Keep namespace-pattern discovery, per-namespace watches, merged row keys, and incomplete status aligned. A change in one member must not remove an equal-named object from another member.
- Keep aggregate workload rows keyed by kind, namespace, and name. Selection, marks, drill-down labels, and actions must not cross kinds that share a name.
- Keep view frames, history entries, layout names, and watch keys aligned with selectors, owner scope, synthetic views, and namespace membership. A restored frame must reopen the same logical data set and table shape.
- Keep watch failure classes aligned with credential renewal. A credentials refusal can start renewal, but a permission denial or transport outage must not be reported as an authentication failure.
- Keep credential renewal attempts tied to the active context and client. A result from an old context or a repeated certificate must not restart a healthy watch.
- Keep log stream identity, structured-record state, restart lookback, wake handling, pod membership, and horizontal viewport state aligned. A mode or wrap change must not leave the visible log position unrelated to the rendered rows.
- Keep manifest preview snapshots, rendered object identities, guardrails, and final apply or delete input aligned. An edited file or changed selection must not bypass the reviewed plan.
- Keep notification task IDs, notes, pending messages, and context epochs aligned. A notification from an old cluster must not appear after a context switch.
- Keep action menus aligned with read-only checks, guardrails, ownership warnings, confirmation text, and the actual cluster operation. A new shortcut must not create an unguarded mutation path.
- Keep Flux and Argo CD action availability tied to the resource API group and kind. A same-named custom resource must not receive a controller-specific patch.
- Keep rollout preview requests tied to the latest selected revision. A late preview must not replace an active confirmation for another revision.
- Keep suspended commands, background child processes, port forwards, PVC helpers, and mode return values on one cleanup path. Leaving one resource alive can affect later sessions.
- Keep RBAC report wording separate from
can-iresults. Stored bindings and live access reviews answer different questions. - Keep row visibility, server-side selector state, local filter parsing, displayed headers, derived cells, and sort keys aligned. A filter or layout change must not leave selection or order based on an older row projection.
- Keep sleep recovery, overlay return state, and context-switch ownership aligned. A wake must not cancel a context change or restart a watch under a picker or document.
- Keep picker, bookmark, fleet, and workspace results tied to the context and session state that requested them. Saved navigation must not cross context boundaries.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A task returns after the user changes view or closes its feature mode | Old data can overwrite the current screen | Generation and feature request checks reject stale messages. |
| A lookup misses a resource that was installed during the session | A valid kind can appear unavailable until restart | Throttled discovery refreshes the catalog and retries only the original active lookup. |
| One watch in a namespace pattern fails | The merged table can look complete when one namespace is missing | Per-namespace errors remain visible until each failed watch recovers. |
| A watch relists after a connection failure | Rows can be partial or stale during recovery | Reset, sync, recovery, and error status are tracked separately. |
| A forbidden supporting watch is retried as fast as a live watch | The API can be hammered and the fallback can hide its degraded state | The node count path stops retrying the refused watch and uses paced lists. |
| An exec-plugin certificate expires or the server refuses its credentials | The watch can fail with no clear path to restore cluster access | Renewal is rate-limited, expired results are rejected, and a usable replacement restarts the watch. |
| A credential renewal result belongs to a replaced context or returns the same certificate | A stale or useless client can replace the active client or restart a healthy watch | Attempt identity, context changes, certificate identity, and watch recovery gate installation. |
| A followed pod log stream sees a restart, replacement, deletion, or selector change | Logs can repeat old lines or continue from the wrong pod | Pod identity, restart lookback, membership checks, and explicit end notices control each stream. |
| A long unwrapped log line exceeds the pane width | The user can lose the end of the line or move to an invalid position | The log view records the useful horizontal range and clamps horizontal movement to the rendered rows. |
| Structured log data is malformed or exceeds the record view budget | The view can lose its structured form or crowd out other records | The log view keeps the raw line and bounds structured conversion and cache use. |
| RBAC bindings or role rules cannot be read | A policy report can look like a complete grant list | The report marks missing reads as incomplete and keeps warnings with the result. |
| A manifest changes after its preview or its resource is not discovered | The action can apply different input or skip a guardrail check | The application uses one in-memory snapshot and requires discovered identities before confirmation. |
| A notification arrives after a context switch | The new cluster can show a state change from the old cluster | Notification tasks and queued messages are invalidated by the context epoch. |
| A mutating action targets a controller-managed object or a read-only session | The action can be recreated, refused, or violate the session policy | Ownership warnings and shared read-only and guardrail checks run before execution. |
| A Flux-like or Argo CD resource has the wrong API group | A patch can change an unrelated custom resource or fail with a misleading message | Controller menus and patches require the expected group and kind. |
| A rollout preview finishes after another revision is selected or confirmed | The wrong diff can open or replace the confirmation | Preview request numbers accept only the latest revision. |
| A filter selector changes without restarting the watch | The table can show a local result that the cluster watch did not narrow | Pending selector state stays visible until the selector is applied to the watch. |
| A row changes but its derived cells or sort key remain cached | The table can show old status, metrics, or order | Row changes invalidate the affected derived data and rebuild the display projection when needed. |
| A PVC has no mount, is unbound, or is a block volume | Browsing can hang or create a pod that cannot serve a filesystem | The workflow validates the claim and asks before creating a temporary helper. |
| A foreground command or plugin outlives its visible mode | The terminal or a helper process can remain in the wrong state | Suspension, return-state handling, cancellation, and cleanup share the application lifecycle. |
| A port-forward uses a busy local port or belongs to another cluster | The forward fails or a row can show a false active marker | Local ports are checked and running forwards retain context, server, namespace, kind, and target identity. |
| A fleet context is slow or unreachable | One context can delay or hide the health summary for all contexts | Fleet gathers use bounded concurrency, per-context timeouts, and an error row. |
| A saved layout no longer exists for the active cluster | A view can show the wrong columns or sort by an invalid field | Layouts are checked against discovered kinds and fall back to the default with a warning. |
| The machine wakes while an overlay or context switch is active | A watch restart can interrupt the workflow or discard the destination | Sleep recovery waits for the table, and context-switch results keep ownership of their generation. |
| A saved namespace pattern cannot be resolved | The application can show data from an unrelated default namespace | The unresolved pattern remains selected with no rows until discovery succeeds. |
Key files
| File | Why to read it |
|---|---|
| src/main.rs | Defines startup, terminal ownership, the event loop, message intake, redraw timing, and suspended command handling. |
| src/…/mod.rs | Defines the central session state, view modes, log-session state, workflow state, discovery retry state, notifications, and shared application boundaries. |
| src/…/lifecycle.rs | Shows how views start watches, manage generations, handle watch health, and preserve recent snapshots. |
| src/…/credentials.rs | Shows how expiring or refused cluster credentials recover without hiding the cause of a watch failure. |
| src/…/rediscovery.rs | Shows how a missed resource lookup can refresh API discovery and retry without crossing session boundaries. |
| src/…/namespace_patterns.rs | Shows how one namespace expression becomes several coordinated watches and how unresolved patterns recover. |
| src/…/pickers.rs | Shows how namespace and context choices connect user interaction to cluster changes and session state. |
| src/…/layouts.rs | Shows how named layouts change the current table shape while keeping resource identity and sort state aligned. |
| src/…/resume.rs | Shows how the application detects machine sleep and safely restarts the active watch. |
| src/…/navigation.rs | Shows how drill-down relationships, selectors, owner scope, and reversible movement are coordinated. |
| src/…/input.rs | Shows how actions dispatch into tables, overlays, documents, dashboards, and feature workflows. |
| src/…/actions.rs | Shows the common path from a selected resource to a guarded cluster mutation or interactive command. |
| src/…/dir.rs | Shows how local manifests become reviewed snapshots and guarded apply or delete operations. |
| src/…/notify.rs | Shows how persistent object watches become bounded status and terminal notifications. |
| src/…/log_follow.rs and src/…/logs.rs | Show how log sources start, follow pod membership, render structured records, recover after restarts or wake, and end with a visible result. |
| src/…/workloads.rs | Shows how common workload kinds share an aggregate view while retaining per-row kind and ownership. |
| src/…/rollout.rs | Shows how workload revisions become a history view, preview, and guarded rollback. |
| src/…/rbac.rs and src/…/authz.rs | Show the difference between stored RBAC explanation and live access review. |
| src/…/adjacent.rs | Shows how the application gathers direct object relationships into a returnable view. |
| src/…/pvcexplore.rs | Shows the lifecycle of PVC target resolution, helper pods, browsing, shell access, and cleanup. |
| src/…/plugins.rs | Shows how configured workflows validate inputs, select targets, bound execution, and return different output forms. |
| src/…/bookmarks.rs | Shows how saved navigation restores context, resource, scope, layout, filters, and related dashboards. |
| src/…/fleet.rs | Shows how selected contexts become a bounded cross-cluster health summary and how degraded rows drill into a context. |
| src/…/dashboards.rs | Shows how cluster-wide summaries and relationship trees run beside the normal resource table. |
| src/…/update.rs | Shows how cached startup checks and explicit release checks report a newer version without replacing user status. |
| src/…/rows.rs | Shows how store objects become filtered and sorted table rows, with derived cells, metrics, layouts, and stable table selection. |
| src/store.rs | Defines the message and resource-data boundary between asynchronous work and application state. |
| src/…/tests.rs, src/…/exec_auth.rs, src/…/flux.rs, src/…/kubeconfig.rs, src/…/log_follow.rs, src/…/rollout.rs, src/…/update.rs, and src/…/workloads.rs | Capture the session contracts for discovery, authentication, watch fallback, log continuity, controller actions, rollout safety, release checks, and aggregate workload navigation. |
| src/ui.rs | Defines the rendering boundary that turns application state into terminal frames. |