Skip to content
Sign in
ConversationRetry with modelMenu

Retry with modelPro

The retry action with a choice: a new seed from the same model, or another model. Every version is kept and labelled with the model that wrote it.

ProA changelog line retried with a new seed or another model. Every version is kept, labelled with the model that wrote it.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/retry-with-model

Usage

tsx
import { ResponseVersions, RetryWithModel, useResponseVersions } from "@/components/ui/chatcn/pro/retry-with-model"

const v = useResponseVersions([{ id: "v1", model: "Claude Sonnet 5.5", value: text }])

<MessageActions>
  <MessageActionCopy value={text} />
  <RetryWithModel models={models} current="claude-sonnet-5-5" onRetry={regenerate} />
</MessageActions>
<ResponseVersions versions={v.versions} index={v.index} onIndexChange={v.setIndex} />

RetryWithModel sits in MessageActions at the toolbar's size and tone and opens a menu: Same model, new seed first, naming the model on screen so a retry never switches models by surprise, then every model with a short note and a check on the current one. onRetry receives the model and whether it was a seed or a model change. ResponseVersions is the free BranchNavigator plus a quiet label for the version on screen: the model, new seed when it was one, and a shimmering Writing with while it generates. The label changes in place, so switching never moves the toolbar. useResponseVersions keeps the list: add appends a pending version and shows it, settle fills it in, fail drops it and goes back.

Examples

States

ProOne version, three versions with a new seed, writing with another model, and disabled while another reply runs.

Props

PropTypeNotes
modelsRetryModel[]{ id, name, note?, disabled? }
currentstringId of the model behind the version on screen
onRetry({ model, mode: "seed" | "model" }) => void
disabledbooleanAlso off while the message streams
align"start" | "center" | "end"Menu alignment. Default start
labelsPartial<RetryWithModelLabels>Every string, for translation
ResponseVersions.versionsResponseVersion[]{ id, model, seed?, pending? }
ResponseVersions.index, onIndexChangenumber0 based

Keyboard

KeyAction
Enter or SpaceOpen the retry menu
Up and DownMove through the menu
Left and Right on the switcherPrevious and next version

Accessibility

  • The trigger is named Retry response; the current model is read as Current in the menu.
  • The switcher is a group named Version 2 of 3; the model label is a polite live region.

Motion

The menu grows from its trigger in 180 ms and opens without animation from the keyboard. The version label swaps with the kit's 150 ms swap (fade, slight scale, 2 px blur), opacity only under reduced motion.