From cdb40e7368d1327bb9b03a263b4cd759dba5ffa5 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 18 Sep 2026 09:10:09 -0400 Subject: [PATCH] Make the request preview show the request The panel's preview calls buildPayload itself, and the scope arrived as a parameter that the preview had no way to supply -- so it defaulted to empty and printed a payload with no scope for a write that had one. A preview that disagrees with what is sent is worse than no preview: it is the one place someone looks to check before committing a change. buildPayload reads the scope from the ref instead, so there is one payload and both callers get it. Co-Authored-By: Claude Opus 5 (1M context) --- ui/src/views/Forecast.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/src/views/Forecast.jsx b/ui/src/views/Forecast.jsx index f25f293..34305d5 100644 --- a/ui/src/views/Forecast.jsx +++ b/ui/src/views/Forecast.jsx @@ -1307,7 +1307,7 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio // changes a larger set. It travels as [col, op, value] rather than folded // into the slices, because a slice is {col: value} and can only mean // equality: a view filtered to sseas_e <= 2027 has no slice form at all. - const body = buildPayload(op, viewFilterRef.current) + const body = buildPayload(op) if (!body) return if (body.slices.some(sl => !Object.keys(sl).length)) { flash('No dimension or date columns in slice — check col_meta', 'error'); return @@ -1436,7 +1436,11 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio return out } - function buildPayload(op, viewFilter = []) { + // The scope is read from the ref rather than passed in: the request preview in + // the panel calls this too, and when it was a parameter the preview defaulted + // it away -- showing a payload with no scope for a write that had one. + function buildPayload(op) { + const viewFilter = viewFilterRef.current || [] if (!slices.length) return null // Two clicked cells can differ only by a column the operation cannot filter on // (pf_iter, say, which is not in col_meta and so is dropped here). Those become