From 582a4c619b91173075fbe6a06afac3c5d36b00a1 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 16 Feb 2026 12:46:45 +0000 Subject: [PATCH] feat: New MC sidebar - Projects, Tasks, Chat, Council, Calendar, Memory --- .../MissionControlDashboard.tsx | 563 +++++++++--------- 1 file changed, 284 insertions(+), 279 deletions(-) diff --git a/components/mission-control/MissionControlDashboard.tsx b/components/mission-control/MissionControlDashboard.tsx index ef6026b..bfa59c2 100644 --- a/components/mission-control/MissionControlDashboard.tsx +++ b/components/mission-control/MissionControlDashboard.tsx @@ -6,47 +6,70 @@ import { TaskStatus } from "@/lib/mission-control/types"; import VoiceChat from "./VoiceChat"; import AIManagement from "@/components/ai-management/AIManagement"; -interface ProjectSummary { +interface SidebarItem { id: string; name: string; - description: string; - status: "active" | "paused" | "completed"; - color: string; icon: string; + color?: string; + category: string; } -const projects: ProjectSummary[] = [ +interface SidebarCategory { + id: string; + name: string; + icon: string; + items: SidebarItem[]; +} + +const sidebarCategories: SidebarCategory[] = [ { - id: "sitemente", - name: "SiteMente", - description: "AI website platform for local businesses (B2B)", - status: "active", - color: "#ff7bc0", - icon: "🌐", + id: "projects", + name: "Projects", + icon: "🎯", + items: [ + { id: "sitemente", name: "SiteMente", icon: "🌐", color: "#ff7bc0", category: "projects" }, + { id: "holacompi", name: "HolaCompi", icon: "🤝", color: "#6366f1", category: "projects" }, + ], }, { - id: "holacompi", - name: "HolaCompi", - description: "AI ally for immigrants/consumers (B2C)", - status: "paused", - color: "#6366f1", - icon: "🤝", + id: "tasks", + name: "Tasks", + icon: "✓", + items: [ + { id: "all", name: "All Tasks", icon: "📋", category: "tasks" }, + ], }, { - id: "infrastructure", - name: "Infrastructure", - description: "Security, backups, APIs, and system config", - status: "active", - color: "#10b981", - icon: "🔒", + id: "chat", + name: "Chat", + icon: "💬", + items: [ + { id: "voice", name: "Voice Chat", icon: "🎤", category: "chat" }, + ], }, { - id: "horus", - name: "Horus AI", - description: "Manage my skills, APIs, and automation", - status: "active", - color: "#f59e0b", - icon: "🤖", + id: "council", + name: "Council", + icon: "🏛️", + items: [ + { id: "ai-settings", name: "AI Settings", icon: "🤖", category: "council" }, + ], + }, + { + id: "calendar", + name: "Calendar", + icon: "📅", + items: [ + { id: "brief", name: "Morning Brief", icon: "☀️", category: "calendar" }, + ], + }, + { + id: "memory", + name: "Memory", + icon: "🧠", + items: [ + { id: "logs", name: "Session Logs", icon: "📝", category: "memory" }, + ], }, ]; @@ -58,274 +81,256 @@ const statusConfig: Record = { paused: { label: "Paused", color: "text-gray-400" }, }; -type ViewType = "tasks" | "horus"; - export default function MissionControlDashboard() { - const { tasks, toggleTask, updateTaskStatus, getProjectProgress, getTasksByProject } = - useMissionControl(); + const { tasks, toggleTask, updateTaskStatus, getProjectProgress, getTasksByProject } = useMissionControl(); - const [selectedProject, setSelectedProject] = useState("sitemente"); + const [selectedItem, setSelectedItem] = useState("sitemente"); const [filter, setFilter] = useState("all"); - const [view, setView] = useState("tasks"); + const [expandedCategories, setExpandedCategories] = useState(["projects"]); - const projectTasks = getTasksByProject(selectedProject as any); + // Find selected item + let selectedCategory = sidebarCategories.find(c => c.items.some(i => i.id === selectedItem)); + let currentItem = selectedCategory?.items.find(i => i.id === selectedItem); + + const projectTasks = currentItem?.category === "projects" ? getTasksByProject(selectedItem as any) : tasks; const filteredTasks = filter === "all" ? projectTasks : projectTasks.filter((t) => t.status === filter); - const progress = getProjectProgress(selectedProject as any); + const progress = currentItem?.category === "projects" ? getProjectProgress(selectedItem as any) : 0; - const selectedProjectData = projects.find((p) => p.id === selectedProject)!; - - // If viewing Horus AI management - if (view === "horus") { - return ( -
- {/* Header */} -
-
-
-
- 👁️ -
-
-

Mission Control

-

Horus AI Management

-
-
- -
-
- -
- - - {/* Voice Chat */} -
- -
-
-
+ const toggleCategory = (catId: string) => { + setExpandedCategories(prev => + prev.includes(catId) ? prev.filter(id => id !== catId) : [...prev, catId] ); - } + }; + + // Render content based on selection + const renderContent = () => { + const category = currentItem?.category; + + if (category === "chat") { + return ( +
+ +
+ ); + } + + if (category === "council") { + return ( +
+ +
+ ); + } + + if (category === "calendar") { + return ( +
+
+

📅 Morning Brief

+

Daily intelligence at 6am CET

+ + ☀️ Open Calendar + +
+ +
+ ); + } + + if (category === "memory") { + return ( +
+

🧠 Memory & Logs

+

Session history and daily logs

+
+

Memory is stored in:

+
    +
  • • localStorage (browser)
  • +
  • • GitHub repo (daily commits)
  • +
  • • MEMORY.md (curated)
  • +
+
+
+ ); + } + + // Default: Tasks view + return renderTasksView(); + }; + + const renderTasksView = () => ( + <> + {/* Stats Row */} +
+ {(["todo", "in_progress", "done", "blocked"] as TaskStatus[]).map((status) => { + const count = projectTasks.filter((t) => t.status === status).length; + const config = statusConfig[status]; + return ( + + ); + })} +
+ + {/* Task List */} +
+
+
+

