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

Pure lifecycle owner for activation of the full-screen agent presentation.

Activation records one coherent editor return target and saved layout.
Completion or cancellation deactivates the presentation and clears every
activation-local field together, preventing stale return targets or key
prefixes from leaking into a replacement activation.

# `focus`

```elixir
@type focus() :: :chat | :file_viewer
```

# `prefix`

```elixir
@type prefix() ::
  nil | :g | :z | :bracket_next | :bracket_prev | Minga.Keymap.Bindings.Node.t()
```

# `t`

```elixir
@type t() :: %MingaEditor.Agent.UIState.Presentation{
  active: boolean(),
  focus: focus(),
  pending_prefix: prefix(),
  return_target: MingaEditor.Agent.UIState.ReturnTarget.t() | nil,
  saved_file_tree: MingaEditor.State.FileTree.t() | nil,
  saved_windows: MingaEditor.State.Windows.t() | nil
}
```

# `activate`

```elixir
@spec activate(
  t(),
  MingaEditor.State.Windows.t() | nil,
  MingaEditor.State.FileTree.t() | nil,
  MingaEditor.Agent.UIState.ReturnTarget.t() | nil
) :: t()
```

Activates or replaces the presentation's complete return context.

# `active?`

```elixir
@spec active?(t()) :: boolean()
```

Returns whether the agent presentation is active.

# `cancel`

```elixir
@spec cancel(t()) ::
  {t(), MingaEditor.State.Windows.t() | nil,
   MingaEditor.State.FileTree.t() | nil}
```

Cancels presentation use with the same cleanup guarantee as completion.

# `complete`

```elixir
@spec complete(t()) ::
  {t(), MingaEditor.State.Windows.t() | nil,
   MingaEditor.State.FileTree.t() | nil}
```

Completes presentation use and returns the layout to restore.

# `current_focus`

```elixir
@spec current_focus(t()) :: focus()
```

Returns the focused agent panel.

# `focus`

```elixir
@spec focus(t(), focus()) :: t()
```

Switches keyboard focus inside the agent presentation.

# `install_prefix`

```elixir
@spec install_prefix(t(), prefix()) :: t()
```

Installs a pending multi-key prefix.

# `pending_prefix`

```elixir
@spec pending_prefix(t()) :: prefix()
```

Returns the pending multi-key prefix.

# `replace_return_target`

```elixir
@spec replace_return_target(t(), MingaEditor.Agent.UIState.ReturnTarget.t() | nil) ::
  t()
```

Replaces the editor return target for the active presentation.

# `reset_prefix`

```elixir
@spec reset_prefix(t()) :: t()
```

Clears a pending multi-key prefix.

# `return_target`

```elixir
@spec return_target(t()) :: MingaEditor.Agent.UIState.ReturnTarget.t() | nil
```

Returns the editor return target.

---

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