BadgeRenderer
Compact status pill: `[label]` colored by the node's semantic role. The TUI analog of a badge/tag chip in a web UI. Single-line by design; the label is truncated to fit the node width minus the brackets so the closing `]` is never dropped. Color is NOT applied here — the final `TuiAnsiPainter` pass picks up the `role` from props and styles it via the `TerminalThemeInterface`. This keeps the renderer pure text so it composes cleanly with the diff buffer. Node props (all optional): - `label` string Text inside the badge. Default: ''. - `role` string Semantic role for the theme pass: 'success' | 'warning' | 'error' | 'info' | 'neutral'. Default: 'neutral'. - `fill` string Bracket character set: 'square' (`[ ]`), 'round' (`( )`), 'angle' (`< >`). Default: 'square'.
BadgeRenderer::supports()
public function supports(Milpa\Live\ValueObjects\Tui\TuiNode $node): boolTrue only for `badge` nodes — dispatch is by declared node type, never by where the node came from.
Parameters
| Name | Type | Description |
|---|---|---|
| $node | Milpa\Live\ValueObjects\Tui\TuiNode |
BadgeRenderer::render()
public function render(Milpa\Live\ValueObjects\Tui\TuiNode $node, Milpa\Live\ValueObjects\Tui\TuiRenderContext $context): Milpa\Live\ValueObjects\Tui\TuiFrameDraws the pill on one line, colouring it by the node's semantic role.
Parameters
| Name | Type | Description |
|---|---|---|
| $node | Milpa\Live\ValueObjects\Tui\TuiNode | |
| $context | Milpa\Live\ValueObjects\Tui\TuiRenderContext |