← All proposals

Event log with agent

A recipe, not a component: a story and Usage page that compose existing proposals.

Extends a PDS componentOpen in Storybook

proposals/EventLogWithAgent/HANDOFF.md112 lines · View on GitHub

Handoff: Event log with agent (recipe)

Rewritten 2026-11-20 against v2.0.0-beta.21 to the lessons template (docs/LESSONS.md, L1 to L11). The composition below was checked against EventLogWithAgent.stories.tsx and the components it uses. This is a recipe: sections that do not apply say "none, recipe". Nothing was checked by eye in a session and the a11y panel was not run.

What and why

When an agent joins an event log it needs to be clear where it started, what it did and where it handed back. This is a recipe, not a component: a story and Usage page that compose existing proposals. It adds no props, classes, tokens or CSS of its own, so there is nothing to port. The engineer ports the components it uses (below) and copies the composition from the story as documentation; what the screen owns is where the agent's region starts and stops, the divider wording, and which entries are agentic.

  • Figma / Jira: none. Source: designer screenshots (2026-10-16) of a deploy log with a "Zappy engaged" divider and an agent sandbox investigation.
  • Context: context.md

Exploration and decisions

  • Recipe, not a component. Where the agent starts and stops, the divider wording and which entries are agentic are screen decisions; a component would need props for each and break for a log with two runs or none. An EventLogGroup can be added later if the same region keeps being rebuilt.
  • Both ends use the same agentic LabeledDivider ("Zappy engaged", "Zappy finished"), with tone='agentic' (the gradient; the purple agentic-filled was removed 2026-10-21). The old handoff said "the recipe uses the filled one" in its open questions; that was stale and is removed. decisions.md has the same stale line under Open questions; a dated note there corrects it.
  • Dividers are size='xs'. The s default is too big next to the rows. The component default stays s; the recipe sets xs, so copy that prop.
  • Two stories: the agent still working (a ThinkingState is the live last entry, no closing divider) and finished (a done item and the closing divider).

Full list and reasons: decisions.md.

API

None, recipe. The composition (see EventLogWithAgent.stories.tsx for the exact props):

  • EventLog with hasRail holds the log.
  • Neutral EventLogItems before the agent joins (status='done', status='error', or a custom iconName).
  • An agentic LabeledDivider (tone='agentic', size='xs', prefixIcon='zappy', label) opens the region.
  • isAgentic EventLogItems, a ChainOfThought (isActive={false}, isOpen, label, time) holding more isAgentic items, and a ThinkingState (label) are the agent's entries.
  • A second agentic LabeledDivider closes it (only when the agent is not working).
  • Neutral EventLogItems after the hand-back.

The rail joins neighbouring items and stops at a divider, a Chain of Thought or a Thinking State. Stories: AgentWorking, AgentFinished.

Story-only (L9): Log, the shared render function with an isWorking flag, and all sample text. The suffixIcon={undefined} on both dividers does nothing (suffixIcon is optional with no default); drop it when copying.

Tokens used

None of its own: no CSS, and no tokens, classes, custom variables or raw values. The stories are story-only composition. See the handoffs of the components it uses.

Impact

From impact.md: nothing reaches existing components, no --pds-* token is redefined, and no other proposal imports or uses this recipe. It depends on the proposals below, and changes to them change what the stories show.

Reused vs net-new

  • Reused: Event Log and EventLogItem (../EventLog/HANDOFF.md), LabeledDivider (../LabeledDivider/HANDOFF.md), ChainOfThought (../ChainOfThought/HANDOFF.md), and ThinkingState, which has shipped. The story imports ThinkingState from @pantheon-systems/pds-toolkit-react, so there is nothing to port. The old handoff listed it as a proposal "tagged ready"; its handoff is kept only as history in ../_implemented/ThinkingState/HANDOFF.md.
  • Net-new: none, recipe. See custom.md.
  • Port order (docs/PORT-ORDER.md): Event Log and EventLogItem and ChainOfThought are ready; LabeledDivider is not in the package yet and now only needs Icon ahead of it (the Agentic Menu Button was folded into MenuButton on 2026-11-20). So this recipe cannot be ported until LabeledDivider lands. Check the tags and docs/PORT-ORDER.md before porting.

