Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file added .yarn/install-state.gz
Binary file not shown.
29 changes: 12 additions & 17 deletions src/components/SmartGeneration/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1079,11 +1079,11 @@ const SmartGeneration: FC<SmartGenerationProps> = ({
}))
);
}
// 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));
Expand Down Expand Up @@ -1209,12 +1209,10 @@ const SmartGeneration: FC<SmartGenerationProps> = ({
.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!,
Expand Down Expand Up @@ -1258,9 +1256,8 @@ const SmartGeneration: FC<SmartGenerationProps> = ({
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;
};
Expand Down Expand Up @@ -1306,12 +1303,10 @@ const SmartGeneration: FC<SmartGenerationProps> = ({
.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 = [
Expand Down
2 changes: 2 additions & 0 deletions src/graphql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/graphql/gql/datasources.gql
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down