Conversation

What a person and an assistant say to each other: each message with its actions, versions, tool calls, sources and artifacts.

  1. Why are sign-in links expiring before the email arrives?

  2. Support has 12 tickets about it since Friday.

  3. Scoutfor Ada Lovelace
    Thought for 9s

    Compare each sign-in email's send time with its delivery time, for the last 200 sends.

    Links last 10 minutes, but the mail queue has been taking up to 14. I checked the last 200 sends: 31 arrived after their link expired.

  4. Can you draft a fix that keeps links valid for 30 minutes?

  5. Scout

    On it. I'll change LINK_TTL to 30 minutes and add a test for a slow queue

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/conversation

Usage

import { ConversationView } from "./ui/uicontext/components/kit/Conversation.ts"import type { ConversationMessage } from "./ui/uicontext/components/kit/Conversation.ts"
const Message = UiSchema.TaggedEnum({ RequestedMessageAction: { message: Schema.String, action: Schema.String } })export const IssueConversation = (h: Html.H<typeof Message.Type>, messages: ReadonlyArray<ConversationMessage>) =>	ConversationView(h, {		props: {			label: "Discussion",			messages, // each with an actor, an ISO `at`, a Markdown body and its `actions`			me: "ada",		},		onEmit: { RequestedAction: ({ message, action }) => Message.RequestedMessageAction({ message, action }) },	})

Examples

With an approval

An agent asks before it acts, and the thread keeps the answer.

  1. Email the conference receipt to finance so they can expense it.

  2. Scoutfor Ada Lovelace

    Found it in your inbox: the 2-day pass, $749. Here's the email I'll send.

  3. Send this email to [email protected]

    Scout wants to
    Subject
    Conference pass receipt, $749
    Attachment
    receipt-2026.pdf

Read-only

Conversation renders a transcript without actions, for history, exports and audit pages.

  1. Alan Turing

    The nightly export failed again at the invoices step.

  2. Second night in a row, same step.

  3. Scoutfor Alan Turing

    The invoices table grew past the export's 5,000 row page limit on Friday. Paging the query fixes it; I opened a draft change.

  4. Thanks. Merged it, and tonight's run finished in 4 minutes.

An AI chat

Actions sit under the answer: Try again (with another model from its menu), a rating that asks what went wrong, and Read aloud. “‹ 2 / 2 ›” moves between versions, and the tool call it made shows above the reply.

  1. Why does the invoices query return rows in a different order each time?

  2. Thought for 4s

    Unordered SELECT. The planner picks the cheapest path, so the order changes with the plan.

    • Read the Postgres docs on ORDER BY0.8s

    Without ORDER BY, Postgres returns rows in whatever order is cheapest. Sort explicitly:

    sql · 4 lines
    select * from invoices
    where account_id = $1
    order by created_at desc
    limit 50;

    An index on (account_id, created_at) keeps it fast.

API reference

ConversationViewComponent

Props

ConversationView props
NameTypeDefaultDescription
messagesrequiredConversationMessage[]—The messages to show, oldest first
mestring—The signed-in person's id: their messages are right-aligned bubbles
labelstring"Messages"The list's accessible name; "Messages" by default
pendingActorActor—Who writes what's in the pending slot (a Stream); the slot shows only with an actor
agentIdstring—The id agents see this thread by; derived from label when left out
localestring—Formats each message's ISO at; the reader's own when left out
timeZonestring—The time zone for message times; the reader's own when left out
actionsBelowboolean—An AI chat's layout: an agent's reply has no name line, its actions sit under it (always shown on the newest), and the reader's own message keeps its edit and copy beside it.
runnable{ language, label }[]—Code blocks in these languages get a button with this label ("Run", "Preview"); a press arrives as action "run-code"

Events

ConversationView events
EventPayloadDescription
RequestedAction{ message: string; action: string; body?: string; choice?: string; reasons?: string[] }The person picked an action on a message, such as Copy or Retry. An "edit" of the reader's own message (ConversationView) arrives once they save, with the new body. Paging through versions arrives as "previous-branch" or "next-branch".

Slots

pending

ConversationView function

Options

Conversation options
NameTypeDefaultDescription
messagesrequiredConversationMessage[]—The messages to show, oldest first
mestring—The signed-in person's id: their messages are right-aligned bubbles
pending{ readonly actor: Actor; readonly children: View.Children }—Something still arriving (a Stream), shown last under its actor
labelstring"Messages"The list's accessible name; "Messages" by default
localestring—Formats each message's ISO at; the reader's own when left out
timeZonestring—The time zone for message times; the reader's own when left out

ConversationViewWithBodiesView function

Options

ConversationViewWithBodies options
NameTypeDescription
renderBodyrequired(message: ConversationMessage) => View.Input<NoInfer<Message>, R>Draws a message's body; return undefined to show its text as Markdown
slots{ readonly pending?: View.Input<NoInfer<Message>, P> }pending: what's still arriving, such as a Stream, shown under pendingActor

Accessibility

  • The conversation is a list; each message names its author and time for screen readers, and agent messages say who they acted for.
  • Message actions appear on hover and on keyboard focus, and always on touch screens.
  • Agents can read recent messages and take an action, naming the message it applies to.

Source