Skip to content
Sign in
KnowledgeCorpus managerMenu

Corpus managerPro

Knowledge collections with access groups, size, document count and how fresh each index is.

ProReindex a stale collection, or change who can search one in its access list.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/corpus-manager

Usage

tsx
import { CorpusManager } from "@/components/ui/chatcn/pro/corpus-manager"

<CorpusManager collections={collections} groups={groups} onReindex={reindex} onAccessChange={save} />

Freshness is a bar that drains over the stale window (7 days unless a collection sets its own) and turns amber with the word Stale once it runs out, so the collections that need a reindex stand out without a column of dates. Reindex runs in place with its percentage. Group monograms show who can search a collection; opening them lists each group with its level, a way to remove it and a menu to add another. A collection with no groups is marked private with a lock.

Examples

States

ProRead only with a private collection open, loading and empty.

Props

PropTypeNotes
collectionsCorpusCollection[]{ id, name, description?, documents, size, indexedAt?, staleAfterDays?, state, progress?, error?, access }
groups{ id, name, members? }[]Groups that can be granted access
onReindex(id) => voidAdds Reindex to each row
onAccessChange(id, access) => voidWithout it access is read only
editing, defaultEditing, onEditingChangestring | nullOpen access editor
loadingbooleanSkeleton rows
now, localenumber, stringRelative times, sizes and numbers
labelsPartial<CorpusManagerLabels>Every string

Keyboard

KeyAction
Enter, SpaceOpen or close a collection's access list
TabMove through levels, remove buttons and the add menu

Accessibility

  • The access toggle is a disclosure button named with the collection, with aria-expanded and aria-controls.
  • Levels use native selects named with the group. Reindex progress is a named progressbar.
  • Stale and failed indexes say so in words, not only in color.

Motion

Only reindex progress moves, as a 300 ms transform on its bar. The access list opens without animation because it is a frequent, keyboard reachable toggle.