Changed Files Summary

The files an agent's turn changed, as a card with each file's stat and Review.

Edited 6 files

Nothing opened yet.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/change-summary

Usage

import { type ChangedFileStat, ChangeSummary } from "./ui/uicontext/components/kit/ChangeSummary.ts"
const Message = UiSchema.TaggedEnum({ ReviewedTurn: {}, OpenedTurnFile: { path: Schema.String } })// at the end of a turn: Review opens the whole change, a file opens its own diffexport const TurnChanges = (h: Html.H<typeof Message.Type>, turn: string, files: ReadonlyArray<ChangedFileStat>) =>	ChangeSummary(h, {		key: turn,		props: { id: turn, files },		onEmit: { RequestedReview: () => Message.ReviewedTurn(), RequestedOpen: ({ path }) => Message.OpenedTurnFile({ path }) },	})

API reference

Props

ChangeSummary props
NameTypeDefaultDescription
idrequiredstring——
filesrequiredChangedFileStat[]——
limitnumber3Files shown before "+N more"; 3 by default
reviewLabelstring"Review""Review" by default; leave can without "review" for no button
can("review" | "open")[]—"review" shows the button; "open" makes each file a button
agentIdstring——
localestring——

Events

ChangeSummary events
EventPayloadDescription
RequestedReview{ id: string }Review the whole change
RequestedOpen{ id: string; path: string }Open one file's change

Agent actions

What agents can do with ChangeSummary
ActionDescription
ClickedReviewReview the whole change
ClickedFileOpen one file's change, by its path

Accessibility

  • The card is a section named by its heading, "Edited 6 files"; Review and each file are real buttons.
  • +N more is a button with aria-expanded. A new or deleted file says so in words.

Source