Komalpreet Kaur Claude Haiku 4.5 commited on
Commit
74b82ae
·
unverified ·
1 Parent(s): c73105f

feat: show blank slate on first load instead of demo graph

Browse files

Remove the demo brain anatomy visualization from initial state.
New users now see:
- Completely empty neural mesh on login
- Empty state message: 'Neural Mesh Idle - Start talking to build'
- Graph builds in real-time as user chats
- True 'baby brain' learning experience

The brain learns from scratch as the user interacts, not from predefined anatomy.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

frontend/src/components/KnowledgeGraph.css CHANGED
@@ -279,3 +279,67 @@
279
  line-height: 1.8;
280
  opacity: 0.7;
281
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  line-height: 1.8;
280
  opacity: 0.7;
281
  }
282
+
283
+ /* ── Empty State ── */
284
+ .graph-empty-state {
285
+ position: absolute;
286
+ inset: 0;
287
+ display: flex;
288
+ align-items: center;
289
+ justify-content: center;
290
+ z-index: 5;
291
+ background: linear-gradient(135deg, rgba(245, 242, 236, 0.5) 0%, rgba(250, 250, 248, 0.5) 100%);
292
+ }
293
+
294
+ [data-theme="dark"] .graph-empty-state {
295
+ background: linear-gradient(135deg, rgba(15, 15, 24, 0.5) 0%, rgba(22, 22, 31, 0.5) 100%);
296
+ }
297
+
298
+ .empty-state-content {
299
+ text-align: center;
300
+ display: flex;
301
+ flex-direction: column;
302
+ align-items: center;
303
+ gap: 16px;
304
+ background: rgba(255, 255, 255, 0.6);
305
+ border: 1px solid rgba(255, 255, 255, 0.6);
306
+ border-radius: 20px;
307
+ padding: 40px 60px;
308
+ backdrop-filter: blur(12px);
309
+ -webkit-backdrop-filter: blur(12px);
310
+ }
311
+
312
+ [data-theme="dark"] .empty-state-content {
313
+ background: rgba(25, 25, 40, 0.65);
314
+ border-color: rgba(255, 255, 255, 0.08);
315
+ }
316
+
317
+ .empty-state-icon {
318
+ font-size: 3.5rem;
319
+ opacity: 0.6;
320
+ animation: gentle-float 3s ease-in-out infinite;
321
+ }
322
+
323
+ @keyframes gentle-float {
324
+ 0%, 100% { transform: translateY(0px); }
325
+ 50% { transform: translateY(-12px); }
326
+ }
327
+
328
+ .empty-state-content h3 {
329
+ font-family: var(--font-display);
330
+ font-size: 1.2rem;
331
+ color: var(--text-0);
332
+ letter-spacing: 0.02em;
333
+ }
334
+
335
+ .empty-state-content p {
336
+ font-size: 0.85rem;
337
+ color: var(--text-1);
338
+ margin: 0;
339
+ }
340
+
341
+ .empty-state-subtext {
342
+ font-size: 0.75rem;
343
+ color: var(--text-2);
344
+ font-style: italic;
345
+ }
frontend/src/components/KnowledgeGraph.jsx CHANGED
@@ -125,11 +125,11 @@ function KnowledgeGraph({ highlightedNodes = [], currentUser, refreshTick }) {
125
  const data = await res.json();
126
 
127
  if (data.status === 'offline' || data.nodes.length === 0) {
128
- // Show brain anatomy demo so the graph is never empty
129
- setIsDemo(true);
130
- setGraphStatus('demo');
131
- setGraphData(DEMO_GRAPH);
132
- setStats({ nodes: DEMO_GRAPH.nodes.length, edges: DEMO_GRAPH.links.length });
133
  } else {
134
  setIsDemo(false);
135
  setGraphStatus('online');
@@ -150,10 +150,11 @@ function KnowledgeGraph({ highlightedNodes = [], currentUser, refreshTick }) {
150
  setStats({ nodes: data.nodes.length, edges: data.edges.length });
151
  }
152
  } catch {
153
- setIsDemo(true);
154
- setGraphStatus('demo');
155
- setGraphData(DEMO_GRAPH);
156
- setStats({ nodes: DEMO_GRAPH.nodes.length, edges: DEMO_GRAPH.links.length });
 
157
  }
158
  setLoading(false);
159
  // Recenter camera once force simulation has settled
@@ -330,6 +331,18 @@ function KnowledgeGraph({ highlightedNodes = [], currentUser, refreshTick }) {
330
  </div>
331
  </div>
332
 
 
 
 
 
 
 
 
 
 
 
 
 
333
  {/* Loading */}
334
  {loading && (
335
  <div className="graph-loading">
 
125
  const data = await res.json();
126
 
127
  if (data.status === 'offline' || data.nodes.length === 0) {
128
+ // Blank slate - no demo, just empty until user learns
129
+ setIsDemo(false);
130
+ setGraphStatus('empty');
131
+ setGraphData({ nodes: [], links: [] });
132
+ setStats({ nodes: 0, edges: 0 });
133
  } else {
134
  setIsDemo(false);
135
  setGraphStatus('online');
 
150
  setStats({ nodes: data.nodes.length, edges: data.edges.length });
151
  }
152
  } catch {
153
+ // Blank slate on error
154
+ setIsDemo(false);
155
+ setGraphStatus('empty');
156
+ setGraphData({ nodes: [], links: [] });
157
+ setStats({ nodes: 0, edges: 0 });
158
  }
159
  setLoading(false);
160
  // Recenter camera once force simulation has settled
 
331
  </div>
332
  </div>
333
 
334
+ {/* Empty state - blank slate waiting to learn */}
335
+ {!loading && graphData.nodes.length === 0 && (
336
+ <div className="graph-empty-state">
337
+ <div className="empty-state-content">
338
+ <div className="empty-state-icon">🧠</div>
339
+ <h3>Neural Mesh Idle</h3>
340
+ <p>Start talking to build your knowledge graph</p>
341
+ <p className="empty-state-subtext">Your brain learns as you interact</p>
342
+ </div>
343
+ </div>
344
+ )}
345
+
346
  {/* Loading */}
347
  {loading && (
348
  <div className="graph-loading">