MingaEditor.UI.Picker.Context (Minga v0.1.0)

Copy Markdown View Source

Picker context struct — what picker sources need from MingaEditor.State.

This struct decouples picker sources from the full MingaEditor.State, allowing sources to depend only on the subset of state they actually use. This makes sources easier to test, easier to reason about, and prevents the cyclic dependency between UI.Picker and MingaEditor.State.

Fields

  • buffers — buffer list and active buffer (MingaEditor.State.Buffers.t())
  • editing — vim state (marks, registers, jump positions, mode)
  • file_tree — file tree state (if available)
  • search — search state (buffer search, project search results)
  • viewport — viewport dimensions
  • tab_bar — tab bar state (tabs, active tab, agent groups)
  • agent_session — agent session PID (if available)
  • picker_ui — picker UI state (context map for sources)
  • capabilities — frontend capabilities (GUI detection, etc.)
  • theme — active theme

Summary

Functions

Builds a picker context from the full editor state.

Types

t()

@type t() :: %MingaEditor.UI.Picker.Context{
  agent_session: pid() | nil,
  buffers: MingaEditor.State.Buffers.t(),
  capabilities: map(),
  editing: MingaEditor.VimState.t(),
  file_tree: MingaEditor.State.FileTree.t() | nil,
  picker_ui: map(),
  search: MingaEditor.State.Search.t(),
  tab_bar: MingaEditor.State.TabBar.t(),
  theme: MingaEditor.UI.Theme.t(),
  viewport: MingaEditor.Viewport.t()
}

Functions

from_editor_state(state)

@spec from_editor_state(MingaEditor.State.t()) :: t()

Builds a picker context from the full editor state.