From 9e201259384e1324002cdf0626c90b95dcd8d7c1 Mon Sep 17 00:00:00 2001 From: Mark Henderson Date: Tue, 17 Mar 2026 16:03:19 -0700 Subject: [PATCH] revert: restore Atlas|PRD|Build|Growth|Assist|Analytics tab nav, remove COO sidebar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SECTIONS back to 6 tabs: Atlas → /overview, PRD, Build, Growth, Assist, Analytics - Remove persistent CooChat left panel and drag-resize handle - Content area is now full-width again (no 320px sidebar eating space) - Clean up unused imports (useSearchParams, useRouter, CooChat, Lucide icons, TOOLS constant) Made-with: Cursor --- components/layout/project-shell.tsx | 244 ++++++---------------------- 1 file changed, 46 insertions(+), 198 deletions(-) diff --git a/components/layout/project-shell.tsx b/components/layout/project-shell.tsx index 89eac67..e301930 100644 --- a/components/layout/project-shell.tsx +++ b/components/layout/project-shell.tsx @@ -1,12 +1,10 @@ "use client"; -import { usePathname, useSearchParams, useRouter } from "next/navigation"; -import { ReactNode, Suspense, useRef, useState, useCallback } from "react"; +import { usePathname } from "next/navigation"; +import { ReactNode, Suspense } from "react"; import Link from "next/link"; import { signOut, useSession } from "next-auth/react"; -import { CooChat } from "./coo-chat"; import { Toaster } from "sonner"; -import { MonitorPlay, ListChecks, Code2, Palette, Cloud } from "lucide-react"; interface ProjectShellProps { children: ReactNode; @@ -24,33 +22,15 @@ interface ProjectShellProps { creationMode?: "fresh" | "chat-import" | "code-import" | "migration"; } -const CHAT_W_DEFAULT = 320; -const CHAT_W_MIN = 200; -const CHAT_W_MAX = 560; - const SECTIONS = [ - { id: "build", label: "Build", path: "build" }, - { id: "market", label: "Market", path: "growth" }, - { id: "assist", label: "Assist", path: "assist" }, + { id: "overview", label: "Atlas", path: "overview" }, + { id: "prd", label: "PRD", path: "prd" }, + { id: "build", label: "Build", path: "build" }, + { id: "growth", label: "Growth", path: "growth" }, + { id: "assist", label: "Assist", path: "assist" }, + { id: "analytics", label: "Analytics", path: "analytics" }, ] as const; -// Each tool maps to a section param on the build page -const TOOLS = [ - { id: "tasks", Icon: ListChecks, title: "Tasks", section: "tasks" }, - { id: "preview", Icon: MonitorPlay, title: "Preview", section: "preview" }, - { id: "code", Icon: Code2, title: "Code", section: "code" }, - { id: "design", Icon: Palette, title: "Design", section: "layouts" }, - { id: "backend", Icon: Cloud, title: "Backend", section: "infrastructure" }, -]; - -// Maps URL section → tool id (for active highlight) -const SECTION_TO_TOOL: Record = { - preview: "preview", - tasks: "tasks", - code: "code", - layouts: "design", - infrastructure: "backend", -}; function ProjectShellInner({ children, @@ -59,56 +39,21 @@ function ProjectShellInner({ projectName, }: ProjectShellProps) { const pathname = usePathname(); - const searchParams = useSearchParams(); - const router = useRouter(); const { data: session } = useSession(); - const [chatWidth, setChatWidth] = useState(CHAT_W_DEFAULT); - const dragging = useRef(false); - const startX = useRef(0); - const startW = useRef(0); - - const onDragStart = useCallback((e: React.MouseEvent) => { - dragging.current = true; - startX.current = e.clientX; - startW.current = chatWidth; - document.body.style.cursor = "col-resize"; - document.body.style.userSelect = "none"; - - const onMove = (e: MouseEvent) => { - if (!dragging.current) return; - const delta = e.clientX - startX.current; - setChatWidth(Math.min(CHAT_W_MAX, Math.max(CHAT_W_MIN, startW.current + delta))); - }; - const onUp = () => { - dragging.current = false; - document.body.style.cursor = ""; - document.body.style.userSelect = ""; - document.removeEventListener("mousemove", onMove); - document.removeEventListener("mouseup", onUp); - }; - document.addEventListener("mousemove", onMove); - document.addEventListener("mouseup", onUp); - }, [chatWidth]); - const activeSection = - pathname?.includes("/build") ? "build" : - pathname?.includes("/growth") ? "market" : - pathname?.includes("/assist") ? "assist" : - "build"; - - const urlSection = searchParams.get("section") ?? "code"; - const activeTool = SECTION_TO_TOOL[urlSection] ?? "code"; + pathname?.includes("/overview") ? "overview" : + pathname?.includes("/prd") ? "prd" : + pathname?.includes("/build") ? "build" : + pathname?.includes("/growth") ? "growth" : + pathname?.includes("/assist") ? "assist" : + pathname?.includes("/analytics") ? "analytics" : + "overview"; const userInitial = ( session?.user?.name?.[0] ?? session?.user?.email?.[0] ?? "?" ).toUpperCase(); - const handleToolClick = (toolSection: string) => { - // Always navigate to the build page with the appropriate section - router.push(`/${workspace}/project/${projectId}/build?section=${toolSection}`, { scroll: false }); - }; - return ( <>
- {/* Left — aligns with chat panel */} + {/* Logo + project name */}
{projectName}
- {/* Right — aligns with content panel */} -
- - {/* Pills + tool icons grouped together */} -
- - {/* Section pills: Build | Market | Assist */} - {SECTIONS.map(s => { - const isActive = activeSection === s.id; - return ( - { if (!isActive) (e.currentTarget as HTMLElement).style.background = "#f6f4f0"; }} - onMouseLeave={e => { if (!isActive) (e.currentTarget as HTMLElement).style.background = "transparent"; }} - > - {s.label} - - ); - })} - - {/* Divider */} -
- - {/* Tool icons — toggle the main content view */} - {TOOLS.map(({ id, Icon, title, section }) => { - const isActive = activeTool === id; - return ( - - ); - })} -
+ {/* Tab nav */} +
+ {SECTIONS.map(s => { + const isActive = activeSection === s.id; + return ( + { if (!isActive) (e.currentTarget as HTMLElement).style.background = "#f6f4f0"; }} + onMouseLeave={e => { if (!isActive) (e.currentTarget as HTMLElement).style.background = "transparent"; }} + > + {s.label} + + ); + })} {/* Spacer */}
@@ -243,56 +138,9 @@ function ProjectShellInner({
- {/* ── Main area ── */} -
- - {/* Left: Assist chat — persistent */} -
-
- -
-
Assist
-
Your product COO
-
-
- -
- - {/* Drag handle */} -
(e.currentTarget.style.background = "#e8e4dc")} - onMouseLeave={e => (e.currentTarget.style.background = "transparent")} - /> - - {/* Right: content */} -
- {children} -
+ {/* ── Full-width content ── */} +
+ {children}