Corpus managerPro
Knowledge collections with access groups, size, document count and how fresh each index is.
On this page
ProReindex a stale collection, or change who can search one in its access list.
Installation
Usage
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
| Prop | Type | Notes |
|---|---|---|
collections | CorpusCollection[] | { id, name, description?, documents, size, indexedAt?, staleAfterDays?, state, progress?, error?, access } |
groups | { id, name, members? }[] | Groups that can be granted access |
onReindex | (id) => void | Adds Reindex to each row |
onAccessChange | (id, access) => void | Without it access is read only |
editing, defaultEditing, onEditingChange | string | null | Open access editor |
loading | boolean | Skeleton rows |
now, locale | number, string | Relative times, sizes and numbers |
labels | Partial<CorpusManagerLabels> | Every string |
Keyboard
| Key | Action |
|---|---|
| Enter, Space | Open or close a collection's access list |
| Tab | Move through levels, remove buttons and the add menu |
Accessibility
- The access toggle is a disclosure button named with the collection, with
aria-expandedandaria-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.