# Generated content

How text and values that WerkAI writes are marked, reviewed by a person before they leave WerkOS, and corrected or thrown away.

* Kind: pattern
* Page: https://design.werklist.com/patterns/generated-content
* Version: 2.1.2

## When to use it

* The summary above the newest message in the reading pane.
* The suggested reply in the reply box.
* The fields WerkAI fills on a project board, a company board and a candidate board.

## When not to use it

* Writing a draft, sending, deleting, publishing, or changing the owner or stage of a record without a person's action.
* A skeleton for a result that may not arrive. The waiting card shows only when a result is on its way.
* First person, praise, emotion or apology in the text WerkAI writes.
* A disclaimer on each card. The name and the mark of the card say who wrote it.

## Rules

* The text WerkAI writes is plain text in sentence case: no markup, no links and no dashes.
* No first person, no praise, no emotion. An apology only when WerkAI made the mistake.
* Name what is missing (an owner, a date, a decision) and do not invent it.
* Summaries are in English on every conversation. Suggestions use the language of the email.
* A suggestion appears once, when a reply opens. It does not come back after Discard.
* Accept hands the text to the reply, which saves it like typed text. Before Accept nothing is written.
* Fields WerkAI fills are ordinary fields: a person's edit is the value.
* Reset WerkAI is for the board owner. It runs unfinished cells again and leaves filled ones alone.
* The card has no feedback buttons.

## Anatomy

* AI card: see the WerkAI component: gradient fill, one ink, the WerkAI mark at 20 px, text 14/20 (--ai-from, --ai-to, --ai-ink, --type-product-body)
* Column glyph: the WerkAI glyph at 14 px, 4 px after the name of a column WerkAI fills, in muted ink; screen readers hear the column name followed by Written by WerkAI (--text-muted, --space-1)
* Waiting dots: three 6 px dots, 4 px apart; one lit and two at 40 percent; the lit dot moves every 260 ms (--ai-ink)
* Reveal: the text types in over 600 ms, and the card has its final height from the start
* Cell bar: 8 px high, 75 percent of the cell width, full radius, muted ink at 20 percent, pulsing (--text-muted, --radius-full)

## States

* Absent: No card and no space held while no result is on its way
* Waiting: The card at its final height with the dots; screen readers hear Preparing the summary or Writing a suggested reply (--ai-ink)
* Revealing: The text types in over 600 ms; screen readers receive the whole text at once
* Shown: The full text; a suggestion adds Discard and Accept
* Failed: One sentence in the card ink with Try again and Discard (--ai-ink)
* Withdrawn: When there is nothing to answer, the card leaves without a word
* Cell writing: A pulsing bar in place of the value; screen readers hear WerkAI is writing this field (--text-muted)
* Cell not processed: The words Not processed in muted ink; selecting the cell runs it again, with the cells that depend on it (--text-muted)

## Keyboard

* Tab: In a suggestion: Discard, then Accept
* Enter or Space: Presses the focused card button; on a Not processed cell, runs it again

## Accessibility

* The card is a region named AI summary or Suggested reply.
* The summary is marked as English. A suggestion takes the language of the email.
* A screen reader receives the whole text at once. The typed copy is hidden from it.
* The dots are hidden from screen readers, and a sentence beside them is read instead.
* After Accept the caret is in the reply with the text. After Discard focus returns to the reply.
* The waiting and failed states announce nothing of their own.
* A Not processed cell is named Not processed, select to run WerkAI again.

## Content

* Card names: AI summary, Suggested reply.
* Buttons: Accept, Discard, Try again.
* Waiting: Preparing the summary; Writing a suggested reply.
* Refusals: AI is not available right now. Too many requests. Try again in a minute. The model could not write this. Try again or say more about it.
* Board: Not processed; Reset WerkAI.

## Tokens

* --ai-from
* --ai-to
* --ai-ink
* --text-muted
* --type-product-body
* --type-product-dense
* --radius-xl
* --radius-full
* --space-1
* --focus-ring
