A single tab in the tab bar.
Each tab has a unique id, a kind (:file or :agent), a display label,
and a typed context that stores snapshotted per-tab state when the tab is
inactive. The active tab's context is "live" on EditorState; inactive
tabs carry a frozen snapshot that gets restored when you switch to them.
Context format
The canonical context is MingaEditor.State.Tab.Context, a struct with explicit workspace fields. Restore still accepts legacy maps for migration, including empty maps for brand-new tabs.
Summary
Types
Agent tab status (nil for file tabs).
Remote connection status for a tab backed by a remote session.
Snapshotted per-tab state.
Workspace id. 0 = manual workspace.
Unique tab identifier.
Tab kind.
Legacy context map accepted at migration boundaries.
A tab.
Functions
Returns true if this is an agent tab.
Returns true when this tab projects a background sub-agent.
Clears agent lifecycle projection data from this tab.
Clears projected remote metadata from this tab.
Returns the display label including any remote server prefix.
Drops all snapshotted extension-owned feature state.
Drops all snapshotted feature state owned by a source.
Returns true if this is a file tab.
Marks this tab as the UI projection of a background sub-agent.
Creates a new agent tab.
Creates a new file tab.
Refreshes any session pid references after a managed restart.
Returns true when this tab is backed by a remote session.
Removes a dead buffer pid from this tab's context snapshot.
Sets the agent status on a tab (for tab bar rendering).
Sets the attention flag (agent needs user input).
Updates remote connection status for the tab.
Stores a context snapshot into the tab.
Sets the logical file identity for a file tab.
Sets the workspace group id.
Updates the tab's label.
Sets whether this tab is pinned in the tab strip.
Projects workspace-owned remote metadata onto this tab for display.
Marks the tab as backed by a remote agent session.
Sets the session pid for an agent tab.
Toggles whether this tab is pinned in the tab strip.
Types
@type agent_status() :: :idle | :plan | :thinking | :tool_executing | :error | nil
Agent tab status (nil for file tabs).
@type connection_status() :: :connected | :disconnected | :ended | :unavailable | nil
Remote connection status for a tab backed by a remote session.
@type context() :: MingaEditor.State.Tab.Context.t()
Snapshotted per-tab state.
Stores per-tab workspace fields in an explicit struct. Empty context means a brand-new tab.
@type group_id() :: non_neg_integer()
Workspace id. 0 = manual workspace.
@type id() :: pos_integer()
Unique tab identifier.
@type kind() :: :file | :agent
Tab kind.
@type legacy_context() :: MingaEditor.State.Tab.Context.legacy()
Legacy context map accepted at migration boundaries.
@type t() :: %MingaEditor.State.Tab{ agent_status: agent_status(), attention: boolean(), background_subagent: MingaAgent.Subagent.Handle.t() | nil, connection_status: connection_status(), context: context(), file_ref: Minga.Project.FileRef.t() | nil, group_id: group_id(), id: id(), kind: kind(), label: String.t(), pinned?: boolean(), remote_session_id: String.t() | nil, server_name: String.t() | nil, session: pid() | nil }
A tab.
Functions
Returns true if this is an agent tab.
Returns true when this tab projects a background sub-agent.
Clears agent lifecycle projection data from this tab.
Clears projected remote metadata from this tab.
Returns the display label including any remote server prefix.
Drops all snapshotted extension-owned feature state.
@spec drop_feature_state_source(t(), MingaEditor.FeatureState.source()) :: t()
Drops all snapshotted feature state owned by a source.
Returns true if this is a file tab.
@spec mark_background_subagent(t(), MingaAgent.Subagent.Handle.t()) :: t()
Marks this tab as the UI projection of a background sub-agent.
Creates a new agent tab.
Creates a new file tab.
Refreshes any session pid references after a managed restart.
Returns true when this tab is backed by a remote session.
Removes a dead buffer pid from this tab's context snapshot.
@spec set_agent_status(t(), agent_status()) :: t()
Sets the agent status on a tab (for tab bar rendering).
Sets the attention flag (agent needs user input).
@spec set_connection_status(t(), connection_status()) :: t()
Updates remote connection status for the tab.
@spec set_context(t(), context() | legacy_context()) :: t()
Stores a context snapshot into the tab.
@spec set_file_ref(t(), Minga.Project.FileRef.t() | nil) :: t()
Sets the logical file identity for a file tab.
Sets the workspace group id.
Updates the tab's label.
Sets whether this tab is pinned in the tab strip.
@spec set_remote_projection(t(), MingaEditor.State.Workspace.RemoteSession.t()) :: t()
Projects workspace-owned remote metadata onto this tab for display.
Marks the tab as backed by a remote agent session.
Sets the session pid for an agent tab.
Toggles whether this tab is pinned in the tab strip.