MingaEditor.Session.ChromeState (Minga v0.1.0)

Copy Markdown View Source

Shared workspace chrome projection for GUI and TUI renderers.

This module derives workspace-facing chrome state from the current editor state. It is a presentation projection, not storage. Frontends should consume this projection instead of inferring workspace membership from tab order, labels, paths, or agent status side effects.

Summary

Functions

Builds the workspace chrome projection from current editor state.

Returns the manual workspace id.

Returns the visible tabs for the active workspace.

Types

mode()

@type mode() :: :editor | :agent | :file_tree | :other

t()

@type t() :: %MingaEditor.Session.ChromeState{
  active_tab_id: MingaEditor.State.Tab.id() | nil,
  active_workspace_id: non_neg_integer(),
  attention_count: non_neg_integer(),
  background_count: non_neg_integer(),
  conflict_count: non_neg_integer(),
  draft_count: non_neg_integer(),
  mode: mode(),
  visible_tabs: [MingaEditor.Session.ChromeState.TabSummary.t()],
  workspaces: [MingaEditor.Session.ChromeState.WorkspaceSummary.t()]
}

Functions

from_editor_state(state)

@spec from_editor_state(map()) :: t()

Builds the workspace chrome projection from current editor state.

manual_workspace_id()

@spec manual_workspace_id() :: non_neg_integer()

Returns the manual workspace id.

visible_tabs(chrome_state)

@spec visible_tabs(t()) :: [MingaEditor.Session.ChromeState.TabSummary.t()]

Returns the visible tabs for the active workspace.