|
97 | 97 | if(p.elapsed) document.getElementById('bp-elapsed').textContent = ' · '+p.elapsed.toFixed(1)+'s'; |
98 | 98 | } |
99 | 99 |
|
| 100 | + function _activeViewIsGraph() { |
| 101 | + return window.JUG && JUG.state && JUG.state.activeView === 'graph'; |
| 102 | + } |
100 | 103 | function poll(){ |
| 104 | + // Only do graph-build work while the user is on the Graph tab. |
| 105 | + // Knowledge / Board / Wiki users don't pay the cost. |
| 106 | + if (!_activeViewIsGraph()) { |
| 107 | + setTimeout(poll, 1500); |
| 108 | + return; |
| 109 | + } |
101 | 110 | fetch('/api/graph/progress').then(function(r){ return r.ok ? r.json() : null; }).then(function(p){ |
102 | 111 | if(p){ |
103 | 112 | refreshBar(p); |
104 | | - // Sequential append: iterate the server's phases dict in |
105 | | - // insertion order (L0..L5, then L6:<proj1>..<projN>, then |
106 | | - // L6_CROSS). Apply each one whose `ready` flag is true. |
107 | 113 | var seq = Promise.resolve(); |
108 | 114 | var keys = Object.keys(p.phases || {}); |
109 | 115 | keys.forEach(function(k){ |
|
166 | 172 |
|
167 | 173 | <div id="filter-bar"> |
168 | 174 | <span class="view-toggle"> |
169 | | - <button class="view-btn active" data-view="graph">Graph</button> |
170 | | - <button class="view-btn" data-view="knowledge">Knowledge</button> |
| 175 | + <button class="view-btn" data-view="graph">Graph</button> |
| 176 | + <button class="view-btn active" data-view="knowledge">Knowledge</button> |
171 | 177 | <button class="view-btn" data-view="wiki">Wiki</button> |
172 | 178 | <button class="view-btn" data-view="timeline">Board</button> |
173 | 179 | <button class="view-btn" data-view="sankey">Pipeline</button> |
|
219 | 225 | <input type="text" id="search-box" placeholder="Search path, skill, command…"> |
220 | 226 | </div> |
221 | 227 |
|
| 228 | +<!-- Graph-only warning banner. Shown directly below the view-toggle |
| 229 | + row when the Graph tab is active. The Graph view is enabled but |
| 230 | + can be unresponsive at scale — explain the situation in-line so |
| 231 | + users aren't confused if their browser hangs. Hidden by default; |
| 232 | + controls.js toggles display on view change. --> |
| 233 | +<div id="cortex-graph-warn" role="status" |
| 234 | + style="display:none;position:fixed;top:62px;left:50%;transform:translateX(-50%);z-index:200; |
| 235 | + max-width:760px;padding:8px 36px 8px 14px; |
| 236 | + background:linear-gradient(90deg,rgba(48,28,12,0.92),rgba(64,40,16,0.92)); |
| 237 | + border:1px solid rgba(224,140,64,0.5);border-radius:5px; |
| 238 | + color:#FFE3B5;font:11.5px/1.45 -apple-system,Inter,system-ui,sans-serif; |
| 239 | + letter-spacing:0.2px;box-shadow:0 4px 14px rgba(0,0,0,0.4)"> |
| 240 | + <span style="color:#FFB060;margin-right:6px">⚠</span> |
| 241 | + <strong>Graph may be unusable at this scale.</strong> |
| 242 | + Due to performance issues we are currently investigating, opening the Graph |
| 243 | + view can freeze the browser when memory counts are high. We are actively |
| 244 | + working on it. Use <strong>Knowledge</strong> or <strong>Board</strong> for |
| 245 | + reliable browsing while we land the rewrite. |
| 246 | + <button id="cortex-graph-warn-close" aria-label="Dismiss" |
| 247 | + style="position:absolute;top:4px;right:6px;width:22px;height:22px; |
| 248 | + background:transparent;border:none;color:#FFB060;font-size:14px; |
| 249 | + cursor:pointer;line-height:1;padding:0">×</button> |
| 250 | +</div> |
| 251 | +<script> |
| 252 | +(function(){ |
| 253 | + var b = document.getElementById('cortex-graph-warn-close'); |
| 254 | + if (b) b.addEventListener('click', function() { |
| 255 | + var w = document.getElementById('cortex-graph-warn'); |
| 256 | + if (w) { w.style.display = 'none'; w.dataset.dismissed = '1'; } |
| 257 | + }); |
| 258 | +})(); |
| 259 | +</script> |
| 260 | + |
222 | 261 | <div id="status-bar" class="hud-panel"> |
223 | 262 | <div class="status-dot"></div> |
224 | 263 | <span id="status-text">Initializing</span> |
|
0 commit comments