# `MingaEditor.FocusTree.Node`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/focus_tree/node.ex#L1)

A node in the focus tree: one visible region that can receive mouse routing.

Each node owns a rect, a content type tag, optional input handler module, and children in rendered z-order. Later children paint above earlier children, so hit-tests prefer later children. The `id`, `parent`, `previous_sibling`, and `next_sibling` fields are stable references inside the tree, not parent structs. That keeps the tree acyclic while still letting routing and tests reason about hierarchy.

See `MingaEditor.FocusTree` for tree construction and traversal.

# `content_type`

```elixir
@type content_type() ::
  :viewport
  | :tab_bar
  | :file_tree
  | :editor_area
  | :window
  | :gutter
  | :buffer_content
  | :modeline
  | :status_bar
  | :agent_panel
  | :agent_chat_window
  | :agent_chat_content
  | :bottom_panel
  | :minibuffer
  | :modal_overlay
  | :picker_backdrop
  | :picker
  | :completion_backdrop
  | :completion_menu
  | :hover_popup
  | :signature_help
  | :float_popup
  | :agent_context
  | :tool_manager
  | :extension_panel
  | :observatory
  | :edit_timeline
  | :notifications
  | :extension_overlay
  | :which_key
  | {:custom, atom()}
```

Tag identifying what the node represents.

# `id`

```elixir
@type id() :: term()
```

Stable node reference inside a focus tree.

# `rect`

```elixir
@type rect() ::
  {non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()}
```

Pixel/cell rect. Same shape as `MingaEditor.Layout.rect/0`.

# `t`

```elixir
@type t() :: %MingaEditor.FocusTree.Node{
  children: [t()],
  content_type: content_type(),
  focusable?: boolean(),
  handler: module() | nil,
  id: id(),
  next_sibling: id() | nil,
  parent: id() | nil,
  previous_sibling: id() | nil,
  rect: rect(),
  ref: term(),
  scrollable?: boolean()
}
```

A node in the focus tree.

# `contains?`

```elixir
@spec contains?(t(), integer(), integer()) :: boolean()
```

Returns true when `(row, col)` is inside the node's half-open rect.

# `new`

```elixir
@spec new(content_type(), rect(), keyword()) :: t()
```

Constructs a node with the given content type and rect.

---

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