diff --git a/ui/src/views/Forecast.jsx b/ui/src/views/Forecast.jsx index ce580d2..2d37821 100644 --- a/ui/src/views/Forecast.jsx +++ b/ui/src/views/Forecast.jsx @@ -1326,8 +1326,17 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio cfg.split_by_depth != null ? cfg.split_by_depth - 1 : null) if (cfg.group_by_depth != null) setExpandDepth(cfg.group_by_depth - 1) else if (cfg.expand_depth != null) await applyDepth(cfg.expand_depth) + + // restore() replaces `expressions` wholesale, so loading a layout drops the + // ordering columns — and a layout saved before they existed has none to put + // back. Re-applied after every restore that comes from a saved config, which + // is the general form of the fix initViewer already needed. + await syncOrderExpressions() + setActiveLayoutId(layout.id) - await persistLayout(versionId, cfg) + // After the sync, so the persisted copy carries the expressions too. + const merged = await captureConfig() + await persistLayout(versionId, merged || cfg) } function deleteLayout(id, e) {