{
 "id": "comment-thread",
 "name": "Comment thread",
 "purpose": "Comments on a record with an @mention, a resolved reply, reactions, an edited marker and a composer with a Comment button.",
 "use_when": [
  "on a record people discuss together",
  "a review or approval where a question needs an answer from a named teammate and can be marked resolved"
 ],
 "avoid_when": [
  "a live back-and-forth conversation: use chat-thread or live-chat",
  "comments on a phone opened from a record: use comment-sheet",
  "a log of what changed rather than what people said: use activity-feed"
 ],
 "type": "data",
 "style": "quiet",
 "width": "medium",
 "tags": {
  "audience": "work",
  "industries": [
   "saas",
   "finance",
   "productivity"
  ],
  "keywords": [
   "comments",
   "thread",
   "mentions",
   "reactions",
   "composer"
  ]
 },
 "root": ".odl-comment-thread",
 "parts": [
  {
   "name": "title",
   "selector": ".odl-head h3",
   "what": "the heading with the comment count after it",
   "slot": "text"
  },
  {
   "name": "context",
   "selector": ".odl-head p",
   "what": "what the comments are about, such as a record number and amount",
   "slot": "text"
  },
  {
   "name": "comments",
   "selector": ".odl-comment",
   "what": "one comment: avatar, name, time, an edited marker, the text, reactions and Reply",
   "slot": "list"
  },
  {
   "name": "text",
   "selector": ".odl-body > p",
   "what": "the comment, which may hold an @mention",
   "slot": "rich"
  },
  {
   "name": "reactions",
   "selector": ".odl-reaction",
   "what": "a reaction chip with its count; yours is accented",
   "slot": "action"
  },
  {
   "name": "add_reaction",
   "selector": ".odl-react",
   "what": "an icon button to add a reaction",
   "slot": "action"
  },
  {
   "name": "replies",
   "selector": ".odl-replies",
   "what": "a sunken box of replies, under a resolved line when resolved",
   "slot": "list"
  },
  {
   "name": "resolved",
   "selector": ".odl-resolved",
   "what": "who resolved the comment and when",
   "slot": "text"
  },
  {
   "name": "composer",
   "selector": "textarea",
   "what": "the box for a new comment",
   "slot": "input"
  },
  {
   "name": "composer_tools",
   "selector": ".odl-bar > button",
   "what": "Mention and Attach icon buttons",
   "slot": "action"
  },
  {
   "name": "send",
   "selector": ".odl-send",
   "what": "the Comment button, disabled until there is text",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "comments"
  ],
  "properties": {
   "title": {
    "type": "string",
    "maxLength": 24,
    "part": "title"
   },
   "count": {
    "type": "integer",
    "part": "title"
   },
   "context": {
    "type": "string",
    "maxLength": 40,
    "part": "context"
   },
   "comments": {
    "type": "array",
    "minItems": 1,
    "maxItems": 8,
    "part": "comments",
    "items": {
     "type": "object",
     "required": [
      "author",
      "time",
      "text"
     ],
     "properties": {
      "author": {
       "type": "string",
       "maxLength": 32
      },
      "avatar": {
       "type": "string",
       "maxLength": 300
      },
      "time": {
       "type": "string",
       "maxLength": 20
      },
      "edited": {
       "type": "boolean"
      },
      "text": {
       "type": "string",
       "maxLength": 600,
       "part": "text"
      },
      "reactions": {
       "type": "array",
       "minItems": 0,
       "maxItems": 4,
       "part": "reactions",
       "items": {
        "type": "object",
        "required": [
         "emoji",
         "count"
        ],
        "properties": {
         "emoji": {
          "type": "string",
          "maxLength": 4
         },
         "count": {
          "type": "integer"
         },
         "mine": {
          "type": "boolean"
         }
        }
       }
      },
      "resolved": {
       "type": "object",
       "part": "resolved",
       "properties": {
        "by": {
         "type": "string",
         "maxLength": 32
        },
        "when": {
         "type": "string",
         "maxLength": 12
        }
       }
      },
      "replies": {
       "type": "array",
       "minItems": 0,
       "maxItems": 5,
       "part": "replies",
       "items": {
        "type": "object",
        "required": [
         "author",
         "text"
        ],
        "properties": {
         "author": {
          "type": "string",
          "maxLength": 32
         },
         "avatar": {
          "type": "string",
          "maxLength": 300
         },
         "time": {
          "type": "string",
          "maxLength": 20
         },
         "text": {
          "type": "string",
          "maxLength": 400
         }
        }
       }
      },
      "resolved_by": {
       "type": "string",
       "maxLength": 80
      },
      "resolved_when": {
       "type": "string",
       "maxLength": 80
      }
     }
    }
   },
   "placeholder": {
    "type": "string",
    "maxLength": 48,
    "part": "composer"
   },
   "send_label": {
    "type": "string",
    "maxLength": 12,
    "part": "send"
   }
  }
 },
 "states": {
  "shown": [
   "hover",
   "focus",
   "resolved",
   "edited",
   "reaction on",
   "send disabled",
   "send enabled"
  ],
  "edge": {
   "empty": {
    "status": "handled",
    "evidence": "data-od-list",
    "how": "the Smart UI renderer puts one plain 'Nothing to show yet.' line in an empty list"
   },
   "loading": {
    "status": "handled",
    "evidence": "data-od-slot",
    "how": "the Smart UI renderer draws each marked slot as a quiet block of its size while the data arrives; the static file shows the filled part"
   },
   "error": {
    "status": "not_built",
    "how": "if a comment fails to post, keep its text in the box and put an alert-banners line above the composer"
   },
   "disabled": {
    "status": "shown",
    "how": "the Comment button starts disabled and turns on once the box has text",
    "evidence": ".odl-comment-thread .odl-send:disabled"
   },
   "overflow": {
    "status": "handled",
    "how": "the composer grows with its text up to 12rem, then scrolls; the comment list itself grows with the page",
    "evidence": "field-sizing: content; min-block-size: var(--ds-size-row-two-line); max-block-size: 12rem"
   },
   "long_text": {
    "status": "handled",
    "how": "comment text wraps in a column that can shrink, and the name and time line wraps; a long unbroken link is not broken and can overflow",
    "evidence": ".odl-comment-thread .odl-body { min-inline-size: 0;"
   },
   "missing_image": {
    "status": "handled",
    "evidence": "data-od-media",
    "how": "the Smart UI renderer swaps a photo that fails to load for a block of the same size with its alt text"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-color-bg-accent-subtle",
  "--ds-color-bg-action-primary",
  "--ds-color-bg-action-primary-hover",
  "--ds-color-bg-disabled",
  "--ds-color-bg-field",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-bg-neutral-subtle-hover",
  "--ds-color-border-accent",
  "--ds-color-border-focus",
  "--ds-color-border-input",
  "--ds-color-border-subtle",
  "--ds-color-icon-subtle",
  "--ds-color-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-accent",
  "--ds-color-text-disabled",
  "--ds-color-text-on-action",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-success",
  "--ds-color-text-tertiary",
  "--ds-elevation-raised",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-font-weight-label",
  "--ds-icon-stroke-md",
  "--ds-motion-duration-short",
  "--ds-motion-easing-standard",
  "--ds-radius-container",
  "--ds-radius-control",
  "--ds-radius-full",
  "--ds-radius-nested",
  "--ds-radius-person",
  "--ds-size-control-sm",
  "--ds-size-icon-lg",
  "--ds-size-icon-sm",
  "--ds-size-row-two-line",
  "--ds-size-target-min",
  "--ds-space-inline-md",
  "--ds-space-inline-sm",
  "--ds-space-inline-xs",
  "--ds-space-inset-lg",
  "--ds-space-inset-md",
  "--ds-space-inset-sm",
  "--ds-space-inset-xl",
  "--ds-space-inset-xs",
  "--ds-space-stack-lg",
  "--ds-space-stack-sm",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "Comments are an ordered list; reactions are toggle buttons with aria-pressed and a count in their name; the composer's textarea is labelled and Cmd or Ctrl+Enter sends.",
  "roles": [
   "form",
   "list",
   "region"
  ],
  "keyboard": [
   "Tab reaches each comment's reaction, Add a reaction and Reply, then the comment box, Mention, Attach and Comment",
   "Enter or Space on a reaction turns yours on or off and updates the count",
   "Cmd or Ctrl+Enter in the comment box sends it when it has text; the Comment button is disabled, and skipped by Tab, while the box is empty"
  ],
  "controls": {
   "button": 12,
   "input": 0,
   "link": 0,
   "select": 0,
   "textarea": 1,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/comment-thread/component.html",
  "bytes": 18465,
  "script": true
 },
 "source": "brand/showcase/product/02-fennick-approvals",
 "photos": 3,
 "urls": {
  "html": "https://opendesigner.dev/library/comment-thread.html",
  "json": "https://opendesigner.dev/library/comment-thread.json",
  "page": "https://opendesigner.dev/library/comment-thread/"
 },
 "get": {
  "curl": "curl -fsSLo comment-thread.html https://opendesigner.dev/library/comment-thread.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add comment-thread --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component comment-thread to this project: https://opendesigner.dev/library/comment-thread.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
