fix(slm): don't blank L1/L10 on percentile-less live-stream frames

The DRD stream carries Lp/Leq/Lmax but not the Ln percentiles (those come
from DOD polling), so updateLiveMetrics/updateDashboardMetrics were
overwriting the DOD-sourced L1/L10 values with '--' on every stream frame.
Guard the value updates on `data.lnN != null` so a frame without the key
leaves the existing value intact — mirrors the existing label guards.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-09 17:56:29 +00:00
parent 7f561c2c9d
commit 08fec696f1
2 changed files with 11 additions and 6 deletions
+7 -4
View File
@@ -570,14 +570,17 @@ function updateLiveMetrics(data) {
if (document.getElementById('live-lmax')) {
document.getElementById('live-lmax').textContent = data.lmax || '--';
}
if (document.getElementById('live-ln1')) {
document.getElementById('live-ln1').textContent = data.ln1 || '--';
// Only update Ln values when the frame actually carries them. DRD stream
// frames omit percentiles (DOD-only), so without this guard a live stream
// would blank L1/L10 over the values rendered from the cached DOD snapshot.
if (data.ln1 != null && document.getElementById('live-ln1')) {
document.getElementById('live-ln1').textContent = data.ln1;
}
if (data.ln1_label && document.getElementById('live-ln1-label')) {
document.getElementById('live-ln1-label').textContent = data.ln1_label;
}
if (document.getElementById('live-ln2')) {
document.getElementById('live-ln2').textContent = data.ln2 || '--';
if (data.ln2 != null && document.getElementById('live-ln2')) {
document.getElementById('live-ln2').textContent = data.ln2;
}
if (data.ln2_label && document.getElementById('live-ln2-label')) {
document.getElementById('live-ln2-label').textContent = data.ln2_label;