From e7c266a871b6b9a0ffb5f1a656b10801efc47ed3 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 17 Sep 2026 14:47:38 -0400 Subject: [PATCH] Quiet the ordering trace behind pf_debug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It works now — inputs carrying a bucket_order and three seq values, both expressions applied — so the console does not need narrating, least of all during a demo. Kept rather than deleted, gated like the depth tracing: the failure it diagnosed (running before its inputs existed, then reporting nothing) is the kind that recurs, and rebuilding this each time is wasted work. The initViewer scaffolding goes, having served its purpose. Co-Authored-By: Claude Opus 5 (1M context) --- ui/src/views/Forecast.jsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui/src/views/Forecast.jsx b/ui/src/views/Forecast.jsx index 2eb268b..26d21ce 100644 --- a/ui/src/views/Forecast.jsx +++ b/ui/src/views/Forecast.jsx @@ -698,9 +698,8 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio } async function initViewer(vid, sid) { - dbgOrder('initViewer start', { vid, sid, hasViewer: !!viewerRef.current }) const viewer = viewerRef.current - if (!viewer) return dbgOrder('initViewer: no viewer element') + if (!viewer) return const myId = ++initIdRef.current setLoading(true) setLargeDataset(false) @@ -738,7 +737,7 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio if (rowCount >= 500000) setLargeDataset(true) - if (myId !== initIdRef.current) return dbgOrder('initViewer: superseded before table') + if (myId !== initIdRef.current) return if (!workerRef.current) workerRef.current = await perspective.worker() const worker = workerRef.current @@ -811,8 +810,7 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio // by the very next line and the ordering columns never appeared in the // column list. try { - dbgOrder('reached the sync call') - await syncOrderExpressions() + await syncOrderExpressions() } catch (err) { // Its own try covers only restore(); save() and the builders sit outside // it, and a throw there would abort the rest of initViewer silently. @@ -941,8 +939,13 @@ export default function Forecast({ sources = [], sourceId, versions = [], versio // // Removing an ordering removes its column: leaving a stale Bucket expression // behind would keep ordering by an order that no longer exists. + // Silent unless localStorage.pf_debug is set, like the rest of the tracing. + // Kept rather than removed: it took several rounds to work out that this ran + // before its inputs existed, and it will be wanted again. function dbgOrder(msg, extra) { - console.log(`[pf-order] ${msg}`, extra) + try { if (!localStorage.getItem('pf_debug')) return } catch { return } + if (extra === undefined) console.log(`[pf-order] ${msg}`) + else console.log(`[pf-order] ${msg}`, extra) } // Fetches its own inputs rather than reading the `versions` prop and the