# `BB.TUI.Panels.CommandEdit`
[🔗](https://github.com/mcass19/bb_tui/blob/v0.3.0/lib/bb/tui/panels/command_edit.ex#L1)

Argument-edit popup for the commands panel.

Floats above the dashboard while the user edits the arguments of the
selected command. Each declared argument renders as a row showing
the current value (string buffer) and type hint; the focused row
gets a `›` prefix and a `▏` cursor. A hint footer describes the
edit-mode keys.

Pure function — takes state, returns a Popup widget struct.

# `render`

```elixir
@spec render(BB.TUI.State.t()) :: struct() | nil
```

Renders the edit popup for the selected command, or `nil` when the
selected command has no arguments. The caller should only invoke
this when `state.commands.edit_mode?` is true.

## Examples

    iex> cmd = %{name: :move, arguments: [%{name: :angle, type: "float", default: 0.0}]}
    iex> state = %BB.TUI.State{
    ...>   commands: %BB.TUI.State.Commands{
    ...>     available: [cmd],
    ...>     selected: 0,
    ...>     edit_mode?: true,
    ...>     focused_arg: 0
    ...>   }
    ...> }
    iex> %ExRatatui.Widgets.Popup{} = BB.TUI.Panels.CommandEdit.render(state)

    iex> state = %BB.TUI.State{commands: %BB.TUI.State.Commands{available: [], selected: 0}}
    iex> BB.TUI.Panels.CommandEdit.render(state)
    nil

---

*Consult [api-reference.md](api-reference.md) for complete listing*
