MingaEditor.BottomPanel (Minga v0.1.0)

Copy Markdown View Source

State for the bottom panel container.

The bottom panel is a resizable Messages container below the editor surface (above the status bar) in GUI frontends. The BEAM sends declarative state each frame; frontends render it with their native toolkit.

Visibility state machine

The panel opens only through explicit user actions. Logging a warning or error never changes its visibility or focus.

  • visible tracks whether the panel is shown.
  • filter records an optional user-selected preset, including :warnings for the View Warnings command.

Summary

Functions

Clears panel focus without changing visibility.

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.

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

Show the Messages panel with an optional filter preset.

Toggle panel visibility. Clears filters on explicit open.

Types

filter_preset()

@type filter_preset() :: :warnings | nil

t()

@type t() :: %MingaEditor.BottomPanel{
  filter: filter_preset(),
  focused: boolean(),
  height_percent: non_neg_integer(),
  visible: boolean()
}

Functions

blur(panel)

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

Clears panel focus without changing visibility.

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.

resize(panel, height_percent)

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

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

show(panel, filter \\ nil)

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

Show the Messages panel with an optional filter preset.

toggle(panel)

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

Toggle panel visibility. Clears filters on explicit open.