# `MingaEditor.Agent.UIState.ReturnTarget`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/agent/ui_state/return_target.ex#L1)

Editor context to restore when leaving the agent view.

The agent view is a zoom surface inside a workspace. This struct records the editor context that was active before zooming in so `q` and `Esc` can return to the same workspace instead of guessing from tab order alone.

# `t`

```elixir
@type t() :: %MingaEditor.Agent.UIState.ReturnTarget{
  active_buffer: pid() | nil,
  active_tab_id: pos_integer() | nil,
  file_tree: MingaEditor.State.FileTree.t(),
  keymap_scope: Minga.Keymap.Scope.scope_name(),
  prompt_focused: boolean(),
  windows: MingaEditor.State.Windows.t()
}
```

# `new`

```elixir
@spec new(
  pos_integer() | nil,
  pid() | nil,
  MingaEditor.State.Windows.t(),
  MingaEditor.State.FileTree.t(),
  Minga.Keymap.Scope.scope_name(),
  boolean()
) :: t()
```

Builds a return target from the current editor context.

---

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