Stage Action Buttons

v0.2.4

Re-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.

View as Markdown

Preview

Open full page ↗

Install & usage

npx shadcn@latest add @signalos/stage-actions

Pulls 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

PropTypeDefaultDescription
id*string-Unique model id / slug passed to the API.
label*string-Human-readable label shown in the select.

OrchestrationModel

PropTypeDefaultDescription
canonical*string-
label*string-
displaystring | null | undefined-
family*ModelProviderFamily-
family_display*string-
lifecycle_warningstring | null | undefined-
retire_afterstring | null | undefined-
resolvedstring | undefined-

StageActionPayload

PropTypeDefaultDescription
action*StageAction-The action the user selected.
modelstring | undefined-Reasoning model id — omitted when the user leaves it at the pipeline default.
supporting_modelstring | undefined-Supporting model id — omitted when the user leaves it at the pipeline default.

StageActionButtonsProps

PropTypeDefaultDescription
stageLabel*string-Friendly stage label shown in the dialog description, e.g. "Extraction". Required — the parent owns all domain label mapping.
connectorNamestring | undefined-Friendly connector / source name shown for per-connector stages. Omit for shared (cross-source) stages.
modelsOrchestrationModel[] | undefined-Available LLM models to populate the model pickers.
isLoadingModelsboolean | undefined-True while the model list is being fetched.
isConfirmedboolean | undefined-When true, the Reset button is rendered (only for already-confirmed stages).
isSubmittingboolean | 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.
classNamestring | undefined-
data-testidstring | undefined-Test identifier rendered as `data-testid` on the root element.
onCreateModel(() => void) | undefined-

StageActionDialogProps

PropTypeDefaultDescription
action*StageAction-Which action this dialog runs — drives copy, button style, and payload.
stageLabel*string-Friendly stage label shown in the dialog description.
connectorNamestring | undefined-Friendly connector name shown in the reset description. Omit for shared stages.
modelsOrchestrationModel[] | undefined-Available LLM models to pick from.
isLoadingModelsboolean | undefined-True while the model list is being fetched.
isSubmittingboolean | undefined-True while the action is being submitted.
open*booleanfalse
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-testidstring | 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: allow null for OrchestrationModel.display field (was string | undefined, now string | null | undefined).
  • StageActionButtons.types.ts: remove stale JSDoc module comment.

0.2.2

  • Add onCreateModel callback prop to StageActionButtonsProps and thread it through to StageActionDialog to support inline model creation.

0.2.0

  • Move StageActionDialog into components/StageActionDialog.tsx (decomposition ladder stage 3).
  • Extract all types into StageActionButtons.types.tsStageAction, LlmModelOption, StageActionPayload, StageActionButtonsProps, StageActionDialogProps.
  • Extract string constants into StageActionButtons.constants.tsTEST_IDS, PIPELINE_DEFAULT_VALUE, PIPELINE_DEFAULT_LABEL, MODELS_LOADING_PLACEHOLDER.
  • Add StageActionButtons.test.tsx with full coverage: default render, isConfirmed toggle, isSubmitting disable, dialog open/close, onAction payload, cancel without firing.
  • Add StageActionButtons.preview.tsx with four catalog scenarios.

0.1.0

  • Initial release: StageActionButtons and StageActionDialog extracted from the app and rewritten as registry-compliant components.
  • All store access, API calls, navigation, and toast logic removed — parent owns these via the onAction callback.
  • StageActionDialog now uses FormDialog instead of a raw Dialog.
  • Model pickers receive models and isLoadingModels props instead of reading from the Redux store.
  • Semantic tokens used throughout (text-text-error instead of raw text-error-600).