diff --git a/web/app.js b/web/app.js index 2b3cdc3..de88ec7 100644 --- a/web/app.js +++ b/web/app.js @@ -843,14 +843,19 @@ function updateHeroMetrics() { healthRefinePlan.textContent = `${plan.selected?.length || 0}/${plan.budget || 0} ยท drop ${plan.dropped_by_snr || 0}/${plan.dropped_by_budget || 0}`; } if (healthRefineWindows) { - const windows = refinementInfo.windows || []; - if (!Array.isArray(windows) || windows.length === 0) { - healthRefineWindows.textContent = 'n/a'; + const stats = refinementInfo.window_stats || null; + if (stats && stats.count) { + healthRefineWindows.textContent = `${fmtHz(stats.min_span_hz || 0)}โ€“${fmtHz(stats.max_span_hz || 0)}`; } else { - const spans = windows.map(w => w.span_hz || 0).filter(v => v > 0); - const minSpan = spans.length ? Math.min(...spans) : 0; - const maxSpan = spans.length ? Math.max(...spans) : 0; - healthRefineWindows.textContent = spans.length ? `${fmtHz(minSpan)}โ€“${fmtHz(maxSpan)}` : 'n/a'; + const windows = refinementInfo.windows || []; + if (!Array.isArray(windows) || windows.length === 0) { + healthRefineWindows.textContent = 'n/a'; + } else { + const spans = windows.map(w => w.span_hz || 0).filter(v => v > 0); + const minSpan = spans.length ? Math.min(...spans) : 0; + const maxSpan = spans.length ? Math.max(...spans) : 0; + healthRefineWindows.textContent = spans.length ? `${fmtHz(minSpan)}โ€“${fmtHz(maxSpan)}` : 'n/a'; + } } } }