Files
moonetui-demo/README.md
T
2026-11-21 12:21:03 +00:00

48 lines
1.8 KiB
Markdown

# moonetui-demo: Mission Control
A full-screen terminal dashboard built with [`moonbitstack/moonetui`](https://mooncakes.io/docs/#/moonbitstack/moonetui/) 0.4.3.
A simulated spacecraft: eight subsystems with live load/temperature, a sortable table,
a detail pane, a line chart of load history, a fleet sparkline, gauges, a command palette
and a dark/light theme switch. Animation comes from a 125 ms `App::every` timer in the frame loop.
![Mission Control animation](media/demo.gif)
| Start (dark) | Sorted by load |
|---|---|
| ![start](media/01-start.png) | ![sorted](media/02-sorted.png) |
| Light theme | Command palette |
|---|---|
| ![light](media/03-light.png) | ![palette](media/04-palette.png) |
Back in dark: `media/05-dark.png`. `media/demo.cast` is an asciicast v2 file
(`asciinema play media/demo.cast`) assembled from the same five frames.
Images are renders of the real native binary's output (run in a 120x36 pty,
read through the `pyte` terminal emulator), not literal terminal screenshots.
## Run
```
moon run --target native main # needs a real terminal, at least ~100x30
moon build --target native # binary: _build/native/debug/build/main/main.exe
moon test --target native # headless tests (scripted key bytes, assertions on ui.screen())
```
## Keys
| Key | Action |
|---|---|
| `↑` `↓` | select a subsystem (chart + detail follow) |
| `s` | cycle sort: name, load, temp |
| `t` | toggle dark / light theme |
| `space` | pause / resume telemetry |
| `r` | reset the simulation |
| `ctrl+p` | command palette (type to filter, Enter runs, Esc closes) |
| `q` / `ctrl+c` | quit |
## Layout
- `lib/demo.mbt`: model, simulation, widget tree, key handling (generic over the driver)
- `lib/demo_test.mbt`: headless tests using `@driver.Headless`
- `main/main.mbt`: native entry point using `@native.NativeTty`