Stage Action Buttons
v0.2.4Re-run and Reset controls for a semantics pipeline stage, with a model-picker confirmation dialog. All API calls and navigation are handled by the parent via the onAction callback.
Preview
Install & usage
npx shadcn@latest add @signalos/stage-actionsPulls the page source plus its widget dependencies (@signalos/tokens, @signalos/utils, @signalos/button, @signalos/tooltip, @signalos/select, @signalos/label, @signalos/form-dialog) into your app - you own the copy. Requires access.
usage
// after: npx shadcn@latest add @signalos/stage-actions
// mount the pulled page in a route, e.g. src/app/semantics-details/page.tsx
import { StageActionButtons } from "@/components/blocks/stage-actions/StageActionButtons"
export default function Page() {
return <StageActionButtons />
}Props
LlmModelOption
| Prop | Type | Default | Description |
|---|---|---|---|
| id* | string | - | Unique model id / slug passed to the API. |
| label* | string | - | Human-readable label shown in the select. |
OrchestrationModel
| Prop | Type | Default | Description |
|---|---|---|---|
| canonical* | string | - | |
| label* | string | - | |
| display | string | null | undefined | - | |
| family* | ModelProviderFamily | - | |
| family_display* | string | - | |
| lifecycle_warning | string | null | undefined | - | |
| retire_after | string | null | undefined | - | |
| resolved | string | undefined | - |
StageActionPayload
| Prop | Type | Default | Description |
|---|---|---|---|
| action* | StageAction | - | The action the user selected. |
| model | string | undefined | - | Reasoning model id — omitted when the user leaves it at the pipeline default. |
| supporting_model | string | undefined | - | Supporting model id — omitted when the user leaves it at the pipeline default. |
StageActionButtonsProps
| Prop | Type | Default | Description |
|---|---|---|---|
| stageLabel* | string | - | Friendly stage label shown in the dialog description, e.g. "Extraction". Required — the parent owns all domain label mapping. |
| connectorName | string | undefined | - | Friendly connector / source name shown for per-connector stages. Omit for shared (cross-source) stages. |
| models | OrchestrationModel[] | undefined | - | Available LLM models to populate the model pickers. |
| isLoadingModels | boolean | undefined | - | True while the model list is being fetched. |
| isConfirmed | boolean | undefined | - | When true, the Reset button is rendered (only for already-confirmed stages). |
| isSubmitting | boolean | undefined | - | True while an action is being submitted — disables both buttons. |
| onAction* | (payload: StageActionPayload) => void | - | Called when the user confirms an action. The parent is responsible for calling the API, showing a toast, closing the dialog, and navigating. |
| className | string | undefined | - | |
| data-testid | string | undefined | - | Test identifier rendered as `data-testid` on the root element. |
| onCreateModel | (() => void) | undefined | - |
StageActionDialogProps
| Prop | Type | Default | Description |
|---|---|---|---|
| action* | StageAction | - | Which action this dialog runs — drives copy, button style, and payload. |
| stageLabel* | string | - | Friendly stage label shown in the dialog description. |
| connectorName | string | undefined | - | Friendly connector name shown in the reset description. Omit for shared stages. |
| models | OrchestrationModel[] | undefined | - | Available LLM models to pick from. |
| isLoadingModels | boolean | undefined | - | True while the model list is being fetched. |
| isSubmitting | boolean | undefined | - | True while the action is being submitted. |
| open* | boolean | false | |
| onOpenChange* | (open: boolean) => void | - | |
| onConfirm* | (payload: StageActionPayload) => void | - | Called when the user confirms. The parent is responsible for calling the API, showing a toast, closing the dialog, and navigating. |
| data-testid | string | undefined | - | Test identifier rendered as `data-testid` on the root dialog element. |
| onCreateModel | (() => void) | undefined | - |
Supporting types
export type StageAction = "rerun" | "reset_to_stage"
export type ModelProviderFamily = | "anthropic" | "amazon" | "meta" | "mistral" | "deepseek" | "openai" | "google" | "cohere" | "xai" | "moonshot" | "unknown"
More Semantics Stages variants
Changelog
0.2.4
- Fix cross-item imports to use canonical @/components paths; add missing signalos.category to manifests.
0.2.3
StageActionButtons.types.ts: allownullforOrchestrationModel.displayfield (wasstring | undefined, nowstring | null | undefined).StageActionButtons.types.ts: remove stale JSDoc module comment.
0.2.2
- Add
onCreateModelcallback prop toStageActionButtonsPropsand thread it through toStageActionDialogto support inline model creation.
0.2.0
- Move
StageActionDialogintocomponents/StageActionDialog.tsx(decomposition ladder stage 3). - Extract all types into
StageActionButtons.types.ts—StageAction,LlmModelOption,StageActionPayload,StageActionButtonsProps,StageActionDialogProps. - Extract string constants into
StageActionButtons.constants.ts—TEST_IDS,PIPELINE_DEFAULT_VALUE,PIPELINE_DEFAULT_LABEL,MODELS_LOADING_PLACEHOLDER. - Add
StageActionButtons.test.tsxwith full coverage: default render, isConfirmed toggle, isSubmitting disable, dialog open/close, onAction payload, cancel without firing. - Add
StageActionButtons.preview.tsxwith four catalog scenarios.
0.1.0
- Initial release:
StageActionButtonsandStageActionDialogextracted from the app and rewritten as registry-compliant components. - All store access, API calls, navigation, and toast logic removed — parent owns these via the
onActioncallback. StageActionDialognow usesFormDialoginstead of a rawDialog.- Model pickers receive
modelsandisLoadingModelsprops instead of reading from the Redux store. - Semantic tokens used throughout (
text-text-errorinstead of rawtext-error-600).