🎨 System Design Documentation

← Back to Master Directory

🗺️ 1. Global SPA View Routing Architecture

The platform is designed as a single-page web application featuring high-performance view swapping that completely avoids browser page reloads. Global window functions toggle visibility dynamically via showSection(sectionId).

🎛️ 2. Secondary Tab Navigation Control

To maximize cognitive scanning potential and prevent data clutter, psychometric analytics are cleanly split using a sub-tab navigation strip managed by switchAnalyticsTab(tabId):

🎯 latest-run-tab: Displays immediate accuracy tables, metrics, and layman interpretation vectors.
📈 timeline-trends-tab: Houses multi-axis canvas elements mapping long-term fluctuations longitudinally.
🔮 macro-clusters-tab: Appends continuous battery delta models and Bubble tracking charts.

🧱 3. Grid Row Component Hierarchy

The primary reporting board enforces strict bounding rules to cleanly align elements when active inside the layout canvas (max-width: 850px;):

🧠 Row 1: Executive Vectors Side-by-side metric tracking blocks highlighting Memory Sensitivity alongside Stroop latency parameters.
📊 Row 2: Signal Detection Space Full-width display container housing the custom ROC Strategy Curve chart module.
⏱️ Row 3: Cognitive Stamina Audit Long-form data containers rendering detailed multi-minute degradation profiles.
📋 Row 4: Historical Activity Log Ledger A minimalist chronological list compiling all completed non-battery sessions at the base of the canvas stack.

🎨 4. Production CSS Specifications

Unified interface tokens derived from your stylesheet layout schema:

/* Structural Action Cards */
.menu-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 12px;
  background-color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

/* Global Navigation Items */
.nav-links .nav-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  margin-left: 20px;
  cursor: pointer;
  opacity: 0.9;
}

/* High-Contrast Interactive Segmented Controls */
.db-toggle-btn {
  flex: 1;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.db-toggle-btn.active-s {
  background: #fff;
  color: #2b6cb0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

📡 5. Sandbox Template Clone & Render Pipeline

To separate raw structural code from execution string modifications, the dashboard features a dynamic layout reproduction cycle:

[HTML Sandbox Template Skeleton] ──(.cloneNode(true))──> [Dynamic Context Insertion]
                                                                │
 [Target Mid-Page Placement Zone] <──(.appendChild())───────────┘

🛡️ 6. Tokenized Performance Decomposers

System text blocks are compiled down to strict pipeline arrays to eliminate trace text errors or formatting leakages across the network bridge:

"CRITICAL | SENSORY SHIELD BREAKDOWN | Advice content text..."

The frontend runs a standard split transformation mapping text strings to variables natively:

const [statusType, statusHeading, systemAdviceText] = metricsPayload["prescription"].split("|");