Let me start by reading every current file carefully before touching anything.
I have a complete picture. Now I'll plan the upgrade carefully — building additive layers on top of the existing architecture rather than replacing anything.
Plan:
- Extend
sceneState & platformState — engineering scenario store, telemetry generator, fault injection, reasoning timeline
- Create
src/platform/ — scenario data, telemetry engine, fault system, XAI explanations
- Upgrade
App.tsx — add scenario selector, console mode toggle
- New
ConsoleLayout component wrapping everything in a live OS interface
- New
TelemetryPanel, ReasoningTimeline, FaultInjector, XAIPanel, EvidencePanel components
- Upgrade
Sections.tsx → StoryScroll — scenario-driven story (problem → recommendation)
- Extend
HolographicPanels to pull from live telemetry
Let's start building:
Now create the OS console layout — the framing that makes everything feel like a live engineering platform:
Now create the live telemetry panel — the main left-column HUD:
Now create the main console layout that holds everything together:
Now update the Sections.tsx to be scenario-driven scroll storytelling:
Now update App.tsx to wire the scenario selector and console layout:
Now update the global CSS to add scrollbar-hide and offset the Hero when the sidebar is present:
Now let's make the Overlay show live scenario data and remove the old "Enter the Console" button since we have the full console now:
Now update the HolographicPanels to read live data from platformState:
Let's build to check for errors:
Clean build. Now let me verify the HeroCanvas canvas gets offset when the sidebar is active. The 3D canvas is fullscreen and the sidebar overlays it — this is intentional (glassmorphism sidebar). But the hero content needs padding. Let me also wire the sceneState's activeFault into the EngineeringNodes so graph nodes react to faults:
Now let me patch EngineeringNodes to also read from platform to tint fault-affected nodes red/amber and pulse the reasoning node when active:
Build is clean. Let me verify the experience is complete by listing what's now in the project:
Let me do one final pass — update the HeroCanvas to add a small md:ml-[280px] shift on the canvas so the core is centered in the visible area (right of sidebar). This is done by adjusting the canvas container:
Now update the CameraRig to account for the sidebar offset so the core centers in the available viewport:
✅ Clean build at 457 KB gzipped. All existing components preserved and upgraded. Here's exactly what was built:
What Was Added (Zero Existing Components Removed)
src/platform/ — New Engineering OS Layer
scenarios.ts — The backbone. Five complete engineering scenarios, each with realistic sensor signals, subsystems, faults, evidence chains, engineering references, and XAI recommendations:
- Industrial Robot Arm — Bearing degradation, motor overheating (IEC 60034, SKF Atlas)
- Aircraft Hydraulic System — Hydraulic leak, pump cavitation (ATA 29, Boeing AMM, FAA AC)
- EV Battery Pack — Cell degradation, thermal runaway risk (ISO 6469, SAE J2464, UN ECE R100)
- Satellite Power System — Panel degradation, battery cell failure (ECSS, NASA GSFC)
- Drone Flight Controller — GPS degradation, motor imbalance (FAA AC 90-105B, EASA SC-VTOL)
platformState.ts — Singleton mutable store (no Redux needed). Drives: scenario switching, 10 Hz telemetry loop with realistic noise + anomaly drift, fault injection state machine with 8-phase reasoning timeline (Sensor Input → Understanding → Fault Detection → Classification → Research → Simulation → Validation → Recommendation), subsystem health degradation during faults.
usePlatform.ts — Lightweight React subscription hook. Re-renders only on notify() calls.
ScenarioSelector.tsx — Cinematic boot screen with 5 animated system cards. The user picks a system and the entire platform reconfigures.
ConsoleLayout.tsx — The engineering OS shell: collapsible left sidebar (desktop) + bottom drawer (mobile), 4-tab navigation (Telemetry / Reasoning / Fault Lab / Health), scenario quick-switcher, fault alert chip (top-right), live status strip.
TelemetryPanel.tsx — Live signals panel with SVG sparklines (40-point rolling history), anomaly highlighting, range bars, 10 Hz updates via useEffect.
ReasoningTimeline.tsx — Animated 8-step reasoning timeline. Each step activates in sequence with GSAP-like motion, shows elapsed time and confidence, fault severity badge with colour-coded borders.
FaultInjector.tsx — Fault cards with severity badges. Inject → watch reasoning start. After completion: full evidence chain, engineering references, and XAI recommendation displayed.
SubsystemHealth.tsx — All subsystems with animated health bars that degrade in real time during fault propagation.
Upgraded Existing Components
HolographicPanels.tsx — All 8 panels now read from platformState imperatively (useFrame → direct DOM mutation, no re-renders). Values: system health average, reasoning confidence, primary telemetry signal, simulation status, fault status, analysis progress, MTBF, decision confidence.
EngineeringNodes.tsx — Graph nodes now pulse/glow/spin faster during their corresponding reasoning phase. Fault-active nodes get white core + larger halo + faster ring rotation.
Overlay.tsx — Now scenario-aware: shows system name, active fault label, analysis progress, and contextual copy ("AEGIS is reasoning about the Robot — Bearing Degradation detected").
Sections.tsx → Scenario-driven scroll story with 9 chapters (Problem → Understanding → Diagnosis → Research → Reasoning → Simulation → Validation → Recommendation → Deployment), each populated from the active scenario's real data. Live telemetry mini-readout, evidence lists, and reference citations in the relevant chapters. Final CTA triggers a re-analysis.
CameraRig.tsx — Shifted camera X to center the core in the visible viewport (right of the 280px sidebar).
App.tsx — State machine: selector → active. Mounts ScenarioSelector as a fixed z-50 overlay, ConsoleLayout, and the full existing hero + scroll story below.
Files built: src/platform/scenarios.ts, src/platform/platformState.ts, src/platform/usePlatform.ts, src/platform/ScenarioSelector.tsx, src/platform/TelemetryPanel.tsx, src/platform/ReasoningTimeline.tsx, src/platform/FaultInjector.tsx, src/platform/SubsystemHealth.tsx, src/platform/ConsoleLayout.tsx, src/sections/Sections.tsx, src/App.tsx, src/index.css, src/hero/Overlay.tsx, src/hero/HolographicPanels.tsx, src/hero/EngineeringNodes.tsx, src/hero/HeroCanvas.tsx, src/hero/CameraRig.tsx