diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index fad67932..2a6c344c 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -55,4 +55,6 @@ jobs: context: . file: ./Dockerfile push: true - tags: quicklookup/synmetrix-client-v2:${{ env.IMAGE_TAG }} + tags: | + quicklookup/synmetrix-client-v2:${{ env.IMAGE_TAG }} + quicklookup/synmetrix-client-v2:latest diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz new file mode 100644 index 00000000..ed297d6f Binary files /dev/null and b/.yarn/install-state.gz differ diff --git a/src/components/SmartGeneration/index.tsx b/src/components/SmartGeneration/index.tsx index c3051645..21c29b76 100644 --- a/src/components/SmartGeneration/index.tsx +++ b/src/components/SmartGeneration/index.tsx @@ -1079,11 +1079,11 @@ const SmartGeneration: FC = ({ })) ); } - // Select all active columns by default + // Select only columns that have data — empty columns start unchecked if (pd.columns?.length) { const active = pd.columns .filter( - (c: any) => c.has_values !== false && c.value_rows > 0 + (c: any) => c.has_values !== false || c.value_rows > 0 ) .map((c: any) => c.name); setSelectedColumns(new Set(active)); @@ -1209,12 +1209,10 @@ const SmartGeneration: FC = ({ .filter((a) => a.selected) .map((a) => ({ column: a.column, alias: a.alias })); - // Only pass selected_columns if user deselected some columns - const activeCount = - profileData?.columns?.filter( - (c: any) => c.has_values !== false && c.value_rows > 0 - ).length ?? 0; - const isSubset = selectedColumns.size < activeCount; + // Pass selected_columns whenever the user has deselected any columns + const totalColumns = profileData?.columns?.length ?? 0; + const isSubset = + selectedColumns.size > 0 && selectedColumns.size < totalColumns; const result = await execSmartGen({ datasource_id: dataSource.id!, @@ -1258,9 +1256,8 @@ const SmartGeneration: FC = ({ if (requiredSet.has(key)) return true; // Always include the count measure if (f.name === "count" && f.member_type === "measure") return true; - // Opt-in sources: map, nested (ARRAY JOIN), AI-generated - if (f.source === "map" || f.source === "nested" || f.source === "ai") - return false; + // Opt-in: AI-generated fields start unchecked (user picks from suggestions) + if (f.source === "ai") return false; // Everything else checked by default return true; }; @@ -1306,12 +1303,10 @@ const SmartGeneration: FC = ({ .filter((a) => a.selected) .map((a) => ({ column: a.column, alias: a.alias })); - // Only pass selected_columns if user deselected some columns - const applyActiveCount = - profileData?.columns?.filter( - (c: any) => c.has_values !== false && c.value_rows > 0 - ).length ?? 0; - const applyIsSubset = selectedColumns.size < applyActiveCount; + // Pass selected_columns whenever the user has deselected any columns + const applyTotalColumns = profileData?.columns?.length ?? 0; + const applyIsSubset = + selectedColumns.size > 0 && selectedColumns.size < applyTotalColumns; // Compute excluded fields: all preview fields NOT in the user's selection const allPreviewFields = [ diff --git a/src/graphql/generated.ts b/src/graphql/generated.ts index 6733be35..01c3f27f 100644 --- a/src/graphql/generated.ts +++ b/src/graphql/generated.ts @@ -13961,6 +13961,7 @@ export const SmartGenDataSchemasDocument = gql` $cube_name: String $selected_ai_metrics: [String] $selected_columns: [String] + $excluded_fields: [String] $skip_llm: Boolean ) { smart_gen_dataschemas( @@ -13978,6 +13979,7 @@ export const SmartGenDataSchemasDocument = gql` cube_name: $cube_name selected_ai_metrics: $selected_ai_metrics selected_columns: $selected_columns + excluded_fields: $excluded_fields skip_llm: $skip_llm ) { code diff --git a/src/graphql/gql/datasources.gql b/src/graphql/gql/datasources.gql index 80565340..fb1f8e1d 100644 --- a/src/graphql/gql/datasources.gql +++ b/src/graphql/gql/datasources.gql @@ -228,6 +228,7 @@ mutation SmartGenDataSchemas( $cube_name: String $selected_ai_metrics: [String] $selected_columns: [String] + $excluded_fields: [String] $skip_llm: Boolean ) { smart_gen_dataschemas( @@ -245,6 +246,7 @@ mutation SmartGenDataSchemas( cube_name: $cube_name selected_ai_metrics: $selected_ai_metrics selected_columns: $selected_columns + excluded_fields: $excluded_fields skip_llm: $skip_llm ) { code