# `MingaEditor.BottomPanel`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/bottom_panel.ex#L1)

State for the bottom panel container.

The bottom panel is a resizable, tabbed container below the editor surface
(above the status bar) in GUI frontends. It hosts Messages, Diagnostics,
Terminal, and future panel tabs. The BEAM sends declarative state each
frame; frontends render it with their native toolkit.

## Tab types

- `:messages` - editor log messages (always present)
- `:diagnostics` - LSP diagnostics (future)
- `:terminal` - integrated terminal (future)

## Visibility state machine

The panel has three independent visibility controls:

- `visible` - whether the panel is currently shown
- `dismissed` - set when user explicitly dismisses a warning auto-popup;
  prevents auto-open until the user explicitly opens the panel
- `filter` - optional filter preset (`:warnings` for auto-open on warning)

# `filter_preset`

```elixir
@type filter_preset() :: :warnings | nil
```

# `t`

```elixir
@type t() :: %MingaEditor.BottomPanel{
  active_tab: tab(),
  dismissed: boolean(),
  filter: filter_preset(),
  height_percent: non_neg_integer(),
  tabs: [tab()],
  visible: boolean()
}
```

# `tab`

```elixir
@type tab() :: :messages | :diagnostics | :terminal
```

# `dismiss`

```elixir
@spec dismiss(t()) :: t()
```

Dismiss the panel (prevents auto-open until explicit open).

# `filter_byte`

```elixir
@spec filter_byte(filter_preset()) :: non_neg_integer()
```

Filter preset byte for protocol encoding.

# `hide`

```elixir
@spec hide(t()) :: t()
```

Hide the panel.

# `next_tab`

```elixir
@spec next_tab(t()) :: t()
```

Cycle to the next tab.

# `prev_tab`

```elixir
@spec prev_tab(t()) :: t()
```

Cycle to the previous tab.

# `resize`

```elixir
@spec resize(t(), non_neg_integer()) :: t()
```

Update panel height (clamped to 10-60%).

# `show`

```elixir
@spec show(t(), tab(), filter_preset()) :: t()
```

Show the panel on a specific tab with an optional filter preset.

# `switch_tab`

```elixir
@spec switch_tab(t(), non_neg_integer()) :: t()
```

Switch to a tab by index.

# `tab_name`

```elixir
@spec tab_name(tab()) :: String.t()
```

Tab display name for protocol encoding.

# `tab_type_byte`

```elixir
@spec tab_type_byte(tab()) :: non_neg_integer()
```

Tab type byte for protocol encoding.

# `toggle`

```elixir
@spec toggle(t()) :: t()
```

Toggle panel visibility. Clears dismissed state on explicit open.

---

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