diff --git a/studio/frontend/src/features/recipe-studio/dialogs/preview-dialog.tsx b/studio/frontend/src/features/recipe-studio/dialogs/preview-dialog.tsx index 18637b586a..05b2e45874 100644 --- a/studio/frontend/src/features/recipe-studio/dialogs/preview-dialog.tsx +++ b/studio/frontend/src/features/recipe-studio/dialogs/preview-dialog.tsx @@ -254,6 +254,8 @@ export function RunDialog({ }: RunDialogProps): ReactElement { const [advancedOpen, setAdvancedOpen] = useState(false); const kindLabel = kind === "preview" ? "Preview" : "Full run"; + const normalizedFullRunName = fullRunName.trim(); + const isFullRunNameMissing = kind === "full" && normalizedFullRunName.length === 0; const rowHint = kind === "preview" ? "How many sample rows to generate for a quick check." @@ -376,7 +378,13 @@ export function RunDialog({ value={fullRunName} onChange={(event) => onFullRunNameChange(event.target.value)} placeholder="Sprint dataset v2" + aria-invalid={isFullRunNameMissing} /> + {isFullRunNameMissing ? ( +

+ Run name is required before starting a full run. +

+ ) : null} )} @@ -657,7 +665,12 @@ export function RunDialog({ {validateLoading ? "Validating..." : "Validate recipe"} - diff --git a/studio/frontend/src/features/recipe-studio/hooks/use-recipe-executions.ts b/studio/frontend/src/features/recipe-studio/hooks/use-recipe-executions.ts index 6a06473120..a0f6cda8b3 100644 --- a/studio/frontend/src/features/recipe-studio/hooks/use-recipe-executions.ts +++ b/studio/frontend/src/features/recipe-studio/hooks/use-recipe-executions.ts @@ -324,19 +324,26 @@ export function useRecipeExecutions({ rows: number, runName: string | null, ): Promise => { + const trimmedRunName = typeof runName === "string" ? runName.trim() : ""; + if (kind === "full" && !trimmedRunName) { + const message = "Run name required for full runs."; + setRunErrors([message]); + toastError("Run name required", message); + return false; + } + const payload = readExecutablePayload(); if (!payload) { return false; } const normalizedRows = sanitizeExecutionRows(rows, kind); - const normalizedRunName = kind === "full" ? normalizeRunName(runName) : null; const executionPayload = buildExecutionPayload({ payload, kind, rows: normalizedRows, settings: runSettings, - runName: normalizedRunName, + runName, }); try { @@ -361,7 +368,7 @@ export function useRecipeExecutions({ payload, rows: normalizedRows, settings: runSettings, - runName: normalizedRunName, + runName, }); }, [readExecutablePayload, runExecution, runSettings, setRunErrors], diff --git a/studio/frontend/src/features/studio/sections/dataset-section.tsx b/studio/frontend/src/features/studio/sections/dataset-section.tsx index db428d73a0..e522aaca9b 100644 --- a/studio/frontend/src/features/studio/sections/dataset-section.tsx +++ b/studio/frontend/src/features/studio/sections/dataset-section.tsx @@ -604,21 +604,13 @@ export function DatasetSection() { Local dataset metadata

- Data Recipe output. Eval split unavailable for local datasets. + Data Recipe output.

{uploadedFile ? (
-
-

- Path -

-

- {uploadedFile} -

-