Skip to main content

Module tui

Module tui 

Source
Expand description

Interactive orbital dashboard (limit orbit) rendering.

render_dashboard draws the full environment pre-flight as a single Unicode box: a version banner, one status line per diagnostic, a live health bar, a status badge, a beginner-friendly mentor note and a numbered list of auto-fixes.

The full width is capped at DASHBOARD_WIDTH so the dashboard fits an 80-column terminal.

use limitless_cli::models::{EnvironmentState, HealthScore};
use limitless_cli::modules::tui::{render_dashboard, render_dashboard_plain,
                                  DASHBOARD_WIDTH};

let state = EnvironmentState::default();
let dashboard = render_dashboard(&state);
assert!(dashboard.contains(concat!("LIMITLESS v", env!("CARGO_PKG_VERSION"))));

let plain = render_dashboard_plain(&state);
for line in plain.lines() {
    assert!(line.chars().count() <= DASHBOARD_WIDTH);
}

Constants§

DASHBOARD_WIDTH
Total width of the dashboard frame. Kept ≤ 80 so it fits any terminal.
HEALTH_BAR_CELLS
Number of cells in the health bar.
VERSION_BANNER
Version banner printed on the first row. The title banner shown at the top of every dashboard.

Functions§

render_dashboard
Renders the full diagnostic dashboard for limit orbit.
render_dashboard_plain
Same layout as render_dashboard but with all ANSI sequences stripped.
run_orbit
Runs limit orbit: builds a fresh snapshot and renders the dashboard.