Expand description
Terminal UI for build progress visualization
This module provides a Ratatui-based TUI for displaying build progress, as well as a plain logger for CI/non-interactive environments.
§Architecture
The TUI is event-driven and communicates with the build process via channels:
┌─────────────────┐ mpsc::Sender<BuildEvent> ┌─────────────────┐
│ Build Process │ ──────────────────────────────▶ │ BuildTui │
└─────────────────┘ └─────────────────┘§Example
use zlayer_builder::tui::{BuildTui, BuildEvent};
use std::sync::mpsc;
// Create channel for build events
let (tx, rx) = mpsc::channel();
// Spawn build process that sends events
std::thread::spawn(move || {
tx.send(BuildEvent::StageStarted {
index: 0,
name: Some("builder".to_string()),
base_image: "node:20-alpine".to_string(),
}).unwrap();
// ... more events ...
});
// Run TUI (blocks until build completes or user quits)
let mut tui = BuildTui::new(rx);
tui.run()?;Structs§
- Build
State - Internal build state tracking
- Build
Tui - Main TUI application for build progress visualization
- Build
View - Main build progress view widget
- Instruction
State - State of a single instruction
- Output
Line - A single line of build output, tagged as stdout or stderr.
- Plain
Logger - Simple logging output for CI/non-interactive mode
- Stage
State - State of a single build stage
Enums§
- Build
Event - Build event for TUI updates
- Instruction
Status - Status of an instruction during build