Skip to content
Sign in
ConversationCompaction markerMenu

Compaction markerPro

Where a thread was compacted: one quiet line that says how many messages became a summary and how much room it made, with the summary one click away.

ProA three day thread about a payout export compacts: the marker shimmers, then settles with the room it made and the summary one click away.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/compaction-marker

Usage

tsx
import { CompactionMarker } from "@/components/ui/chatcn/pro/compaction-marker"

<CompactionMarker
  status={status}
  messages={48}
  before={182400}
  after={23900}
  limit={200000}
  summary={summary}
/>

A hairline across the conversation with the label at its centre, in the family of the free conversation divider. Compacting, the label shimmers with the number of messages being summarized. Done, it reads Earlier messages summarized, the count, and before to after tokens, with a 40 px meter: the old fill stays as a ghost and the new fill settles to its level once, so the room it made is visible at a glance. History that mounts already summarized shows the new fill at once. The summary opens below with a start rule, like reasoning, and can stream with the caret. onShowOriginals adds a link back to the kept messages. A failure says what to do next, with a retry.

Examples

States

ProSummarizing, summarized, opened, a summary still writing, one message without token counts, and a failure with retry.

Props

PropTypeNotes
status"compacting" | "done" | "error"Default done
messagesnumberHow many messages the summary replaces
before, after, limitnumberTokens. The meter needs all three
summarystring | string[] | ReactNodeStrings render as paragraphs
streamingbooleanThe summary is still being written
open, defaultOpen, onOpenChangeboolean
onRetry, onShowOriginals() => void
labelsPartial<CompactionMarkerLabels>Every string, for translation

Keyboard

KeyAction
Enter or SpaceOpen or close the summary

Accessibility

  • The marker is a button with aria-expanded; the closed summary is inert.
  • Before and after are read as 182k to 24k tokens; the meter is decorative.
  • Failure is announced with role="alert".

Motion

The summary opens in 200 ms on grid rows with a fade. The meter settles in 300 ms on the kit's ease in out, once per compaction. Reduced motion removes both and keeps the shimmer static.