diff --git a/app/api/projects/[projectId]/advisor/route.ts b/app/api/projects/[projectId]/advisor/route.ts index b187b16..08f7e34 100644 --- a/app/api/projects/[projectId]/advisor/route.ts +++ b/app/api/projects/[projectId]/advisor/route.ts @@ -3,9 +3,7 @@ import { getServerSession } from 'next-auth'; import { authOptions } from '@/lib/auth/authOptions'; import { query } from '@/lib/db-postgres'; -const GOOGLE_API_KEY = process.env.GOOGLE_API_KEY ?? ''; -const MODEL = process.env.GEMINI_MODEL ?? 'gemini-2.0-flash-exp'; -const STREAM_URL = `https://generativelanguage.googleapis.com/v1beta/models/${MODEL}:streamGenerateContent?key=${GOOGLE_API_KEY}&alt=sse`; +const MODEL = process.env.GEMINI_MODEL ?? 'gemini-2.0-flash'; function buildSystemPrompt(projectData: Record): string { const name = (projectData.name as string) ?? 'this project'; @@ -57,6 +55,9 @@ export async function POST( return new Response('Unauthorized', { status: 401 }); } + const GOOGLE_API_KEY = process.env.GOOGLE_API_KEY ?? ''; + const STREAM_URL = `https://generativelanguage.googleapis.com/v1beta/models/${MODEL}:streamGenerateContent?key=${GOOGLE_API_KEY}&alt=sse`; + if (!GOOGLE_API_KEY) { return new Response('GOOGLE_API_KEY not configured', { status: 500 }); } diff --git a/components/layout/project-shell.tsx b/components/layout/project-shell.tsx index daa4b4d..71abb1c 100644 --- a/components/layout/project-shell.tsx +++ b/components/layout/project-shell.tsx @@ -23,12 +23,24 @@ interface ProjectShellProps { creationMode?: "fresh" | "chat-import" | "code-import" | "migration"; } -const TOP_NAV = [ +// Width of the left chat panel — must match in both the header and the body +const CHAT_W = 320; + +const SECTIONS = [ { id: "build", label: "Build", path: "build" }, { id: "market", label: "Market", path: "growth" }, { id: "assist", label: "Assist", path: "assist" }, ] as const; +// Tool icons shown to the right of section pills +const TOOLS = [ + { id: "preview", icon: "↗", label: "Preview", title: "Open preview" }, + { id: "tasks", icon: "≡", label: "Tasks", title: "Agent tasks" }, + { id: "code", icon: "", label: "Code", title: "Code" }, + { id: "design", icon: "◈", label: "Design", title: "Design" }, + { id: "backend", icon: "⬡", label: "Backend", title: "Backend / Infra" }, +] as const; + export function ProjectShell({ children, workspace, @@ -44,70 +56,126 @@ export function ProjectShell({ pathname?.includes("/assist") ? "assist" : "build"; - const userInitial = (session?.user?.name?.[0] ?? session?.user?.email?.[0] ?? "?").toUpperCase(); + const userInitial = ( + session?.user?.name?.[0] ?? session?.user?.email?.[0] ?? "?" + ).toUpperCase(); return ( <> -
+
- {/* ── Top navbar ── */} + {/* ── Top bar — split to align with panels below ── */}
- {/* Left: logo + project name */} - -
- VIBN + + {/* Left section — aligns with chat panel */} +
+ +
+ VIBN +
+ + + + {projectName} + +
+ + {/* Right section — aligns with content panel */} +
+ + {/* 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} + + ); + })}
- -
- {projectName} -
+ {/* Divider */} +
-
- - {/* Center: section tabs */} -
- {TOP_NAV.map(item => { - const isActive = activeSection === item.id; - return ( - + {TOOLS.map(t => ( +
+ {t.icon} + + ))} +
- {/* Right: user avatar */} -
+ {/* User avatar */}