collaboration — wyrd.component.comment-thread

CommentThread

Threaded review discussion with flat host-supplied comments, reply submission, and resolve/reopen events.

Install @wyrd-company/react or the Flutter package and use it directly — your DESIGN.md does the styling.

01

Examples

Generated from the contract's examples block. Previews are the published @wyrd-company/react component, themed by the brand's role tokens — flip the site's light/dark toggle and they follow.

Code target Applies to every example on component pages.
open state: open
Usage
import { WyrdCommentThread } from "@wyrd-company/react";

<WyrdCommentThread threadId="thread-route-delay" status="open" comments={[{"id":"comment-route-delay-copy","author-id":"author-rin","author-name":"Rin","timestamp":"2026-07-04T16:15:00.000Z","timestamp-label":"Today at 4:15 PM","body-format":"plain-text","body":"Delay copy should identify the affected service window before dispatch signs off.","decision":"request-changes","edited":false,"can-edit":false,"can-delete":false}]} defaultReplyValue="" />

// events: onReplyChange, onReplySubmit, onResolve, onReopen, onCommentEdit, onCommentDelete
resolved state: resolved
Usage
import { WyrdCommentThread } from "@wyrd-company/react";

<WyrdCommentThread threadId="thread-coordinator-lock" status="resolved" comments={[{"id":"comment-coordinator-lock","author-id":"author-mara","author-name":"Mara","timestamp":"2026-07-04T16:20:00.000Z","body-format":"plain-text","body":"Locked coordinator field matches this scenario.","decision":"approve","edited":true,"can-edit":true,"can-delete":false}]} />

// events: onReplyChange, onReplySubmit, onResolve, onReopen, onCommentEdit, onCommentDelete
02

Properties

NameTypeDefaultSummary
thread-id string undefined Opaque host-supplied thread identifier.
status open | resolved open Host-supplied thread status.
comments array Flat ordered comments in display order, structurally mirroring the comment contract.
reply-value string undefined Controlled reply composer value.
default-reply-value string Initial uncontrolled reply composer value.
can-reply boolean true Shows the reply composer when true.
can-resolve boolean true Shows resolve/reopen affordance when true.
03

Slots & events

EventPayloadSummary
reply-change thread-id, value Emitted when the reply composer value changes.
reply-submit thread-id, body Emitted when the user submits a non-empty reply.
resolve thread-id Emitted when the user requests resolving an open thread.
reopen thread-id Emitted when the user requests reopening a resolved thread.
comment-edit thread-id, comment-id Re-emitted when a child comment edit affordance is activated.
comment-delete thread-id, comment-id Re-emitted when a child comment delete affordance is activated.
04

Tokens

The contract's token bindings. Open the shared contextual sidebar from any example; primary swatches reflect the color you pick there. Error swatches show the active preset's values; editing any knob switches to custom and resets error to TWW · Ink.

BindingToken
background color.surface
foreground color.on-surface
muted color.on-surface-variant
border-color color.outline
composer-background color.surface-container
action-background color.primary
action-foreground color.on-primary
radius rounded.md
padding-x spacing.md
padding-y spacing.md
gap spacing.sm
05

States

StateSourceSummary
open property Thread is open.
resolved property Thread is resolved.
replying interaction Reply composer has focus or content.
06

Accessibility

From the contract's accessibility obligations. Role list; Thread id and status identify the comment thread; hosts may wrap with a stronger label when needed.

  • Tab moves through resolve/reopen action, child comment actions, reply input, and submit button.
  • Enter or Space activates focused buttons.
  • The reply input accepts normal multiline text entry.
  • Web projections render thread comments as a native list of article-like comment items.
  • Resolve/reopen and reply submit controls are buttons named by component-owned localized messages.
  • Reply input is labelled by the component-owned reply message.
  • Empty reply submissions are ignored locally and do not dispatch reply-submit.
  • Verified under: rtl, reduced-motion, cvd-deuteranopia, density-compact, text-expansion.
07

SDUI

Status: serializable. CommentThread serializes flat comments and interaction bindings. It does not own workflow state, identity, or persistence.

SerializableMembers
Propertiesthread-id, status, comments, reply-value, default-reply-value, can-reply, can-resolve
Slots
Eventsreply-change, reply-submit, resolve, reopen, comment-edit, comment-delete
The Wyrding Way — a contract-first design system. © Wyrd Company