From e71c07e554380404d2af2a7084af3c8be5b81b85 Mon Sep 17 00:00:00 2001 From: Dennis Thiessen Date: Tue, 23 Jun 2026 22:47:36 +0200 Subject: [PATCH] fix: blank Track Record page when the cached backtest report is pre-momentum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The momentum-sweep table read row.min_momentum_percentile.toFixed(), but a report cached before the EV->momentum change only has min_expected_value rows. undefined .toFixed() threw during render and — with no error boundary — blanked the whole Track Record tab. Guard the sweep block on the new field so a stale report just hides the sweep; re-running the backtest repopulates it. Co-Authored-By: Claude Opus 4.8 --- frontend/src/components/signals/BacktestPanel.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/signals/BacktestPanel.tsx b/frontend/src/components/signals/BacktestPanel.tsx index 264533f..58f2808 100644 --- a/frontend/src/components/signals/BacktestPanel.tsx +++ b/frontend/src/components/signals/BacktestPanel.tsx @@ -181,7 +181,10 @@ export function BacktestPanel() { - {report.sweep && report.sweep.length > 0 && ( + {/* Guard on the new field so a stale cached report (pre-momentum, + with min_expected_value rows) hides the sweep instead of crashing + the whole page. Re-running the backtest repopulates it. */} + {report.sweep && report.sweep.length > 0 && report.sweep[0].min_momentum_percentile != null && (

Momentum-percentile sweep