From 70ee13404c06775f9a93f2945100ff7fb83baf85 Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Fri, 16 Jan 2026 17:00:57 -0600 Subject: [PATCH] Fix empty gridLabel fallback in dynamic grid dimensions When gridLabel is an empty string "", fall back to pathLabel instead of showing an empty header. The check was only for undefined, not for empty strings. Co-Authored-By: Claude Opus 4.5 --- apps/web/src/lib/flowcharts/loader.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/web/src/lib/flowcharts/loader.ts b/apps/web/src/lib/flowcharts/loader.ts index ec39c065..bd67612a 100644 --- a/apps/web/src/lib/flowcharts/loader.ts +++ b/apps/web/src/lib/flowcharts/loader.ts @@ -1496,7 +1496,8 @@ export function inferGridDimensionsFromExamples( for (const pathLabel of dim1Info.uniqueValues) { const gridLabel = dim1Info.gridLabels.get(pathLabel) - rows.push(gridLabel !== undefined ? gridLabel : pathLabel) + // Use gridLabel if it's a non-empty string, otherwise fall back to pathLabel + rows.push(gridLabel ? gridLabel : pathLabel) rowKeys.push(pathLabel) } @@ -1543,13 +1544,15 @@ export function inferGridDimensionsFromExamples( for (const pathLabel of rowInfo.uniqueValues) { const gridLabel = rowInfo.gridLabels.get(pathLabel) - rows.push(gridLabel !== undefined ? gridLabel : pathLabel) + // Use gridLabel if it's a non-empty string, otherwise fall back to pathLabel + rows.push(gridLabel ? gridLabel : pathLabel) rowKeys.push(pathLabel) } for (const pathLabel of colInfo.uniqueValues) { const gridLabel = colInfo.gridLabels.get(pathLabel) - cols.push(gridLabel !== undefined ? gridLabel : pathLabel) + // Use gridLabel if it's a non-empty string, otherwise fall back to pathLabel + cols.push(gridLabel ? gridLabel : pathLabel) colKeys.push(pathLabel) }