MessageListProps

Unpublished development API. This package is under development and is not available as a published release.

Supplies projected transcript rows and an optional stable custom renderer to a scrolling list with memoized rows.

import type { MessageListProps } from '@threadplane/react/chat';

Declaration

export interface MessageListProps<TRow extends MessageRow = MessageRow>  {
  readonly children?: ReactNode;
  readonly className?: string;
  readonly groupRelatedTools?: boolean;
  readonly label?: string;
  readonly onToolRetry?: (activity: ToolActivityInfo) => void;
  readonly renderMessage?: (row: NoInfer<RenderRow<TRow>>, context: MessageListRowContext) => ReactNode;
  readonly renderScrollControl?: (controls: MessageListScrollControls) => ReactNode;
  readonly renderToolResult?: (activity: ToolActivityInfo) => ReactNode;
  readonly rows: readonly TRow[];
  readonly toolLabel?: (name: string) => string | undefined;
  readonly toolOutcome?: (activity: ToolActivityInfo) => ToolActivityOutcome | undefined;
}

Type parameters

TRow
MessageRow Default: MessageRow

Members

children

Application-owned content after the rows, such as a pending approval, in the same scrollable transcript.

readonly children?: ReactNode;

className

readonly className?: string;

groupRelatedTools

Group built-in tool activity by default. False renders separate tools; custom renderers keep full ownership.

readonly groupRelatedTools?: boolean;

label

readonly label?: string;

onToolRetry

Application-owned handler for a retry declared by toolOutcome on a failed call. The control is offered only while nothing is running and no later call repeats the same tool and arguments. Without it no retry control renders. Keep stable.

readonly onToolRetry?: (activity: ToolActivityInfo) => void;

renderMessage

Replace the default row rendering. Must be referentially stable (define it outside the component or wrap it in useCallback); a new function each render defeats row memoization and re-renders every row.

readonly renderMessage?: (row: NoInfer<RenderRow<TRow>>, context: MessageListRowContext) => ReactNode;

renderScrollControl

Render a sibling control; attach actions to explicit event handlers.

readonly renderScrollControl?: (controls: MessageListScrollControls) => ReactNode;

renderToolResult

App-owned rich result or action for one tool call, rendered outside technical Details. Keep stable like renderMessage; custom renderMessage retains full ownership.

readonly renderToolResult?: (activity: ToolActivityInfo) => ReactNode;

rows

readonly rows: readonly TRow[];

toolLabel

App-authored human labels; keep this function stable like renderMessage.

readonly toolLabel?: (name: string) => string | undefined;

toolOutcome

App-authored confirmed result previews, or status: 'failed' to show a completed call as failed. Keep stable; custom renderMessage retains full ownership.

readonly toolOutcome?: (activity: ToolActivityInfo) => ToolActivityOutcome | undefined;