# `PhiaUi.Components.Collab.Thread`
[🔗](https://github.com/charlenopires/PhiaUI/blob/v0.1.17/lib/phia_ui/components/collab/thread.ex#L1)

Thread Suite — 5 components for managing comment threads in collaborative contexts.

## Components

- `collab_thread/1`          — Full thread view: root comment + replies + composer slot
- `collab_thread_header/1`   — Header bar with resolve/close actions and reply count
- `collab_thread_list/1`     — Sidebar list of all threads with sort/filter
- `collab_floating_thread/1` — Absolutely-positioned thread (PhiaFloatingThread hook)
- `collab_thread_resolved/1` — Collapsed resolved thread with reopen action

# `collab_floating_thread`

Renders an absolutely-positioned thread panel.

Anchored to a specific `(x, y)` position within a document or editor.
Uses the `PhiaFloatingThread` JS hook for drag and click-outside-to-dismiss.

## Attributes

* `id` (`:string`) (required)
* `thread` (`:map`) (required)
* `x` (`:any`) - Defaults to `0`.
* `y` (`:any`) - Defaults to `0`.
* `current_user_id` (`:string`) - Defaults to `nil`.
* `class` (`:string`) - Defaults to `nil`.
## Slots

* `composer`

# `collab_thread`

Renders a full thread view with root comment, replies, and a composer slot.

The thread displays all comments in chronological order with a header bar
showing resolve/reopen controls.

## Attributes

- `:thread` — thread map with keys: `id`, `resolved`, `comments` (list of comment maps)
- `:current_user_id` — ID of the viewing user
- `:on_resolve` — event name when resolving a thread
- `:on_reopen` — event name when reopening a resolved thread

## Slots

- `:composer` — slot for a composer component at the bottom of the thread

## Attributes

* `id` (`:string`) (required)
* `thread` (`:map`) (required)
* `current_user_id` (`:string`) - Defaults to `nil`.
* `on_resolve` (`:string`) - Defaults to `"collab:thread:resolve"`.
* `on_reopen` (`:string`) - Defaults to `"collab:thread:reopen"`.
* `class` (`:string`) - Defaults to `nil`.
## Slots

* `composer`

# `collab_thread_header`

Renders the thread header bar with resolve/reopen and close actions.

Shows a reply count and action buttons. When the thread is resolved,
the resolve button switches to a reopen button.

## Attributes

* `id` (`:string`) (required)
* `thread_id` (`:string`) (required)
* `resolved` (`:boolean`) - Defaults to `false`.
* `reply_count` (`:integer`) - Defaults to `0`.
* `on_resolve` (`:string`) - Defaults to `"collab:thread:resolve"`.
* `on_reopen` (`:string`) - Defaults to `"collab:thread:reopen"`.
* `on_close` (`:string`) - Defaults to `"collab:thread:close"`.
* `class` (`:string`) - Defaults to `nil`.

# `collab_thread_list`

Renders a sidebar list of all threads with sort and filter controls.

Each thread item shows a preview of the root comment, reply count, and
participant avatars. Supports sorting by date, activity, or unresolved-first.

## Attributes

* `id` (`:string`) (required)
* `threads` (`:list`) - Defaults to `[]`.
* `current_user_id` (`:string`) - Defaults to `nil`.
* `sort_by` (`:atom`) - Defaults to `:activity`. Must be one of `:date`, `:activity`, or `:unresolved_first`.
* `show_resolved` (`:boolean`) - Defaults to `true`.
* `class` (`:string`) - Defaults to `nil`.

# `collab_thread_resolved`

Renders a collapsed view of a resolved thread.

Shows a summary with the root comment preview and a reopen button.

## Attributes

* `id` (`:string`) (required)
* `thread` (`:map`) (required)
* `on_reopen` (`:string`) - Defaults to `"collab:thread:reopen"`.
* `class` (`:string`) - Defaults to `nil`.

---

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