import { useState } from "react"; import { ConsoleContext } from "./context"; import { useConsoleStore } from "./hooks/useConsoleStore"; import { useAutoRefresh, useIntervalMs } from "./hooks/useAutoRefresh"; import IconRail, { type View } from "./components/IconRail"; import ApiKeySection from "./sections/ApiKeySection"; import AdminSection from "./sections/AdminSection"; import ProjectsSection from "./sections/ProjectsSection"; import EnvSection from "./sections/EnvSection"; import WorkersSection from "./sections/WorkersSection"; import SkillsSection from "./sections/SkillsSection"; import AutomationsSection from "./sections/AutomationsSection"; import TriageSection from "./sections/TriageSection"; import TaskListSection from "./sections/TaskListSection"; import ConversationSection from "./sections/ConversationSection"; import RightPanel from "./sections/RightPanel"; // Layout only, Muse web/desktop style: no big header bar. // Icon rail (56px) + left list (260px) + centre conversation (elastic, // content centred) + right panel (300px, profile/today/detail). The // centre top bar is minimal: a back arrow (back to the task view) on // the left, and, only when the right panel is closed, a button to // reopen it — the right panel's own X closes it. Selecting a task in // the left list switches the centre conversation and the right detail // to that task together; selecting a module switches the centre to // that module and the right detail to its context. export default function App() { const store = useConsoleStore(); const [view, setView] = useState("task"); const [rightOpen, setRightOpen] = useState(true); useAutoRefresh((selectFocused) => store.refreshAll(selectFocused), 10000); useIntervalMs(() => store.refreshSlow(), 60000); const centre = (() => { switch (view) { case "projects": return ; case "env": return ; case "workers": return ; case "skills": return ; case "automations": return ; case "triage": return ; case "admin": return ; case "key": return ; default: return ; } })(); return (
{rightOpen ? Codex 命令台 : ( )}
{centre}
{rightOpen ? ( ) : null}
); }