-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Currently, same performs environment hydration (Nix resolutions and builds) in the background or within a generic "Hydrating Environments" span. This obscures critical information like download progress, build logs, and resolution details.
We want to promote the hydration phase to a first-class view in the TUI. Before the main build plan is shown, users should see a list of unique environments being prepared. This view should be interactive, allowing users to "drill down" into specific environments to view real-time, colored logs (preserving Nix progress bars via PTY).
Goals
- Visibility: Explicitly show the unique environments required for the run (e.g.,
go@1.25.4, lint@2.7.2) before task execution starts. - Rich Feedback: Stream
nix print-dev-envoutput using a Pseudo-Terminal (PTY) to preserve ANSI colors and download progress bars. - Consistency: Ensure the interaction model (navigation, drill-down, log inspection) mirrors the existing Task Graph view.
Acceptance Criteria
-
Scheduler & Flow
-
Scheduler.Runis refactored to calculate uniqueEnvIDs and callEmitHydrationbeforeEmitPlan. -
The execution flow strictly follows: Emit Hydration Plan Hydrate (Parallel) Emit Build Plan Execute Tasks.
-
Telemetry
-
Tracerinterface updated withEmitHydration. -
New
MsgInitHydrationmessage implemented to carry environment metadata to the TUI. -
TUI Adapter
-
New
ViewModeHydrationimplemented. -
Renders a flat, selectable list of environments using
TaskNodestyles (Status Icon, Name, Duration). -
Interaction: Users can navigate with
j/kand pressEnterto view full-screen logs (utilizingVterm). -
Transition: TUI automatically switches to the Task Graph view (
ViewModeTree) when hydration completes. -
Nix Adapter (PTY Support)
-
EnvFactoryusescreack/ptyto execute the "visual"nix print-dev-envcommand, streamingptmxoutput directly to the Span. -
A secondary execution captures the JSON data reliably for environment parsing.