# Interface Layout

## Layout

The TUI divides the terminal into four regions separated by line-drawing characters.

```
┌─────────────────────────────────────────────────────────────────┐
│  STM32 SERIAL COMMANDER              /dev/ttyACM0  ·  115200 baud │
├──────────────────────────────┬──────────────────────────────────┤
│  COMMANDS                    │  MOTOR                           │
│                              │  erpm    2000  [e]               │
│  [1] speed                   │  accel   1000  [a]               │
│  [2] stop                    │  time ms 5000  [t]               │
│  [3] profile                 │                                  │
│                              │  PIO                             │
│  [b] pio build               │  target  upload      [p]         │
│                              │  env     can_board   [n]         │
│  [q] quit                    │                                  │
├──────────────────────────────┼──────────────────────────────────┤
│  TX                          │  INCOMING                        │
│  ▸ connected /dev/ttyACM0    │  [INFO] system ready             │
│  ▸ speed 2000                │  [INFO] CAN init ok              │
│  ▸ profile 2000 1000 5000    │  [WARNING] temp high             │
├──────────────────────────────┴──────────────────────────────────┤
│  1 speed   2 stop   3 profile   b pio build   e/a/t/p/n edit   q quit │
└─────────────────────────────────────────────────────────────────┘
```

## Regions

**Top-left — COMMANDS**<span style="white-space: pre-wrap;">: Available key bindings. </span>`<span class="editor-theme-code">[q]</span>`<span style="white-space: pre-wrap;"> is visually separated from the command group.</span>

**Top-right — MOTOR / PIO**: Editable parameters with current values. Each shows its edit key in brackets. Values highlight in yellow when active.

**Bottom-left — TX**<span style="white-space: pre-wrap;">: Scrolling log of sent commands, prefixed with </span>`<span class="editor-theme-code">▸</span>`. Most recent entries appear at the bottom.

**Bottom-right — INCOMING**: Scrolling serial output, colour-coded by severity:

<table id="bkmrk-prefixcolour%5Berror%5Dr"><colgroup><col></col><col></col></colgroup><tbody><tr><th>Prefix

</th><th>Colour

</th></tr><tr><td>`<span class="editor-theme-code">[ERROR]</span>`

</td><td>Red

</td></tr><tr><td>`<span class="editor-theme-code">[WARNING]</span>`

<span style="white-space: pre-wrap;"> / </span>

`<span class="editor-theme-code">[WARN]</span>`

</td><td>Yellow

</td></tr><tr><td>`<span class="editor-theme-code">[INFO]</span>`

</td><td>Cyan

</td></tr><tr><td>**(other)**

</td><td>White

</td></tr></tbody></table>

**Status bar**: Shows edit mode prompt when a field is being edited; otherwise shows the full key reference.

## Terminal Requirements

<span style="white-space: pre-wrap;">Minimum ~80×24 terminal. Colour support recommended — falls back to </span>`<span class="editor-theme-code">curses.COLOR_MAGENTA</span>`<span style="white-space: pre-wrap;"> if the terminal cannot redefine colours (the TUI uses a custom purple </span>`<span class="editor-theme-code">#5a2273</span>`).