From 407f8a6b46d98e948f062036d2f2d0efcb65aad5 Mon Sep 17 00:00:00 2001 From: Manohar Date: Wed, 24 Jun 2026 10:25:50 +0530 Subject: [PATCH] fix: force-expand analysis cards and show loading state on tab switch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - showView('analysis') now removes 'collapsed' from all three analysis card sections so localStorage state can't keep them hidden - loadAnalysis() shows "Loading analysis…" immediately before the fetch so the user sees the view is active (not blank) Co-Authored-By: Claude Sonnet 4.6 --- public/index.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index 7e205fe..2bbab5f 100644 --- a/public/index.html +++ b/public/index.html @@ -852,7 +852,12 @@ function showView(name){ document.querySelectorAll('.nav-tab').forEach(function(t){t.classList.remove('active');}); var tab=document.querySelector('.nav-tab[data-target="'+name+'"]');if(tab)tab.classList.add('active'); window.scrollTo(0,0); - if(name==='analysis')loadAnalysis(); + if(name==='analysis'){ + ['a-sec-class','a-sec-risk','a-sec-scen'].forEach(function(id){ + var c=document.getElementById(id);if(c)c.classList.remove('collapsed'); + }); + loadAnalysis(); + } } async function forceRefreshAnalysis(){ @@ -869,6 +874,9 @@ async function loadAnalysis(){ var tbody=document.getElementById('a-class-body'); var rBody=document.getElementById('a-risk-body'); var sBody=document.getElementById('a-scen-body'); + if(tbody)tbody.innerHTML='Loading analysis…'; + if(rBody)rBody.innerHTML='
Loading…
'; + if(sBody)sBody.innerHTML='
Loading…
'; try{ var res=await fetch('/api/analysis').then(function(r){return r.json();}); if(!res||!res.ok||!res.data){