MingaEditor.Extension.Sidebar.Entry (Minga v0.1.0)

Copy Markdown View Source

Source-owned sidebar registration metadata.

The sidebar registry stores this struct in ETS so layout, input, TUI rendering, and GUI emit share one typed shape instead of passing bare maps across module boundaries.

Summary

Types

Action handler invoked through the editor action pipeline.

Sidebar placement.

Contribution source that owns a sidebar.

t()

Functions

Updates the cached snapshot.

Updates visibility.

Types

action_handler()

@type action_handler() ::
  (MingaEditor.State.t(), String.t(), map() -> MingaEditor.State.t())
  | {module(), atom()}
  | {module(), atom(), [term()]}
  | nil

Action handler invoked through the editor action pipeline.

placement()

@type placement() :: :left

Sidebar placement.

source()

Contribution source that owns a sidebar.

t()

@type t() :: %MingaEditor.Extension.Sidebar.Entry{
  action_handler: action_handler(),
  badge_count: non_neg_integer() | nil,
  description: String.t(),
  display_name: String.t(),
  focused?: boolean(),
  icon: String.t(),
  id: String.t(),
  input_handler: module() | nil,
  placement: placement(),
  preferred_width: pos_integer(),
  priority: integer(),
  semantic_kind: String.t(),
  snapshot: MingaEditor.Extension.Sidebar.Snapshot.t(),
  source: source(),
  visible?: boolean()
}

Functions

publish_snapshot(entry, snapshot)

@spec publish_snapshot(t(), MingaEditor.Extension.Sidebar.Snapshot.t()) :: t()

Updates the cached snapshot.

set_focused(entry, focused?)

@spec set_focused(t(), boolean()) :: t()

Updates focus.

set_visible(entry, visible?)

@spec set_visible(t(), boolean()) :: t()

Updates visibility.