Agents
Chat History
The sidebar list of past threads, grouped under Pinned, Today, Yesterday and Earlier, with search, a new-chat button and a quiet per-row menu to rename, pin or delete.
Group: Agents. Exports: ChatHistory. Halaska addition with no shadcn/ui equivalent.
Usage
import { ChatHistory } from "./halaska-kit";
ChatHistory props
threads{ id: string, title: string, preview?: string, time: string | Date, pinned?: boolean, unread?: boolean }[](default CHATHIST_THREADS): Threads to list; `time` is an ISO string or a Date (default: CHATHIST_THREADS)activeIdstring: Controlled selection; leave undefined and the list keeps its ownonSelect(id: string) => void: Fires when a row is pickedonNew() => void: Shows the new-thread button in the header and fires when it is pressedonRename(id: string, title: string) => void: Enables Rename in the row menu; the new name is typed inlineonDelete(id: string) => void: Enables Delete in the row menuonPin(id: string) => void: Enables Pin / Unpin in the row menusearchboolean(default true): Shows a search field that filters titles and previews (default: true)groupBy"day" | "none"(default "day"): Group rows under Pinned, Today, Yesterday and Earlier headings, or list them flat (default: "day")titlestring(default "Chats"): Header label (default: "Chats")widthnumber(default 280): Width of the list in px (default: 280)heightnumber(default 420): Height of the list in px; content scrolls inside it (default: 420)
Accessibility
- Rows are buttons inside a named list; the open thread carries aria-current and arrow keys move between rows.
- The row menu is a labelled button that appears on hover and focus, opens a menu that takes arrow keys, closes on Escape and returns focus.
- Rename is a real text field: Enter saves, Escape cancels, leaving the field saves.
- Unread threads carry visually hidden Unread text beside the dot, and the pin is a named image.
Known gaps
- No drag to reorder and no folders.
- Times are formatted in the browser's locale-free short form, not with Intl.
Halaska UI · Components · Patterns · Screens · Install