{currentItem?.name || "Tasks"}

+

+ {filteredTasks.filter((t) => t.status === "done").length} / {filteredTasks.length} done +

+
+
+ +
+ {filteredTasks.map((task) => { + const config = statusConfig[task.status]; + return ( +
+ + +
+

+ {task.title} +

+
+ + {task.priority === "critical" && ( + CRITICAL + )} + + +
+ ); + })} +
+ + {filteredTasks.length === 0 && ( +
+ No tasks match the current filter. +
+ )} +
+ + ); return ( -
- {/* Header */} -
-
-
-
- 👁️ -
-
-

Mission Control

-

SiteMente + HolaCompi + Infrastructure

-
+
+ {/* Left Sidebar */} + + + {/* Main Content */} +
+ {/* Header */} +
+
+

+ {currentItem?.icon} + {currentItem?.name} +

+

+ {currentItem?.category === "projects" ? `${progress}% complete` : `${tasks.length} total tasks`} +

+
+ {currentItem?.category === "projects" && (
-
-
-
+ )} + -
-
- {/* Left Sidebar */} - - - {/* Main Content */} -
- {/* Project Tabs */} -
- {projects.filter(p => p.id !== "horus").map((project) => { - const p = getProjectProgress(project.id as any); - return ( - - ); - })} -
- - {/* Stats Row */} -
- {(["todo", "in_progress", "done", "blocked"] as TaskStatus[]).map((status) => { - const count = projectTasks.filter((t) => t.status === status).length; - const config = statusConfig[status]; - return ( - - ); - })} -
- - {/* Task List */} -
-
-
-

{selectedProjectData?.name} Tasks

-

- {filteredTasks.filter((t) => t.status === "done").length} / {filteredTasks.length} done -

-
-
- -
- {filteredTasks.map((task) => { - const config = statusConfig[task.status]; - return ( -
- - -
-

- {task.title} -

-
- - {task.priority === "critical" && ( - - CRITICAL - - )} - - -
- ); - })} -
- - {filteredTasks.length === 0 && ( -
- No tasks match the current filter. -
- )} -
- - {/* Voice Chat */} -
- -
-
-
-
+ {/* Content */} + {renderContent()} +
); }