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.
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.
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.
Marks an orphaned remote tab projection as disconnected.
Clears lifecycle fields for an orphaned agent tab after its session exits.
Creates a new agent tab.
Creates a new file tab.
Projects workspace-owned lifecycle and remote metadata onto this tab for display.
Refreshes any background-subagent 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 and logical file projection.
Sets the attention flag (agent needs user input).
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.
Toggles whether this tab is pinned in the tab strip.
Types
@type agent_status() :: MingaEditor.State.Workspace.agent_status()
Agent tab status.
@type connection_status() :: MingaEditor.State.Workspace.RemoteSession.connection_status() | 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.
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.
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.
Marks an orphaned remote tab projection as disconnected.
@spec mark_orphan_session_down(agent(), agent_status()) :: agent()
Clears lifecycle fields for an orphaned agent tab after its session exits.
Creates a new agent tab.
Creates a new file tab.
@spec project_agent_lifecycle(agent(), MingaEditor.State.Workspace.agent()) :: agent()
Projects workspace-owned lifecycle and remote metadata onto this tab for display.
Refreshes any background-subagent 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 and logical file projection.
Sets the attention flag (agent needs user input).
@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.
Toggles whether this tab is pinned in the tab strip.