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

Copy Markdown View Source

Cached semantic sidebar content published by an extension.

Extensions update snapshots when their own state changes. Layout, TUI rendering, and GUI emit code read these values directly from the sidebar registry, so frame rendering never calls arbitrary extension callbacks.

Summary

Types

Semantic row rendered by generic sidebar surfaces.

Sidebar loading/error state.

t()

Cached snapshot state.

Functions

Builds a snapshot and derives fingerprints when they are not provided.

Returns true when two snapshots differ only by selection/focus state.

Types

row()

@type row() :: %{
  optional(:id) => String.t(),
  optional(:text) => String.t(),
  optional(:icon) => String.t() | nil,
  optional(:indent) => non_neg_integer(),
  optional(:selected?) => boolean(),
  optional(:active?) => boolean(),
  optional(:badge) => String.t() | nil,
  optional(:git_status) => atom() | String.t() | nil,
  optional(:diagnostic_count) => non_neg_integer()
}

Semantic row rendered by generic sidebar surfaces.

status()

@type status() :: :ready | :loading | :error | :empty

Sidebar loading/error state.

t()

@type t() :: %MingaEditor.Extension.Sidebar.Snapshot{
  active_id: String.t() | nil,
  message: String.t() | nil,
  rows: [row()],
  selected_id: String.t() | nil,
  selection_fingerprint: non_neg_integer(),
  status: status(),
  structural_fingerprint: non_neg_integer()
}

Cached snapshot state.

Functions

new(attrs \\ [])

@spec new(keyword() | map()) :: t()

Builds a snapshot and derives fingerprints when they are not provided.

selection_only_change?(old, new)

@spec selection_only_change?(t(), t()) :: boolean()

Returns true when two snapshots differ only by selection/focus state.