{
 "id": "activity-feed",
 "name": "Activity feed",
 "purpose": "A record's history: who did what and when, with field changes shown as old value, new value and the difference.",
 "use_when": [
  "on a record page, to show its history of changes",
  "a deal, ticket or account where a reader needs to see exactly which fields changed and by how much"
 ],
 "avoid_when": [
  "a security or admin trail with risk levels and IP addresses: use audit-log",
  "a short list of recent events across many records with no field changes: use activity-list",
  "a conversation people reply in: use comment-thread"
 ],
 "type": "data",
 "style": "quiet",
 "width": "medium",
 "tags": {
  "audience": "work",
  "industries": [
   "crm",
   "saas",
   "any"
  ],
  "keywords": [
   "activity",
   "history",
   "timeline",
   "diff",
   "audit"
  ]
 },
 "root": ".odl-activity-feed",
 "parts": [
  {
   "name": "title",
   "selector": "h3",
   "what": "the feed's heading",
   "slot": "text"
  },
  {
   "name": "events",
   "selector": "ol > li",
   "what": "one event, newest first, joined to the next by a thread line",
   "slot": "list"
  },
  {
   "name": "avatar",
   "selector": ".odl-avatar",
   "what": "photo of the person who acted",
   "slot": "media"
  },
  {
   "name": "kind",
   "selector": ".odl-kind",
   "what": "small icon badge on the avatar for the kind of event (edit, email, call)",
   "slot": "none"
  },
  {
   "name": "line",
   "selector": ".odl-line p",
   "what": "who did what, with names in bold and an optional link",
   "slot": "rich"
  },
  {
   "name": "time",
   "selector": "time",
   "what": "when it happened",
   "slot": "text"
  },
  {
   "name": "changes",
   "selector": "dl > div",
   "what": "one changed field: name, old value, new value and an optional difference",
   "slot": "list"
  },
  {
   "name": "quote",
   "selector": "blockquote",
   "what": "the text of a reply or note",
   "slot": "text"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "events"
  ],
  "properties": {
   "title": {
    "type": "string",
    "maxLength": 32,
    "part": "title"
   },
   "events": {
    "type": "array",
    "minItems": 1,
    "maxItems": 12,
    "part": "events",
    "items": {
     "type": "object",
     "required": [
      "actor",
      "action",
      "time"
     ],
     "properties": {
      "actor": {
       "type": "string",
       "maxLength": 32,
       "part": "line"
      },
      "avatar": {
       "type": "string",
       "maxLength": 300,
       "format": "uri",
       "part": "avatar"
      },
      "kind": {
       "enum": [
        "edit",
        "email",
        "call"
       ],
       "part": "kind"
      },
      "action": {
       "type": "string",
       "maxLength": 100,
       "part": "line"
      },
      "target": {
       "type": "string",
       "maxLength": 32,
       "part": "line"
      },
      "time": {
       "type": "string",
       "maxLength": 16,
       "part": "time"
      },
      "changes": {
       "type": "array",
       "minItems": 1,
       "maxItems": 6,
       "part": "changes",
       "items": {
        "type": "object",
        "required": [
         "field",
         "from",
         "to"
        ],
        "properties": {
         "field": {
          "type": "string",
          "maxLength": 18
         },
         "from": {
          "type": "string",
          "maxLength": 20
         },
         "to": {
          "type": "string",
          "maxLength": 20
         },
         "delta": {
          "type": "string",
          "maxLength": 12
         }
        }
       }
      },
      "quote": {
       "type": "string",
       "maxLength": 280,
       "part": "quote"
      }
     }
    }
   },
   "label": {
    "type": "string",
    "maxLength": 120
   }
  }
 },
 "states": {
  "shown": [
   "field change",
   "reply with quote",
   "plain event",
   "link focus"
  ],
  "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": "keep the heading and put an alert-banners line with a retry in place of the list"
   },
   "disabled": {
    "status": "not_built",
    "how": "the feed has no controls to disable; to lock a link, drop its href and show it as plain bold text"
   },
   "overflow": {
    "status": "not_built",
    "how": "the list grows with every event; cap it at about ten and add a 'Show older' link or pagination below"
   },
   "long_text": {
    "status": "handled",
    "how": "the event line and time wrap onto two lines, record names and times never break, and in a narrow box each changed field stacks its name over its values",
    "evidence": ".odl-activity-feed .odl-nb { white-space: nowrap; }"
   },
   "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-border-width-emphasis",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-separator",
  "--ds-color-border-subtle",
  "--ds-color-icon-subtle",
  "--ds-color-surface-base",
  "--ds-color-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-link",
  "--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-lg",
  "--ds-radius-container",
  "--ds-radius-detail",
  "--ds-radius-full",
  "--ds-radius-nested",
  "--ds-radius-person",
  "--ds-size-control-md",
  "--ds-size-icon-sm",
  "--ds-space-4",
  "--ds-space-inline-md",
  "--ds-space-inline-sm",
  "--ds-space-inset-lg",
  "--ds-space-inset-md",
  "--ds-space-inset-sm",
  "--ds-space-inset-xl",
  "--ds-space-stack-lg",
  "--ds-space-stack-sm",
  "--ds-space-stack-xl",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-label-md",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "An ordered list of events; old and new values use del and ins, so they are not told apart by colour alone.",
  "roles": [
   "list",
   "region"
  ],
  "keyboard": [
   "Tab reaches each link in the feed",
   "Enter follows the focused link"
  ],
  "controls": {
   "button": 0,
   "input": 0,
   "link": 1,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": false,
  "min_target": false
 },
 "files": {
  "html": "components/activity-feed/component.html",
  "bytes": 11031,
  "script": false
 },
 "source": "brand/showcase/product/03-corvane-record",
 "photos": 2,
 "urls": {
  "html": "https://opendesigner.dev/library/activity-feed.html",
  "json": "https://opendesigner.dev/library/activity-feed.json",
  "page": "https://opendesigner.dev/library/activity-feed/"
 },
 "get": {
  "curl": "curl -fsSLo activity-feed.html https://opendesigner.dev/library/activity-feed.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add activity-feed --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component activity-feed to this project: https://opendesigner.dev/library/activity-feed.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
