fix: blank Track Record page when the cached backtest report is pre-momentum
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 <noreply@anthropic.com>
This commit is contained in:
@@ -181,7 +181,10 @@ export function BacktestPanel() {
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{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 && (
|
||||
<div>
|
||||
<p className="mb-2 text-xs font-medium uppercase tracking-widest text-gray-500">
|
||||
Momentum-percentile sweep
|
||||
|
||||
Reference in New Issue
Block a user