fix: preserve debug info across snapshot re-fetch + widen refresh filter

- refreshDebug state lives in parent (InstrumentDashboard) so it survives
  fetchSnapshotSilent re-render (ExplanationScore no longer loses debugInfo
  when onRefreshDone triggers setLoading → unmount)
- fetchSnapshotSilent: re-fetches snapshot without setLoading(true) so
  ExplanationScore stays mounted with its state
- Refresh filter now catches rows where prediction_json is empty even if
  actual_json is populated, and handles '[]' / null variants

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OpenSquared
2026-06-29 23:20:17 +02:00
parent c73bedd7d0
commit 05236c31f3
2 changed files with 23 additions and 7 deletions

View File

@@ -1462,7 +1462,10 @@ def refresh_auto_analyses():
"pred_keys": list(json.loads(pred).keys()) if pred not in (None, "", "{}", "null") else [],
})
rows = [r for r in all_rows if (r["actual_json"] or "") in (None, "", "{}", "null")]
_empty = (None, "", "{}", "null", "[]")
rows = [r for r in all_rows if
(r["actual_json"] or "") in _empty or
(r["prediction_json"] or "") in _empty]
print(f"[refresh] {len(rows)} analyses with empty actual_json out of {len(all_rows)} total", flush=True)
conn.close()