diff --git a/frontend/src/features/projects/ProjectTabs.tsx b/frontend/src/features/projects/ProjectTabs.tsx index 33054bb..2bec108 100644 --- a/frontend/src/features/projects/ProjectTabs.tsx +++ b/frontend/src/features/projects/ProjectTabs.tsx @@ -1,9 +1,13 @@ /** * `ProjectTabs` — the project tab bar rendered below the app header. * - * Shows one tab per open project with a close control, and a "+" button to - * return to the launcher. Purely presentational: all state lives in the - * parent (ProjectsView via useProjects). + * Shows one tab per open project with a close control, and a "+" button to the + * right that opens the **Projects** panel (floating) — the single entry point + * for creating a project or switching to a known one (#26). Purely + * presentational: all state lives in the parent (ProjectsView via useProjects). + * + * The bar is always present (even with no open project) so the "+" stays + * reachable; the empty case shows a muted placeholder next to it. */ import type { TabItem } from "@/shared"; @@ -14,9 +18,10 @@ export interface ProjectTabsProps { activeTabId: string | null; onSelect: (id: string) => void; onClose: (id: string) => void; - /** Whether the launcher overlay is currently visible (no active tab). */ - showingLauncher: boolean; - onShowLauncher: () => void; + /** Whether the Projects panel is currently open (in any placement). */ + projectsPanelOpen: boolean; + /** Open the Projects panel (floating) — create/switch project. */ + onOpenProjectsPanel: () => void; className?: string; } @@ -25,31 +30,33 @@ export function ProjectTabs({ activeTabId, onSelect, onClose, - showingLauncher, - onShowLauncher, + projectsPanelOpen, + onOpenProjectsPanel, className, }: ProjectTabsProps) { - if (items.length === 0) return null; - return (
- + {items.length === 0 ? ( +

No open tabs.

+ ) : ( + + )} - ))} + {menu.items.map((item) => { + const hasSub = (item.submenu?.length ?? 0) > 0; + const subOpen = hasSub && openSubId === item.id; + return ( +
+ setOpenSubId(hasSub ? item.id : null) + } + > + + {subOpen && ( +
+ {item.submenu!.map((sub) => ( + + ))} +
+ )} +
+ ); + })}
)}