fix: force-expand analysis cards and show loading state on tab switch
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
8cd09d8a0e
commit
407f8a6b46
1 changed files with 9 additions and 1 deletions
|
|
@ -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='<tr><td colspan="8" style="text-align:center;padding:36px;color:var(--text3)">Loading analysis…</td></tr>';
|
||||
if(rBody)rBody.innerHTML='<div style="color:var(--text3);font-size:.8rem;padding:14px 20px">Loading…</div>';
|
||||
if(sBody)sBody.innerHTML='<div style="color:var(--text3);font-size:.8rem;padding:14px 20px">Loading…</div>';
|
||||
try{
|
||||
var res=await fetch('/api/analysis').then(function(r){return r.json();});
|
||||
if(!res||!res.ok||!res.data){
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue