Conversation history
A React block (a whole screen) in Beamline's AI workspace app.
Past conversations with an assistant, ready to pick up again: the list by day with bookmarks and unsent drafts, a search through every message that groups hits by conversation and lands on the exact message, a link to a conversation or to one message that reopens it there, the versions of a conversation that branched (an edited question, a regenerated answer) with a switch on each message and a map of the branches, an interrupted answer with Continue, and a composer whose draft stays with its conversation when you open another.
Use it for
- The history page of an AI assistant: find an old answer, reopen it from a link or a bookmark, carry on.
- Any product where people return to long threads and need to land on one message (support transcripts, research).
Not for
- Talking to the assistant now (agent-workspace or support-chat).
- Triaging incoming conversations that wait for a person (inbox-list, support-console).
- Team channels (team-chat).
Anatomy
- list column: title and New chat, search, All or Bookmarked with counts, conversations grouped by day (Today, Yesterday, This week, This month, Earlier) with title, bookmark, model, message count and age; a conversation with an unsent draft shows the draft instead
- search results: how many messages in how many conversations, then per conversation its title and each hit as a snippet with the matched words marked, who said it
- conversation: title, model and age, the matches here (2 of 5, previous and next), the branches (how many; shows or hides the map), Bookmark, Copy link; the turns of the branch on screen, each with its age, Copy link to this message, Ask again under an answer and Edit under your message; a message with versions has its ‹ 2 / 3 ›; an interrupted answer says so with Continue
- map of branches: the branch on screen on the accent rail, the other versions branching off it with how many turns they hold; beside the conversation from 47.5rem, a sheet below that
- composer: continue the conversation; the draft is kept per conversation
Variants
- 0: room: list and conversation side by side from 48rem; below that one at a time with a way back
States
- loading the list; loading one conversation (opened from a cold link)
- nothing open (pick up where you left off)
- landed on a message (it is centred and a tint fades from it once)
- search with hits; search with no hits
- no bookmarks yet; no conversations yet
- a link to a conversation that is gone (deleted or not shared)
- an answer that stopped before it finished (Continue)
- a conversation that branched: the newest branch on screen unless a link, a hit or your choice names another
- a link or a search hit on another branch: that branch opens and the message is landed on
- asking again (Writing another answer), then the new version shows; editing a message (Cancel, Send edit), then the new version and its answer show
- a draft kept in another conversation
- A pending send accepts one submission; its acknowledgement clears only that unchanged draft and preserves newer drafts in every conversation.
Keyboard
- Tab: New chat, search, All or Bookmarked, the conversations or the hits, then the conversation's actions and composer
- Enter on a row or a hit opens it and lands on its message
- Enter sends, Shift+Enter breaks the line
- A message's versions: ← → while its switch has focus
- The map: one tab stop, ↑ ↓ between rows, Enter opens a branch or lands on a turn
- Editing a message: Enter sends the edit, Escape cancels
Motion
The open conversation's plate travels between rows; a message landed on by a link or a hit is lit and fades over a second and a half (held, not animated, under reduced motion); hits rise in as they appear. Switching a version keeps that message where it was and brings it and what follows in from the side asked for (a later version from the end); the map's rows slide to their new places and a version crossing onto the path travels across its rails. Reduced motion: no travel, a fade. Nothing moves at rest.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
threads (required) | HistoryThread[] | — | { id, title, updatedAt, messages: HistoryMessage[] | null (null while loading), count?, bookmarked?, model? }; a message may name the one it follows (parentId) and why it is a version (origin: edit | regenerate) |
target / defaultTarget / onTargetChange | { threadId, messageId? } | null | — | The open conversation and the message to land on; put it in the address to make links work. |
results | HistoryMatch[] | null | — | Your server's hits for the query; without it the screen searches the messages it was given. |
drafts / defaultDrafts / onDraftsChange | Record<string, string> | — | Unsent words per conversation. |
onSend | (threadId, text, parentId?) => void | Promise<unknown> | — | A new message after `parentId`, the newest message of the branch on screen. |
onRegenerate | (threadId, messageId) => void | Promise<unknown> | — | Ask for another answer in this one's place: a new version beside it. |
onEdit | (threadId, messageId, text) => void | Promise<unknown> | — | Send an edited version of a person's message: the conversation branches there. |
tips / defaultTips / onTipsChange | Record<string, string> | — | The branch on screen per conversation, named by its newest message; default the most recent branch. |
onBookmark | (threadId, bookmarked) => void | — | |
onResume | (threadId, messageId) => void | — | Continue an answer that was interrupted. |
onNewChat | () => void | — | |
linkFor | (target) => string | — | The address of a conversation or of one message in it, for Copy link. |
loading | boolean | — | |
title | string | "History" | |
className / classNames / style / ref | string / ConversationHistoryClassNames / CSSProperties / Ref<HTMLElement> | — | className: Classes on the documented visual root; no override by default. classNames: Classes for the named visual parts; no overrides by default. style: Inline styles on the documented visual root; no overrides by default. ref: Receives the documented native target or imperative handle; omitted by default. |
target | HistoryTarget | null | — | The open conversation and the message to land on. |
defaultTarget | HistoryTarget | null | — | |
onTargetChange | ((target: HistoryTarget | null) => void) | — | |
query | string | — | |
defaultQuery | string | — | |
onQueryChange | ((query: string) => void) | — | |
drafts | Record<string, string> | — | Unsent words per conversation; they stay when you open another one. |
defaultDrafts | Record<string, string> | — | |
onDraftsChange | ((drafts: Record<string, string>) => void) | — | |
tips | Record<string, string> | — | The branch on screen per conversation, as its newest message; default the most recent branch. A link or a hit that lands in another branch switches to it, and a message that arrives shows its branch. |
defaultTips | Record<string, string> | — | |
onTipsChange | ((tips: Record<string, string>) => void) | — | |
className | string | — | Classes on the documented visual root; no override by default. |
classNames | Partial<Record<"root" | "results" | "list" | "row" | "message" | "composer" | "thread",… | — | Classes for the named visual parts; no overrides by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no overrides by default. |
ref | Ref<HTMLElement> | — | Receives the documented native target or imperative handle; omitted by default. |
manual | boolean | — | Server owns ordering, filters, search and page slicing. Default false. |
sort | ListSort | — | |
defaultSort | ListSort | — | |
onSortChange | ((sort: ListSort) => void) | — | |
filters | ListFilters | — | |
defaultFilters | ListFilters | — | |
onFiltersChange | ((filters: ListFilters) => void) | — | |
selected | string[] | — | Stable row IDs, retained across server pages. |
defaultSelected | string[] | — | |
onSelectedChange | ((ids: string[]) => void) | — | |
selectable | boolean | — | |
error | ReactNode | Error | — | Errors retain the last completed rows. Error objects are rendered by their message. |
onRetry | (() => void | Promise<unknown>) | — | |
emptyLabel | string | — | |
allowSelectAllMatching | boolean | — | |
onSelectAllMatching | ((scope: { rowCount: number; query: string; filters: ListFilters; }) => void) | — | |
pagination | boolean | — | Enable page controls explicitly. Page-related props also enable them, unless onEndReached is supplied. |
page | number | — | One-based requested page. Default 1. |
defaultPage | number | — | |
onPageChange | ((page: number) => void) | — | |
pageSize | number | — | Positive rows per page. Default 25. |
defaultPageSize | number | — | |
onPageSizeChange | ((pageSize: number) => void) | — | |
rowCount | number | null | — | Total matching rows on the server. null means unknown. Local grids calculate it before slicing. |
total | number | null | — | Deprecated: Use rowCount. Canonical rowCount wins, including null. |
onEndReached | (() => void | Promise<unknown>) | — | Append mode: fetch another batch. The app appends it to the supplied rows. |
hasMore | boolean | — | Whether another batch exists; defaults to true with onEndReached. False stops requests. |
loadingMore | boolean | — | An append request is pending; retain every loaded row. |
Built from
- search-field
- chip-group
- branch-navigator
- message
- response
- copy-button
- textarea
- button
- empty-state
- skeleton
- sheet
Dependencies
lucide-react
Import
import { ConversationHistory } from "@beamline/conversation-history";
Get it
Conversation history is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in AI workspace
- AI agent workspace: Threads, a conversation that opens on the thread's earlier turns (each with its trace, the tools the agent called, a cited answer and any table it…
- Agent runs monitor: Every run of your agents in one place: success rate, run time, tokens and spend; the last runs as a strip of status blocks; a live table where running…
- Agent monitor: Agents in production and on test. Monitor shows every agent or one over 24 hours, 7 or 14 days: runs, tokens, estimated cost and average run time counted…
- Knowledge base manager: What your assistant knows and whether it is fresh: sources with live sync status (syncing with progress, out of date, failed with the reason and Retry)…
- Reading library: A read-it-later library: saved views that are live filters (a query with every unreadable part named, the number that matches now, saved with a name; a…
- Artifact workbench: Where the things an assistant makes are checked before they leave: every document, piece of code, small app and data result from a conversation, each…
- AI image studio: Write a prompt, pick a shape, a style and how many, and watch the variations generate side by side; each one opens full screen and can be upscaled or…
- Voice agent: A voice agent in three layouts on one session: a workspace with the agent's orb large on a stage (the line being said shows under it, questions to ask…
- Model playground: Try one prompt on up to three models side by side: pick each model with its price and speed in view, set the system prompt, temperature and length once…
- Model inspector: A design model's objects without needing the 3D view: the model tree, where objects with the same name are told apart by id and path; the selected…
- Model issues: Issues pinned to the objects of a design model. The queue says the scope beside every count (open in the project, on the loaded models, on this version)…
- Agent builder: An agent's configuration beside an assistant that proposes tools. Ask for what the agent should do and the assistant's proposal lists each tool with why…
- Workflow composer: A workflow drafted from a sentence and finished by hand. The prompt drafts steps that arrive one by one on the graph (a draft cut short keeps what came…
- Data binding: Bind an object's properties to a view model. Each property says whether it is bound, incomplete or mismatched. A binding takes its source from the…