|
26 | 26 | <div class="loader-sub">Initializing neural map</div> |
27 | 27 | </div> |
28 | 28 |
|
29 | | -<!-- Performance-notice toast. Banner at the top of the page explaining |
30 | | - why Graph + Pipeline are disabled and that Wiki is still draft. |
31 | | - Auto-dismissable via the close button. --> |
32 | | -<div id="cortex-perf-toast" role="status" |
33 | | - style="position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:5000; |
34 | | - max-width:780px;padding:10px 44px 10px 18px; |
35 | | - background:linear-gradient(90deg,rgba(20,28,42,0.95),rgba(28,36,52,0.95)); |
36 | | - border:1px solid rgba(224,176,64,0.45);border-radius:6px; |
37 | | - color:#E8E4D8;font:12px/1.5 -apple-system,Inter,system-ui,sans-serif; |
38 | | - letter-spacing:0.2px;box-shadow:0 6px 22px rgba(0,0,0,0.45); |
39 | | - backdrop-filter:blur(6px)"> |
40 | | - <div style="display:flex;align-items:flex-start;gap:10px"> |
41 | | - <div style="color:#E0B040;font-size:14px;line-height:1;margin-top:1px">⚠</div> |
42 | | - <div> |
43 | | - <div style="color:#E0B040;font-weight:600;margin-bottom:3px;letter-spacing:0.6px;font-size:11px;text-transform:uppercase"> |
44 | | - Performance notice |
45 | | - </div> |
46 | | - <div style="color:#c4d4dc"> |
47 | | - <strong>Graph</strong> and <strong>Pipeline</strong> views are temporarily |
48 | | - deactivated due to performance issues at scale. They will return once we |
49 | | - solve the rendering bottleneck. <strong>Knowledge</strong> and |
50 | | - <strong>Board</strong> are the recommended views — both lazy-load and |
51 | | - scale to any number of memories. <strong>Wiki</strong> remains visible |
52 | | - but is still <em>under construction</em> — not the final version. |
53 | | - </div> |
54 | | - </div> |
55 | | - </div> |
56 | | - <button id="cortex-perf-toast-close" aria-label="Dismiss notice" |
57 | | - style="position:absolute;top:6px;right:8px;width:24px;height:24px; |
58 | | - background:transparent;border:none;color:#7a8e9c;font-size:16px; |
59 | | - cursor:pointer;line-height:1;padding:0">×</button> |
60 | | -</div> |
61 | | -<script> |
62 | | -(function(){ |
63 | | - var t = document.getElementById('cortex-perf-toast'); |
64 | | - var b = document.getElementById('cortex-perf-toast-close'); |
65 | | - if (!t || !b) return; |
66 | | - // Restore the dismissed state from localStorage so the toast doesn't |
67 | | - // re-appear on every reload once the user has acknowledged it. |
68 | | - try { |
69 | | - if (localStorage.getItem('cortexPerfToastDismissed') === '1') { |
70 | | - t.style.display = 'none'; |
71 | | - } |
72 | | - } catch (_) {} |
73 | | - b.addEventListener('click', function(){ |
74 | | - t.style.display = 'none'; |
75 | | - try { localStorage.setItem('cortexPerfToastDismissed', '1'); } catch (_) {} |
76 | | - }); |
77 | | -})(); |
78 | | -</script> |
79 | | - |
80 | 29 | <!-- Non-blocking progress bar wired to /api/graph/progress. Shows |
81 | 30 | the server's layered build status (L0 domains → L1 … L6 AST) |
82 | 31 | without ever taking the graph away from the user. Fades in when |
|
90 | 39 | <div style="text-align:right;margin-top:4px;color:#7a8e9c;font-size:10px;font-variant-numeric:tabular-nums"><span id="bp-pct">0%</span><span id="bp-elapsed" style="color:#5a6e7c;margin-left:6px"></span></div> |
91 | 40 | </div> |
92 | 41 | <script> |
93 | | -// Phase-driven append-only loader. Active ONLY when the Graph tab |
94 | | -// is the current view — switching away from Graph stops the polling |
95 | | -// loop so its cost (each phase append re-runs buildGraph) doesn't |
96 | | -// hit Knowledge / Board users. |
| 42 | +// Phase-driven append-only loader. |
| 43 | +// Polls /api/graph/progress; when a phase flips to `ready`, fetches |
| 44 | +// /api/graph/phase?name=<key> ONCE and appends its nodes+edges to the |
| 45 | +// live scene via JUG.appendGraphDelta. Never re-fetches the whole |
| 46 | +// graph — matches the user's requirement: each phase pops new nodes |
| 47 | +// when the previous one is done. |
97 | 48 | (function(){ |
98 | 49 | // Phases are now DYNAMIC: L0..L5 are fixed, then one phase per |
99 | 50 | // project (L6:<name>) then L6_CROSS. We discover the full set from |
|
146 | 97 | if(p.elapsed) document.getElementById('bp-elapsed').textContent = ' · '+p.elapsed.toFixed(1)+'s'; |
147 | 98 | } |
148 | 99 |
|
149 | | - function _activeViewIsGraph() { |
150 | | - return window.JUG && JUG.state && JUG.state.activeView === 'graph'; |
151 | | - } |
152 | 100 | function poll(){ |
153 | | - // Only do graph-build work while the user is on the Graph tab. |
154 | | - // Knowledge / Board / Wiki users don't pay the cost. |
155 | | - if (!_activeViewIsGraph()) { |
156 | | - setTimeout(poll, 1500); |
157 | | - return; |
158 | | - } |
159 | 101 | fetch('/api/graph/progress').then(function(r){ return r.ok ? r.json() : null; }).then(function(p){ |
160 | 102 | if(p){ |
161 | 103 | 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. |
162 | 107 | var seq = Promise.resolve(); |
163 | 108 | var keys = Object.keys(p.phases || {}); |
164 | 109 | keys.forEach(function(k){ |
|
221 | 166 |
|
222 | 167 | <div id="filter-bar"> |
223 | 168 | <span class="view-toggle"> |
224 | | - <!-- Graph re-enabled but flagged with a warning banner below |
225 | | - (#cortex-graph-warn) shown when the user activates it. |
226 | | - Knowledge stays the default landing tab. Pipeline still off |
227 | | - pending its own paged rewrite. Wiki keeps the DRAFT chip. --> |
228 | | - <button class="view-btn" data-view="graph" |
229 | | - title="Graph view — currently unstable at scale; see the warning below">Graph <span style="font-size:9px;color:#E0B040;letter-spacing:0.6px;margin-left:4px">EXPERIMENTAL</span></button> |
230 | | - <button class="view-btn active" data-view="knowledge">Knowledge</button> |
231 | | - <button class="view-btn" data-view="wiki" title="Wiki — under construction; not the final version">Wiki <span style="font-size:9px;color:#E0B040;letter-spacing:0.6px;margin-left:4px">DRAFT</span></button> |
| 169 | + <button class="view-btn active" data-view="graph">Graph</button> |
| 170 | + <button class="view-btn" data-view="knowledge">Knowledge</button> |
| 171 | + <button class="view-btn" data-view="wiki">Wiki</button> |
232 | 172 | <button class="view-btn" data-view="timeline">Board</button> |
233 | | - <button class="view-btn" data-view="sankey" disabled |
234 | | - title="Pipeline view temporarily disabled — performance issue at scale" |
235 | | - style="opacity:0.35;cursor:not-allowed">Pipeline</button> |
| 173 | + <button class="view-btn" data-view="sankey">Pipeline</button> |
236 | 174 | </span> |
237 | 175 | <button class="filter-btn" id="glossary-toggle" title="Glossary (?)">?</button> |
238 | 176 | <span class="filter-sep"></span> |
|
281 | 219 | <input type="text" id="search-box" placeholder="Search path, skill, command…"> |
282 | 220 | </div> |
283 | 221 |
|
284 | | -<!-- Graph-only warning banner. Shown directly below the view-toggle |
285 | | - row when the Graph tab is active. The Graph view is enabled but |
286 | | - can be unresponsive at scale — explain the situation in-line so |
287 | | - users aren't confused if their browser hangs. Hidden by default; |
288 | | - controls.js toggles display on view change. --> |
289 | | -<div id="cortex-graph-warn" role="status" |
290 | | - style="display:none;position:fixed;top:62px;left:50%;transform:translateX(-50%);z-index:200; |
291 | | - max-width:760px;padding:8px 36px 8px 14px; |
292 | | - background:linear-gradient(90deg,rgba(48,28,12,0.92),rgba(64,40,16,0.92)); |
293 | | - border:1px solid rgba(224,140,64,0.5);border-radius:5px; |
294 | | - color:#FFE3B5;font:11.5px/1.45 -apple-system,Inter,system-ui,sans-serif; |
295 | | - letter-spacing:0.2px;box-shadow:0 4px 14px rgba(0,0,0,0.4)"> |
296 | | - <span style="color:#FFB060;margin-right:6px">⚠</span> |
297 | | - <strong>Graph may be unusable at this scale.</strong> |
298 | | - Due to performance issues we are currently investigating, opening the Graph |
299 | | - view can freeze the browser when memory counts are high. We are actively |
300 | | - working on it. Use <strong>Knowledge</strong> or <strong>Board</strong> for |
301 | | - reliable browsing while we land the rewrite. |
302 | | - <button id="cortex-graph-warn-close" aria-label="Dismiss" |
303 | | - style="position:absolute;top:4px;right:6px;width:22px;height:22px; |
304 | | - background:transparent;border:none;color:#FFB060;font-size:14px; |
305 | | - cursor:pointer;line-height:1;padding:0">×</button> |
306 | | -</div> |
307 | | -<script> |
308 | | -(function(){ |
309 | | - var b = document.getElementById('cortex-graph-warn-close'); |
310 | | - if (b) b.addEventListener('click', function() { |
311 | | - var w = document.getElementById('cortex-graph-warn'); |
312 | | - if (w) w.style.display = 'none'; |
313 | | - }); |
314 | | -})(); |
315 | | -</script> |
316 | | - |
317 | 222 | <div id="status-bar" class="hud-panel"> |
318 | 223 | <div class="status-dot"></div> |
319 | 224 | <span id="status-text">Initializing</span> |
|
0 commit comments