Skip to content

ThreadPicker

A dropdown to switch between, create, and delete conversation threads. The list is (re)fetched whenever the menu opens, so newly-persisted threads appear without a manual refresh.

Source

import { ThreadPicker } from "@flanksource/clicky-ui/ai";

No dedicated Storybook demo is available for this component yet.

The props table documents the component-specific surface. Standard DOM attributes inherited from React, such as className, event handlers, and accessibility attributes, may also be accepted when the component’s prop type extends a native element.

Prop Type Default Description
api string /api/chat/sessions Base endpoint for session CRUD. GET lists, `${api}/${id}` DELETE removes and PATCH renames. Defaults to Captain's "/api/chat/sessions". Ignored when `source` is set.
className string — —
onNew* (…) => void — —
onSelect* (…) => void — —
query string — Optional query string appended to the list request (e.g. a scope id).
refreshToken number — Changing this refetches the list, so a title the backend derived during a turn appears without reopening the menu.
source ThreadSource — Inject the thread list/delete/rename directly instead of fetching `api`.
threadId* string | null — Currently selected thread, or null for an unsaved/new conversation.