From ddbdbc7d440457057dfa233b538f28571cf00023 Mon Sep 17 00:00:00 2001 From: Iqbal Date: Tue, 27 Oct 2026 15:57:10 +0700 Subject: [PATCH] Add a Production dashboard with an animated knowledge graph The sidebar now groups Production under Dashboard and the four existing pages under Settings, and Production is the landing page. It shows content in progress, material, content made, approved and LMS-ready counts, plus a knowledge graph linking Brain documents, results, found sources and schedules, with the schedule and what is being made right now beside it. Co-Authored-By: Claude Opus 5.5 --- src/App.tsx | 4 +- src/components/AppLayout.tsx | 36 ++++-- src/components/Icon.tsx | 1 + src/express/graph.test.ts | 38 ++++++ src/express/graph.ts | 133 +++++++++++++++++++ src/i18n.ts | 72 ++++++++++- src/pages/Production.tsx | 244 +++++++++++++++++++++++++++++++++++ src/styles/theme.css | 96 ++++++++++++++ 8 files changed, 608 insertions(+), 16 deletions(-) create mode 100644 src/express/graph.test.ts create mode 100644 src/express/graph.ts create mode 100644 src/pages/Production.tsx diff --git a/src/App.tsx b/src/App.tsx index 70405e3..a17b464 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,6 +2,7 @@ import { Navigate, Route, Routes } from 'react-router-dom' import { AuthGate } from './auth/AuthGate' import { AppLayout } from './components/AppLayout' import { BrainPage } from './pages/Brain' +import { ProductionPage } from './pages/Production' import { InstructionPage } from './pages/Instruction' import { SchedulePage } from './pages/Schedule' import { ResultsPage } from './pages/Results' @@ -11,6 +12,7 @@ export default function App() { }> + } /> } /> } /> } /> @@ -21,7 +23,7 @@ export default function App() { } /> } /> } /> - } /> + } /> ) diff --git a/src/components/AppLayout.tsx b/src/components/AppLayout.tsx index 0d4af3f..fa967bc 100644 --- a/src/components/AppLayout.tsx +++ b/src/components/AppLayout.tsx @@ -7,13 +7,21 @@ import { workspaceCredits } from '../api/engine' import { Brand, Icon, type IconName } from './Icon' import { Toaster } from './Toast' -// Express Mode has four doors: feed the Brain, give an instruction, watch the schedule, collect results. -export const NAV: { to: string; label: Key; icon: IconName }[] = [ - { to: '/brain', label: 'nav.brain', icon: 'brain' }, - { to: '/instruction', label: 'nav.instruction', icon: 'spark' }, - { to: '/schedule', label: 'nav.schedule', icon: 'calendar' }, - { to: '/results', label: 'nav.results', icon: 'layers' }, +// The Production dashboard shows what Express is making; the four settings doors run it: +// feed the Brain, give an instruction, watch the schedule, collect results. +export const NAV_GROUPS: { label: Key; items: { to: string; label: Key; icon: IconName }[] }[] = [ + { label: 'nav.dashboard', items: [{ to: '/production', label: 'nav.production', icon: 'chart' }] }, + { + label: 'nav.settings', + items: [ + { to: '/brain', label: 'nav.brain', icon: 'brain' }, + { to: '/instruction', label: 'nav.instruction', icon: 'spark' }, + { to: '/schedule', label: 'nav.schedule', icon: 'calendar' }, + { to: '/results', label: 'nav.results', icon: 'layers' }, + ], + }, ] +export const NAV = NAV_GROUPS.flatMap(g => g.items) export function LanguageSwitch() { const lang = useLang() @@ -129,15 +137,17 @@ export function AppLayout() { return (