Citations

Numbered references in text, with the source on hover.

Churn dropped about a fifth this quarter . Two changes line up with it:

  • The new import checklist, which admins credit for getting their team live in a day .

  • Annual plans became the default on the pricing page in early August .

The forecast doesn't separate the two, so treat the split between them as unknown.

Sources

  1. Q3 retention forecastFinance / Forecasts
  2. Customer interviews: onboardingResearch
  3. Pricing change rollout#revenue

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/cite

Usage

import { type Citation, CitedProse } from "./ui/uicontext/components/kit/Cite.ts"
const Message = UiSchema.TaggedEnum({ OpenedSource: { id: Schema.String } })// `[n]` markers in the agent's Markdown become chips; a click opens the source in the appexport const Answer = (h: Html.H<typeof Message.Type>, text: string, sources: ReadonlyArray<Citation>) =>	CitedProse(h, text, sources, { onOpen: (id) => Message.OpenedSource({ id }) })

Examples

Chips

A number, a named chip, a link and a deleted source. Each has a full accessible name and shows its source on hover or focus.

  • A numberResponse times halved after the queue split1.
  • A named chipbilling-api
  • A web pageCard rules
  • No longer available4

A summary with its sources

[n] markers become chips; a link opens its record, and a deleted source still says what it was.

Retries have failed since the evening deploy 1, which started building the idempotency key from the cart id 2. Mira rolled back at 10:02 following the old checklist 3; nobody has confirmed retries work again.

API reference

CiteListView function

Options

CiteList options
NameTypeDefaultDescription
citationsrequiredCitation[]—The sources, numbered in the order they come
labelstring"Sources"The list's accessible name; "Sources" by default
onOpen(id: string) => Message—The message to send when a source is opened; without it, sources with a link open it

CiteView function

Options

Cite options
NameTypeDescription
onOpen(id: string) => MessageThe app opens the source itself (a side panel, a row); otherwise the chip follows href
variant"number" | "chip""number" for an inline marker ("1"), "chip" for the label with the source's kind

Accessibility

  • A chip is named for what it points to ("Source 2: Q3 forecast"), not only its number, and shows the quote or title as a tooltip.
  • It's a link when the source has one and a button when the app opens it; a source that's gone is plain text that says so.
  • The list of sources is an ordered list named Sources.

Source