MingaEditor.BottomPanel (Minga v0.1.0)

Copy Markdown View Source

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)

Summary

Functions

Clears panel focus without changing visibility.

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

Filter preset byte for protocol encoding.

Focuses the visible panel. Hidden panels stay unfocused.

Returns true when the panel is visible and focused.

Hide the panel.

Cycle to the next tab.

Cycle to the previous tab.

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

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

Switch to a tab by index.

Tab display name for protocol encoding.

Tab type byte for protocol encoding.

Toggle panel visibility. Clears dismissed state on explicit open.

Types

filter_preset()

@type filter_preset() :: :warnings | nil

t()

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

tab()

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

Functions

blur(panel)

@spec blur(t()) :: t()

Clears panel focus without changing visibility.

dismiss(panel)

@spec dismiss(t()) :: t()

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

filter_byte(atom)

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

Filter preset byte for protocol encoding.

focus(panel)

@spec focus(t()) :: t()

Focuses the visible panel. Hidden panels stay unfocused.

focused?(bottom_panel)

@spec focused?(t()) :: boolean()

Returns true when the panel is visible and focused.

hide(panel)

@spec hide(t()) :: t()

Hide the panel.

next_tab(panel)

@spec next_tab(t()) :: t()

Cycle to the next tab.

prev_tab(panel)

@spec prev_tab(t()) :: t()

Cycle to the previous tab.

resize(panel, height_percent)

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

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

show(panel, tab \\ :messages, filter \\ nil)

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

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

switch_tab(panel, index)

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

Switch to a tab by index.

tab_name(atom)

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

Tab display name for protocol encoding.

tab_type_byte(atom)

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

Tab type byte for protocol encoding.

toggle(panel)

@spec toggle(t()) :: t()

Toggle panel visibility. Clears dismissed state on explicit open.