/** * Public data model for customer-defined action buttons on a comment. * * Customers attach a list of actions to a comment (or to the annotation, which * acts as the per-agent-row default). Velt renders them as chips and emits * `commentActionClicked` when one is clicked. **Velt never interprets an * action** — clicking one performs no SDK write of any kind (spec AC-003). * * Part of the SDK public API (exported via `src/models.ts` → velt-types). * Additive — see `specs/agent-comment-actions-and-progress/spec.md` * `## Outbound contract changes`. */ /** * A single customer-defined action rendered as a chip on a comment. * * Identity is `id` and only `id` (spec AC-002). There is deliberately no * `type` field — two opaque customer strings on one object is confusing, and * `id` matches the already-shipped `AgentSuggestionAction`. There is also no * `actor` (clicks are fire-and-forget, so the SDK has nothing to record), no * `selected` / `singleSelect`, and no visual `variant`. */ export interface CommentAction { /** * Stable, opaque, customer-owned identifier. REQUIRED — the only identity. * * The same `id` legitimately appears on many comments in one thread, which is * why duplicate-click suppression is keyed on * `(annotationId, commentId, actionId)` and never on `id` alone. */ id: string; /** Display label (chip text). Also the accessible name when an icon is set. */ label?: string; /** * Raw SVG string (a trimmed value starting with `<`) rendered through the * `safeSvg` pipe, OR a URL / data-URI rendered as an ``. Anything else * is ignored — label only, no throw and no broken glyph. * * There is no named-icon registry and none is planned. */ icon?: string; /** Renders the chip non-interactive. A disabled chip emits nothing. */ disabled?: boolean; /** * Omits the chip entirely. An `actions` array in which every entry is hidden * is a present-but-empty list: it renders NO row and does NOT fall back to * the built-in accept/reject (spec INV-008 — that fallback would re-expose a * state-changing control the customer deliberately suppressed). */ hidden?: boolean; /** * Customer-owned bag, persisted as-is and echoed back verbatim on the click * event. Velt never reads it. */ metadata?: any; }