# `DalaDev.Tui.State`
[🔗](https://github.com/ohhi-vn/dala_dev/blob/main/lib/dala_dev/tui/state.ex#L1)

State struct and pure navigation logic for the dala_dev TUI.

All state transitions are pure functions: `handle_key(state, key) -> state`.
No side effects, no processes — just data transformation.

# `t`

```elixir
@type t() :: %DalaDev.Tui.State{
  current_tab: :devices | :tasks | :output | :debug,
  detail_selected: non_neg_integer(),
  devices: [DalaDev.Tui.Devices.t()],
  focus: :nav | :detail,
  last_run_output: String.t() | nil,
  loading: boolean(),
  nav_selected: non_neg_integer(),
  refreshing: boolean(),
  remotes: [DalaDev.Tui.Remote.t()],
  selected_device: DalaDev.Tui.Devices.t() | nil,
  selected_remote: DalaDev.Tui.Remote.t() | nil,
  selected_task: DalaDev.Tui.Tasks.t() | nil,
  show_help: boolean(),
  status_message: String.t() | nil,
  tasks: [DalaDev.Tui.Tasks.t()],
  version_info: map() | nil
}
```

# `breadcrumb`

```elixir
@spec breadcrumb(t()) :: String.t()
```

Returns the breadcrumb trail for the current view.

# `detail_items`

```elixir
@spec detail_items(t()) :: [term()]
```

Returns the items for the currently active detail tab.

# `device_detail`

```elixir
@spec device_detail(DalaDev.Tui.Devices.t()) :: [String.t()]
```

# `handle_key`

```elixir
@spec handle_key(t(), String.t()) :: t()
```

Processes a key press and returns the updated state.

# `nav_items`

```elixir
@spec nav_items(t()) :: [term()]
```

Returns the items shown in the navigation panel.

# `new`

```elixir
@spec new([DalaDev.Tui.Devices.t()], [DalaDev.Tui.Tasks.t()], [DalaDev.Tui.Remote.t()]) ::
  t()
```

Creates a new state with loaded devices, tasks, and remote info.

# `remote_detail`

```elixir
@spec remote_detail(DalaDev.Tui.Remote.t()) :: [String.t()]
```

# `task_detail`

```elixir
@spec task_detail(DalaDev.Tui.Tasks.t()) :: [String.t()]
```

---

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