From 3d8fc3fd6a6fc18a8d0a109c1ba1bcf351815d8b Mon Sep 17 00:00:00 2001 From: Prashant Vasudevan <71649489+vprashrex@users.noreply.github.com> Date: Fri, 19 Jun 2026 08:53:53 +0530 Subject: [PATCH 1/2] feat(assessment): make user prompt optional and accept attachment columns --- app/(main)/assessment/page.tsx | 38 +++++++++---------- .../assessment/ColumnMapperStep.tsx | 12 +++--- app/components/assessment/PrefilterStep.tsx | 14 ++++--- .../assessment/PromptAndConfigStep.tsx | 17 +++++---- .../prompt-config/ConfigCreator.tsx | 7 +++- .../assessment/prompt-config/UserPrompt.tsx | 3 ++ app/lib/data/assessmentModels.ts | 18 ++++----- app/lib/types/assessment.ts | 2 +- app/lib/types/configs.ts | 2 +- 9 files changed, 61 insertions(+), 52 deletions(-) diff --git a/app/(main)/assessment/page.tsx b/app/(main)/assessment/page.tsx index ad9e8b08..239e85a8 100644 --- a/app/(main)/assessment/page.tsx +++ b/app/(main)/assessment/page.tsx @@ -168,12 +168,11 @@ function PageContent() { showToastError("Dataset is required"); return; } - if (columnMapping.textColumns.length === 0) { - showToastError("Map at least one text column"); - return; - } - if (!promptTemplate.trim()) { - showToastError("Prompt is required"); + if ( + columnMapping.textColumns.length === 0 && + columnMapping.attachments.length === 0 + ) { + showToastError("Map at least one text or attachment column"); return; } if (!outputSchema.some((field) => field.name.trim())) { @@ -271,17 +270,16 @@ function PageContent() { }; const hasDataset = !!datasetId && columns.length > 0; - const hasMapperSelection = columnMapping.textColumns.length > 0; - const hasPromptTemplate = promptTemplate.trim().length > 0; + const hasMapperSelection = + columnMapping.textColumns.length > 0 || + columnMapping.attachments.length > 0; const hasConfiguredResponseFormat = outputSchema.some((field) => field.name.trim(), ); - const canReachReview = - hasPromptTemplate && configs.length > 0 && hasConfiguredResponseFormat; + const canReachReview = configs.length > 0 && hasConfiguredResponseFormat; const canSubmitAssessment = !!datasetId && hasMapperSelection && - hasPromptTemplate && hasConfiguredResponseFormat && configs.length > 0 && experimentName.trim().length > 0 && @@ -289,16 +287,14 @@ function PageContent() { const submitBlockerMessage = !datasetId ? "Select a dataset to submit" : !hasMapperSelection - ? "Map at least one text column to submit" - : !hasPromptTemplate - ? "Write a prompt to submit" - : !hasConfiguredResponseFormat - ? "Set response format to submit" - : configs.length === 0 - ? "Select at least one configuration to submit" - : !experimentName.trim() - ? "Enter an experiment name to submit" - : ""; + ? "Map at least one text or attachment column to submit" + : !hasConfiguredResponseFormat + ? "Set response format to submit" + : configs.length === 0 + ? "Select at least one configuration to submit" + : !experimentName.trim() + ? "Enter an experiment name to submit" + : ""; const effectiveCompletedConfigSteps = useMemo(() => { const merged = new Set(completedConfigSteps); if (hasMapperSelection) merged.add(1); diff --git a/app/components/assessment/ColumnMapperStep.tsx b/app/components/assessment/ColumnMapperStep.tsx index fbb59118..80623f2d 100644 --- a/app/components/assessment/ColumnMapperStep.tsx +++ b/app/components/assessment/ColumnMapperStep.tsx @@ -137,7 +137,9 @@ export default function ColumnMapperStep({ const mappedCount = columnConfigs.filter( (config) => config.role !== "unmapped", ).length; - const hasText = columnConfigs.some((config) => config.role === "text"); + const hasMappedColumn = columnConfigs.some( + (config) => config.role === "text" || config.role === "attachment", + ); return (
@@ -383,17 +385,17 @@ export default function ColumnMapperStep({
- {hasText + {hasMappedColumn ? "Ready to continue." - : "Select at least one Text column."} + : "Map at least one Text or Attachment column."}