Accessibility

What the code does (nothing of its own):

  • The list is an ol with an li per child (from Event Log), so the entries are counted. A plain LabeledDivider renders role='separator' with aria-label set to its label, so "Zappy engaged" and "Zappy finished" are announced as named separators; its lines and label text are aria-hidden.
  • Keyboard and focus come from the components: an expandable EventLogItem and the Chain of Thought summary are native details/summary (Enter and Space, visible focus ring). Nothing else in the story is focusable.
  • What is announced: each item's status text and label once (write labels that do not repeat the status). The live last entry is a ThinkingState; how it is announced while it runs is the package component's behavior and was not checked here.
  • The agent color on isAgentic items is not the only signal: the "Zappy engaged" and "Zappy finished" separators name the region in text.
  • a11y panel: not run on either story, in light or dark. Light and dark: not checked by eye. Contrast: not checked.

Decisions and open questions

Each carries a recommended answer (the designer decides).

  • Does the region need a tint or bracket between the dividers, beyond isAgentic and the dividers? Recommendation: no, not for this release; add an EventLogGroup only if the same region keeps being rebuilt.
  • Divider styling: closed. Gradient tone='agentic' (2026-10-21).
  • Who owns the two dividers' wording and the live tail? The screen. Recommendation: keep it that way (that is the reason it is a recipe).

Extension or new component

None, recipe: it composes proposals and adds nothing to any PDS component (L1). The agent flavor lives in the components it uses (isAgentic on EventLogItem, tone='agentic' on LabeledDivider); their extension questions are in their own handoffs. Why not a component: see Exploration.

Footprint

None of its own, recipe. What the composition inherits (see the Event Log handoff for details, not checked by eye):

  • The rail is drawn by each joined entry and is cut at the dividers, the Chain of Thought and the Thinking State, so those entries break the line by design.
  • Chain of Thought renders its own nested EventLog; one level of nesting is the tested depth.
  • A divider is a full-width row inside an li; whether it clips or misaligns next to the rail at narrow widths was not checked.

Dark mode and per-size values

None of its own, recipe, single size (dividers xs, items xs by the Event Log default). No per-theme override. Values come from the components; dark mode of the composition was not checked.

Expect to change

The recipe breaks no toolkit convention of its own. Items inherited from the components it uses, with recommended answers:

  1. isAgentic vs isAgent (L1, L2). Shipped identity components use isAgent; this recipe uses isAgentic on EventLogItem as the proposals define it. If the Event Log handoff's recommendation (isAgent) is accepted, rename the prop in the story. Recommendation: follow the Event Log decision.
  2. LabeledDivider props the recipe relies on (tone='agentic', prefixIcon, size='xs'): their shape is decided on the LabeledDivider proposal. Recommendation: if the engineer renames or flattens any of them, update the story only.
  3. The recipe is documentation. If the engineer would rather not ship a Recipe page, the Usage text can move into the Event Log page. Recommendation: keep the recipe page.

Target-version check

Checked 2026-11-20 against .pds-reference/src at v2.0.0-beta.21.

Item Exists at beta.21?
EventLog, EventLogItem, isAgentic no (see the Event Log handoff)
LabeledDivider (tone='agentic') no (no LabeledDivider or labeled-divider in src)
ChainOfThought no
ThinkingState with a label prop yes, shipped (loading-indicators/ThinkingState)
Icons zappy, codeBranch, circleInfo, check, diamondExclamation yes, all in icon-registry.ts. None is new
A Timeline alternative exists (lists/Timeline) but is a different pattern (cards with a heading and paragraph)

Port notes

Nothing to generate or port, recipe. Port Event Log, EventLogItem, LabeledDivider (and its dependencies) and ChainOfThought first, then keep the stories as documentation for the composition (they live under Recipes in Storybook, not in the component source). ThinkingState needs no port.

Preview

npm run storybook, then Recipes / Event log with agent (stories Agent Working and Agent Finished). Figma: none.