# `MingaEditor.TabWorkflow`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/tab_workflow.ex#L1)

External and presentation workflow around pure root tab transitions.

Registry validation, remote event replay, agent session snapshots, transcript
reads, spinner timers, and modal presentation stay here. `MingaEditor.State`
installs only the atomic immutable tab transition.

# `restore_context`

```elixir
@spec restore_context(
  MingaEditor.State.t(),
  MingaEditor.State.Tab.context() | MingaEditor.State.Tab.legacy_context()
) :: MingaEditor.State.t()
```

Restores a context and synchronizes its workspace-backed agent presentation.

# `switch`

```elixir
@spec switch(MingaEditor.State.t(), MingaEditor.State.Tab.id()) ::
  MingaEditor.State.t()
```

Switches tabs and performs the external work requested by the pure transition result.

# `sync_active_workspace_agent_ui`

```elixir
@spec sync_active_workspace_agent_ui(MingaEditor.State.t()) :: MingaEditor.State.t()
```

Synchronizes the live agent projection and replays pending foreground catch-up events.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
