test(export): stale-group + same-date ordinal coverage; comment/guard polish

This commit is contained in:
Experiments DB Dev
2026-07-19 15:18:56 -04:00
parent 33ee191966
commit 4f3fe64cad
4 changed files with 25 additions and 2 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ export default function ExportDataModal({
return () => { alive = false; };
}, [experimentId]);
const params = useMemo(() => listExportableParams(dailyTemplate, statuses), [dailyTemplate, statuses]);
const params = useMemo(() => listExportableParams(dailyTemplate ?? [], statuses), [dailyTemplate, statuses]);
const effDataId = dataId ?? params[0]?.id ?? null;
const dataParam = params.find((p) => p.id === effDataId) ?? params[0] ?? null;
+3 -1
View File
@@ -207,7 +207,7 @@ function escapeCsvCell(value) {
}
// Serialize a matrix to an RFC-4180-ish CSV string (LF line endings):
// <pinned label>,<pinned value>
// Data,<metric>
// (blank line)
// [Group,<group per subject column>] -- only when groupAxis === 'col'
// <corner>[,Group?],<column headers...>
@@ -222,6 +222,8 @@ export function toCSV(matrix) {
lines.push(groupRow.map(escapeCsvCell).join(','));
}
// toCSV is a general serializer; the subject-series builder never emits groupAxis
// === 'row' (only 'col' or null), but the branch is retained for that generality.
const header = matrix.groupAxis === 'row'
? ['Group', matrix.corner, ...matrix.columns.map((c) => c.label)]
: [matrix.corner, ...matrix.columns.map((c) => c.label)];