From 3015527b7552a2afa133b62c99737e5880fa85d6 Mon Sep 17 00:00:00 2001 From: besfeng23 <136943241+besfeng23@users.noreply.github.com> Date: Sat, 4 Jul 2026 03:42:13 +0800 Subject: [PATCH] feat: restore live Pandora dashboard --- components/pandora/AdaptiveProfileCard.tsx | 17 +++-- components/pandora/AskPandoraHero.tsx | 15 ++-- components/pandora/DiagnosticsCard.tsx | 7 +- components/pandora/MemorySpacesCard.tsx | 6 +- components/pandora/PandoraDashboard.tsx | 42 ++++++----- components/pandora/RecentEventsTimeline.tsx | 7 +- components/pandora/WorkQueueCard.tsx | 10 +-- components/pandora/mock-data.ts | 29 +++----- lib/services/pandora-dashboard-service.ts | 77 +++++++++++++------- tests/unit/pandora-dashboard-guard.test.ts | 26 +++++++ tests/unit/pandora-dashboard-service.test.ts | 37 +++++++++- tests/unit/pandora-dashboard-ui.test.tsx | 33 +++++++++ 12 files changed, 209 insertions(+), 97 deletions(-) create mode 100644 tests/unit/pandora-dashboard-guard.test.ts create mode 100644 tests/unit/pandora-dashboard-ui.test.tsx diff --git a/components/pandora/AdaptiveProfileCard.tsx b/components/pandora/AdaptiveProfileCard.tsx index 8e7db45..7861f25 100644 --- a/components/pandora/AdaptiveProfileCard.tsx +++ b/components/pandora/AdaptiveProfileCard.tsx @@ -1,10 +1,11 @@ import { MoreHorizontal, RefreshCw } from "lucide-react"; -import { profileSnapshot } from "./mock-data"; +import type { ProfileSnapshot } from "./types"; function ConfidenceRing({ value, label }: { value: number; label: string }) { + const safeValue = Math.max(0, Math.min(100, Number.isFinite(value) ? value : 0)); const radius = 42; const circumference = 2 * Math.PI * radius; - const offset = circumference * (1 - value / 100); + const offset = circumference * (1 - safeValue / 100); return (
Adaptive Profile
Adaptive Profile
{profileSnapshot.lastRefreshed}
{profile.lastRefreshed}
Ask Pandora
-This route is for layout review only. It does not present live memory health, retrieval scores, profile state, or queue activity until those claims are backed by implemented routes, database policy, and tests.
+{hero.description}
{warnings.join(" ")}
Diagnostics
Pending backend proof. Do not treat this UI as live engine evidence.
Diagnostics
{diagnostics.envelope.description}
Memory Spaces
Memory Spaces
Live Truth Boundary
-{dashboardData.hero.description}
-Live Snapshot
{dashboardData.diagnostics.envelope.description}
Operator Boundary
Recent Memory Events
{event.desc}
Recent Memory Events
{event.desc}
No timeline rows are fabricated.
Work Queue
{item.desc}
Work Queue
{item.desc}