Skip to main content

Terminal UI Architecture

The frontend is a single-pane terminal-style interface. No scrolling, no route changes — everything happens within one fixed viewport through screen transitions.

Layout Structure

┌─────────────────────────────────────┐
│ TerminalHeader (h-12, fixed) │ ← Email, logout, theme toggle
├─────────────────────────────────────┤
│ FourSquares (h-auto) │ ← QUOTES | SPEAKERS | DATA | AGENTS
│ ┌────────┐ ┌────────┐ │ Thread-scoped counts
│ │ QUOTES │ │SPEAKERS│ │
│ │ 47 │ │ 12 │ │
│ └────────┘ └────────┘ │
│ ┌────────┐ ┌────────┐ │
│ │ DATA │ │ AGENTS │ │
│ │ 8 │ │ 2 │ │
│ └────────┘ └────────┘ │
├─────────────────────────────────────┤
│ │
│ Terminal Viewport (flex-1) │ ← Dynamic content, NO SCROLL
│ │
│ Renders current screen: │
│ boot → search-input → trace → │
│ synthesis → detail screens │
│ │
├─────────────────────────────────────┤
│ BitTextarea (search input) │ ← Always visible, 2-4 lines
│ "What do Bitcoiners believe..." │
└─────────────────────────────────────┘

Screen State Machine

All 17 Screens

#ScreenDescription
1boot8-bit Bitcoin animation + curated quote (2-3 sec)
2search-inputMode picker (Direct/Playbook) + recent searches
3traceReal-time pipeline visualization (EMBED → SCAN → SYNTH)
4synthesisAgent answer with clickable speakers, sources
5quotesThread belief cards, paginated, simple filters
6beliefFull quote + ontology tree + related
7speakersThread speakers with tier badges
8speakerProfile + stats + top beliefs + connections
9dataSession stats + accumulated totals
10agents2x2 agent cards (Direct, Playbook, Oracle, Jackal)
11playbook4-lens breakdown + synthesis
12shareThread published with shareable link
13oracleOracle agent info (planned)
14jackalJackal agent info (planned)
15mcpMCP infrastructure info
16threadsThread management list
17top-threadsPopular community threads

State Management (Zustand)

Key Patterns:

  • searchNonce — incrementing counter triggers new search (not the query string itself)
  • screenHistory — stack enables goBack() without losing context
  • squareCounts — always scoped to active thread, reset on thread switch
  • URL sync — debounced 100ms, bidirectional with ?screen=, ?q=, ?thread=

Component Hierarchy

8-Bit Retro Design System

The UI uses 8bitcn/ui registry components with a retro arcade aesthetic:

ElementStyle
ColorsBitcoin orange (#F7931A), dark navy (#1a1a2e)
FontsSpace Grotesk (sans), JetBrains Mono (mono), Press Start 2P (pixel)
BordersPixel-art borders on TerminalPanel
BadgesTier system: Legendary (gold), Epic (teal), Rare (purple), Common (orange)
AnimationsBoot sequence, pipeline stages, card fade-ins
Cards8-bit Card component with glow effects

No-Scroll Constraint

The terminal viewport never scrolls. Content must fit:

.main-container {
height: 100dvh;
overflow: hidden;
display: flex;
flex-direction: column;
}

.terminal-viewport {
flex: 1;
min-height: 0; /* critical for flex children */
overflow: hidden; /* no scroll */
}

Content that exceeds viewport is handled by:

  • Pagination — belief cards paginate, not scroll
  • Truncation — long text gets ellipsis
  • Compression — previous results compress on follow-up
  • Screen transitions — drill down via screen change, not expansion