PhiaUi.Components.Collab.Thread (phia_ui v0.1.17)

Copy Markdown View Source

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

Components

Summary

Functions

Renders an absolutely-positioned thread panel.

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

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

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

Renders a collapsed view of a resolved thread.

Functions

collab_floating_thread(assigns)

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(assigns)

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(assigns)

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(assigns)

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(assigns)

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.