From 8f009e468efcd0038bfd7b0e1a1baf58827a3201 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Sat, 25 Apr 2026 21:24:01 -0400 Subject: [PATCH] Fix cleanLayout stripping expression columns (e.g. Year) on restore Expression columns (bucket, computed) are defined in cfg.expressions and are valid pivot axes, but weren't in validCols (raw table columns), so they were filtered out of group_by/split_by on every layout restore. Co-Authored-By: Claude Sonnet 4.6 --- ui/src/views/Forecast.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/src/views/Forecast.jsx b/ui/src/views/Forecast.jsx index 1ed44fb..ec204f4 100644 --- a/ui/src/views/Forecast.jsx +++ b/ui/src/views/Forecast.jsx @@ -18,7 +18,8 @@ function loadPerspective() { function cleanLayout(cfg, validCols) { if (!cfg) return cfg const c = { ...cfg } - const ok = (col) => validCols.has(col) + const exprNames = new Set(Object.keys(cfg.expressions || {})) + const ok = (col) => validCols.has(col) || exprNames.has(col) if (c.columns) c.columns = c.columns.filter(col => col == null || ok(col)) if (c.group_by) c.group_by = c.group_by.filter(ok) if (c.split_by) c.split_by = c.split_by.filter(ok)