diff --git a/agents/stock/workspace/scripts/behive_web.py b/agents/stock/workspace/scripts/behive_web.py index 03e6b06..2498f64 100644 --- a/agents/stock/workspace/scripts/behive_web.py +++ b/agents/stock/workspace/scripts/behive_web.py @@ -6425,10 +6425,12 @@ def render_html() -> str: 'window.__behive_chart_mode=chartMode;' 'window.__behive_adr_days=adrDays;' 'function load(owner,fresh){' - # 5분 이상 stale 상태에서 들어오면 모든 탭을 새로 채워야 하니 owner 부분 fetch도 전체로 승격. - 'if(lastLoadAt&&(Date.now()-lastLoadAt)>STALE_MS){resetShellLook();owner=null;}' + # 5분 이상 stale 면 전체로 승격하되, 화면은 클리어하지 않고 기존 내용 유지 → fetch 완료 시 교체(swap). + 'if(lastLoadAt&&(Date.now()-lastLoadAt)>STALE_MS){owner=null;}' 'var key=owner||"all";' 'if(!fresh&&inFlight[key])return inFlight[key];' + # 로딩 표시는 새로고침 아이콘 스핀으로만 (내용은 그대로 보임). + 'var rb=document.querySelector("a.refresh");if(rb)rb.classList.add("spinning");' 'var qs=[];if(owner)qs.push("owner="+encodeURIComponent(owner));if(fresh)qs.push("fresh=1");' 'var cd=chartDays();if(cd!==null)qs.push("chart_days="+cd);' 'var cu=chartUnit();if(cu!==null)qs.push("chart_unit="+cu);' @@ -6439,7 +6441,7 @@ def render_html() -> str: '.then(function(r){if(!r.ok)throw new Error("HTTP "+r.status);return r.json();})' '.then(function(j){apply(j);lastLoadAt=Date.now();})' '.catch(function(){failVisible("갱신 실패 — 다시 시도해주세요");});' - 'var done=function(){if(!fresh)delete inFlight[key];};' + 'var done=function(){if(!fresh)delete inFlight[key];if(rb&&!Object.keys(inFlight).length)rb.classList.remove("spinning");};' 'pr.finally?pr.finally(done):pr.then(done,done);' 'if(!fresh)inFlight[key]=pr;' 'return pr;'