diff --git a/apps/web/src/app/(authenticated)/terminal/page.tsx b/apps/web/src/app/(authenticated)/terminal/page.tsx new file mode 100644 index 0000000..915b9a3 --- /dev/null +++ b/apps/web/src/app/(authenticated)/terminal/page.tsx @@ -0,0 +1,63 @@ +"use client"; + +/** + * Terminal page — dedicated full-screen terminal route at /terminal. + * + * Renders the TerminalPanel component filling the available content area. + * The panel is always open on this page; there is no close action since + * the user navigates away using the sidebar instead. + */ + +import { useState, useEffect } from "react"; +import type { ReactElement } from "react"; +import { TerminalPanel } from "@/components/terminal"; +import { getAccessToken } from "@/lib/auth-client"; + +export default function TerminalPage(): ReactElement { + const [token, setToken] = useState(""); + + // Resolve the access token once on mount. The WebSocket connection inside + // TerminalPanel uses this token for authentication. + useEffect((): void => { + getAccessToken() + .then((t) => { + setToken(t ?? ""); + }) + .catch((err: unknown) => { + console.error("[TerminalPage] Failed to retrieve access token:", err); + }); + }, []); + + return ( + <> + {/* Override TerminalPanel inline height so it fills the page */} + + +
+ { + /* No-op: on the dedicated terminal page the panel is always open. + Users navigate away using the sidebar rather than closing the panel. */ + }} + token={token} + className="terminal-page-panel" + /> +
+ + ); +} diff --git a/apps/web/src/components/layout/AppSidebar.tsx b/apps/web/src/components/layout/AppSidebar.tsx index 67ea1ec..8be56ff 100644 --- a/apps/web/src/components/layout/AppSidebar.tsx +++ b/apps/web/src/components/layout/AppSidebar.tsx @@ -254,7 +254,7 @@ const NAV_GROUPS: NavGroup[] = [ badge: { label: "live", pulse: true }, }, { - href: "#terminal", + href: "/terminal", label: "Terminal", icon: , },