diff --git a/packages/frontend/src/layouts/IDELayout.tsx b/packages/frontend/src/layouts/IDELayout.tsx index e06d8a0..384715a 100644 --- a/packages/frontend/src/layouts/IDELayout.tsx +++ b/packages/frontend/src/layouts/IDELayout.tsx @@ -5,17 +5,18 @@ import { useWebSocket } from "../hooks/useWebSocket"; import { useTheme } from "../hooks/useTheme"; const NAV_ITEMS = [ - { path: "/", label: "Home" }, - { path: "/editor", label: "Editor" }, - { path: "/build", label: "Build" }, - { path: "/server", label: "Server" }, - { path: "/toolset", label: "Toolset" }, - { path: "/repos", label: "Repos" }, + { path: "/editor", label: "Editor", icon: "\u270E" }, + { path: "/toolset", label: "Toolset", icon: "\u2699" }, + { path: "/build", label: "Build", icon: "\u2692" }, + { path: "/server", label: "Server", icon: "\u25B6" }, + { path: "/repos", label: "Repos", icon: "\u2387" }, + { path: "/settings", label: "Settings", icon: "\u2318" }, ]; export function IDELayout({ sidebar }: { sidebar?: React.ReactNode }) { const [terminalOpen, setTerminalOpen] = useState(false); const [upstreamBehind, setUpstreamBehind] = useState(0); + const [pendingToolset, setPendingToolset] = useState(0); const location = useLocation(); const { subscribe } = useWebSocket(); const { theme, toggleTheme } = useTheme(); @@ -30,64 +31,109 @@ export function IDELayout({ sidebar }: { sidebar?: React.ReactNode }) { }, [subscribe]); useEffect(() => { - if (location.pathname === "/repos") { - setUpstreamBehind(0); - } + return subscribe("toolset:changes", (event) => { + const data = event.data as { count?: number }; + if (data.count !== undefined) setPendingToolset(data.count); + }); + }, [subscribe]); + + useEffect(() => { + if (location.pathname === "/repos") setUpstreamBehind(0); }, [location.pathname]); + useEffect(() => { + if (location.pathname === "/toolset") setPendingToolset(0); + }, [location.pathname]); + + const getBadge = (path: string): number => { + if (path === "/repos") return upstreamBehind; + if (path === "/toolset") return pendingToolset; + return 0; + }; + return ( -
-
+ {/* Left sidebar nav */} +
+ - + + {/* Main content area */}
+
+
+ + Layonara Forge + +
+
+
+
{sidebar && (