diff --git a/studio/frontend/src/features/recipe-studio/blocks/definitions.ts b/studio/frontend/src/features/recipe-studio/blocks/definitions.ts index 889061c931..d91f5d6991 100644 --- a/studio/frontend/src/features/recipe-studio/blocks/definitions.ts +++ b/studio/frontend/src/features/recipe-studio/blocks/definitions.ts @@ -73,13 +73,13 @@ export const BLOCK_GROUPS: BlockGroup[] = [ { kind: "sampler", title: "Samplers", - description: "Numeric + categorical blocks.", + description: "Fast deterministic columns from distributions and categories.", icon: DiceFaces03Icon, }, { kind: "seed", title: "Seed", - description: "Columns from a seed dataset.", + description: "Bootstrap generation from an existing dataset.", icon: Plant01Icon, }, { @@ -91,7 +91,7 @@ export const BLOCK_GROUPS: BlockGroup[] = [ { kind: "expression", title: "Expression", - description: "Derived columns with Jinja.", + description: "Derive columns with Jinja templates.", icon: FunctionIcon, }, ]; @@ -101,7 +101,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "seed", type: "seed", title: "Seed (Hugging Face)", - description: "Configure a HF seed dataset.", + description: "Load real rows from HF and use them as generation context.", icon: Plant01Icon, dialogKey: "seed", createConfig: (id, existing) => makeSeedConfig(id, existing), @@ -110,7 +110,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "sampler", type: "category", title: "Category", - description: "Pick from a list of values.", + description: "Define categorical values with optional weights and conditions.", icon: Tag01Icon, dialogKey: "category", createConfig: (id, existing) => makeSamplerConfig(id, "category", existing), @@ -119,7 +119,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "sampler", type: "subcategory", title: "Subcategory", - description: "Map sub-values to a category.", + description: "Define hierarchical values mapped to a parent category.", icon: TagsIcon, dialogKey: "subcategory", createConfig: (id, existing) => makeSamplerConfig(id, "subcategory", existing), @@ -128,7 +128,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "sampler", type: "uniform", title: "Uniform", - description: "Random number between low/high.", + description: "Sample evenly between low and high.", icon: EqualSignIcon, dialogKey: "uniform", createConfig: (id, existing) => makeSamplerConfig(id, "uniform", existing), @@ -137,7 +137,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "sampler", type: "gaussian", title: "Gaussian", - description: "Normal distribution sampler.", + description: "Sample from a normal distribution (mean/stddev).", icon: Parabola02Icon, dialogKey: "gaussian", createConfig: (id, existing) => makeSamplerConfig(id, "gaussian", existing), @@ -146,7 +146,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "sampler", type: "bernoulli", title: "Bernoulli", - description: "Binary sampler with probability.", + description: "Sample binary outcomes from probability p.", icon: EqualSignIcon, dialogKey: "bernoulli", createConfig: (id, existing) => makeSamplerConfig(id, "bernoulli", existing), @@ -155,7 +155,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "sampler", type: "datetime", title: "Datetime", - description: "Date/time range sampler.", + description: "Sample timestamps within a start/end range.", icon: Clock01Icon, dialogKey: "datetime", createConfig: (id, existing) => makeSamplerConfig(id, "datetime", existing), @@ -164,7 +164,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "sampler", type: "timedelta", title: "Timedelta", - description: "Offset from datetime column.", + description: "Sample time offsets from a reference datetime column.", icon: Clock01Icon, dialogKey: "timedelta", createConfig: (id, existing) => makeSamplerConfig(id, "timedelta", existing), @@ -173,7 +173,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "sampler", type: "uuid", title: "UUID", - description: "UUID string sampler.", + description: "Generate unique identifiers with optional formatting.", icon: FingerPrintIcon, dialogKey: "uuid", createConfig: (id, existing) => makeSamplerConfig(id, "uuid", existing), @@ -182,7 +182,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "sampler", type: "person", title: "Person", - description: "Faker person sampler.", + description: "Generate realistic synthetic people with faker attributes.", icon: UserAccountIcon, dialogKey: "person", createConfig: (id, existing) => makeSamplerConfig(id, "person", existing), @@ -191,7 +191,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "llm", type: "text", title: "LLM Text", - description: "Free-form prompt generation.", + description: "Generate natural language text from prompt templates.", icon: PencilEdit02Icon, dialogKey: "llm", createConfig: (id, existing) => makeLlmConfig(id, "text", existing), @@ -200,7 +200,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "llm", type: "structured", title: "LLM Structured", - description: "JSON output via schema.", + description: "Generate JSON constrained to a schema.", icon: CodeIcon, dialogKey: "llm", createConfig: (id, existing) => makeLlmConfig(id, "structured", existing), @@ -209,7 +209,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "llm", type: "code", title: "LLM Code", - description: "Generate code or SQL.", + description: "Generate code in a chosen language with clean extraction.", icon: CodeSimpleIcon, dialogKey: "llm", createConfig: (id, existing) => makeLlmConfig(id, "code", existing), @@ -218,7 +218,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "llm", type: "judge", title: "LLM Judge", - description: "Score outputs with criteria.", + description: "Score generated outputs with rubric-based criteria.", icon: BalanceScaleIcon, dialogKey: "llm", createConfig: (id, existing) => makeLlmConfig(id, "judge", existing), @@ -227,7 +227,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "llm", type: "model_provider", title: "Model Provider", - description: "Endpoint, auth, and provider settings.", + description: "Define endpoint and auth settings for model access.", icon: Shield02Icon, dialogKey: "model_provider", createConfig: (id, existing) => makeModelProviderConfig(id, existing), @@ -236,7 +236,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "llm", type: "model_config", title: "Model Config", - description: "Alias, model, provider, and inference params.", + description: "Bind alias to model, provider, and inference settings.", icon: Plant01Icon, dialogKey: "model_config", createConfig: (id, existing) => makeModelConfig(id, existing), @@ -245,7 +245,7 @@ const BLOCK_DEFINITIONS: BlockDefinition[] = [ kind: "expression", type: "expression", title: "Expression", - description: "Transform columns with Jinja.", + description: "Transform/combine columns using Jinja expressions.", icon: FunctionIcon, dialogKey: "expression", createConfig: (id, existing) => makeExpressionConfig(id, existing), diff --git a/studio/frontend/src/features/recipe-studio/components/block-sheet.tsx b/studio/frontend/src/features/recipe-studio/components/block-sheet.tsx index abb4112444..66ecb678d8 100644 --- a/studio/frontend/src/features/recipe-studio/components/block-sheet.tsx +++ b/studio/frontend/src/features/recipe-studio/components/block-sheet.tsx @@ -253,6 +253,7 @@ export function BlockSheet({ description={item.description} isActive={index === 0} onClick={() => { + setSheetOpen(false); if (item.kind === "sampler") { onAddSampler(item.type as SamplerType); } else if (item.kind === "seed") { diff --git a/studio/frontend/src/features/recipe-studio/components/recipe-graph-node.tsx b/studio/frontend/src/features/recipe-studio/components/recipe-graph-node.tsx index 2ba6c80f58..93fef23bd7 100644 --- a/studio/frontend/src/features/recipe-studio/components/recipe-graph-node.tsx +++ b/studio/frontend/src/features/recipe-studio/components/recipe-graph-node.tsx @@ -365,7 +365,7 @@ function RecipeGraphNodeBase({ openConfig(id); }} > - Details + Configure diff --git a/studio/frontend/src/features/recipe-studio/dialogs/expression/expression-dialog.tsx b/studio/frontend/src/features/recipe-studio/dialogs/expression/expression-dialog.tsx index 3b3be9c019..76579eff38 100644 --- a/studio/frontend/src/features/recipe-studio/dialogs/expression/expression-dialog.tsx +++ b/studio/frontend/src/features/recipe-studio/dialogs/expression/expression-dialog.tsx @@ -9,6 +9,7 @@ import { Textarea } from "@/components/ui/textarea"; import type { ReactElement } from "react"; import type { ExpressionConfig, ExpressionDtype } from "../../types"; import { AvailableVariables } from "../shared/available-variables"; +import { FieldLabel } from "../shared/field-label"; import { NameField } from "../shared/name-field"; const DTYPE_OPTIONS: ExpressionDtype[] = ["str", "int", "float", "bool"]; @@ -38,12 +39,11 @@ export function ExpressionDialog({ onChange={(value) => onUpdate({ name: value })} />