Ask Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Search or ask anythingAsk Rift AI
Theme: Smoke
Layout: Contained
Background: Field
Colour mode: System

Thread history

A chat's threads, in any rail

Thread history is the list of a chat's threads: labelled groups of rows, each a title with its status, meta and menu. Thread panel seats it in its own rail, and an App sidebar section seats it through its content, so a chat built on the app rail draws exactly the same rows. It is fully controlled and renders on the server when its rows are links.

Groups and rows

Each group takes a label, and a row press reports its thread. With collapsibleSections a group folds under its heading, and moreLabel adds a quiet row that reveals older threads.

Detail rows

A row scales from a bare title to the full anatomy: a status dot leading the title, a description line, a trailing glyph, the pin mark and the meta caption. Once one thread carries a status every row draws a dot, so the titles share an edge, and each state but idle is read aloud after the title.

Menus and rename

threadActions hangs an overflow menu on every row, shown on hover or focus and always on a touch screen. renamingThreadId swaps a row to an inline field, where Enter commits and Escape cancels. Try renaming or deleting a thread from its menu.

In an app sidebar

A section's content seats the history inside App sidebar, after New chat and the projects, so the rail keeps the app shell's sizes, side panel and phone drawer. Collapsed, the rail has no room for the history and folds it away.

Alternatives

  • Use Thread panel instead when the history is the whole rail, with its brand, new-thread row, projects and profile footer.

Props

Read from the same JSDoc that ships in the package's types. A required prop is marked with an asterisk.

ThreadHistory props
PropTypeDefaultDescription
groups*
ThreadPanelGroup[]
The history, in display order. A flat list is one group with no label. Each thread takes ThreadPanel's thread shape.
activeThreadId
string
Id of the thread on stage. Its row renders filled and carries `aria-current`.
onThreadSelect
((id: string) => void)
Fires with the clicked thread's id. Rows with an `href` navigate as well.
threadActions
ThreadPanelThreadAction[]
Shared menu actions for every thread row, behind a hover-revealed trailing trigger (always shown on a touch screen); a thread's own `actions` overrides the set. The menu renders only when `onThreadAction` is also given, and never on a `pending` row.
onThreadAction
((threadId: string, actionId: string) => void)
Fires with the thread's id and the chosen action's id.
statusLabels
Partial<Record<ThreadPanelThreadStatus, string>>
Spoken text for each thread status, read after the row's title; the dot itself is decorative. Merged over the English defaults (Working, Unread, Needs input, Failed). `idle` is silent unless given a label here.
pinnedLabel
string
'Pinned'
Spoken text for a `pinned` thread, read after the title and any status; the pin glyph itself is decorative.
threadMenuLabel
string | ((title: string) => string)
'Thread options'
Accessible name for a row's menu trigger. A string is followed by a colon and the thread's title ("Thread options: Q3 plan"); a function is given the title and returns the whole name, so a translation can put the title where its grammar needs it.
renamingThreadId
string
Id of the thread being renamed: its row swaps to an inline text field, prefilled with the title and selected. The host owns the state.
onThreadRename
((threadId: string, title: string) => void)
Fires with the thread's id and the trimmed new title when a rename commits (Enter, or focus leaving the field). An empty or unchanged value fires `onRenameCancel` instead.
onRenameCancel
(() => void)
Fires when a rename ends without a change: Escape, an empty value, or an unchanged title.
renameLabel
string
'Rename thread'
Accessible name for the inline rename field.
moreLabel
string
Text for the quiet trailing row that reveals older threads, e.g. "Show 20 more". Renders only when given.
onShowMore
(() => void)
Fires when the more row is clicked.
collapsibleSections
boolean
false
Let the reader fold each labelled group under its heading: the heading becomes a toggle with a chevron, and the rows glide shut beneath it.
collapsedSections
string[]
[]
The folded groups, by each group's `id` (its `label` when it has none). Controlled: pair it with `onCollapsedSectionsChange`. Needs `collapsibleSections`.
onCollapsedSectionsChange
((collapsedSections: string[]) => void)
Fires with the full new list of folded groups when a heading is pressed.
className
string
''
Additional CSS classes
linkComponent
LinkComponent
The component its links render with, such as Next.js's `Link`, so they navigate through the app's router; a plain `<a>` when unset. This component can render on the server, so it never reads a LinkProvider: pass the prop even under one.

Keys

Its threads are a list of buttons; the rename field commits on Enter and cancels on Escape. The component’s own stories test these keys.

tsx
// From the npm package
import { ThreadHistory } from 'rift-ds/components/ThreadHistory/ThreadHistory';

// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/thread-history.json

10.9 kB gzipped, with everything it imports. Peer dependencies are not counted.

For agents: the props, their allowed values and defaults, and the tested keys, as markdown or as a JSON schema.