import { NavLink, useLocation } from "@/lib/router"; import { ChatDetailSidebar } from "./chat/ChatDetailSidebar"; import { ChatSetupSidebar } from "./chat/ChatSetupNavigation"; import { Store, ShieldQuestion } from "lucide-react"; import { DEVELOPER_TABS, advancedTabHref, isExperimentalToolTab } from "@/pages/tools/tool-tabs"; import { useSmokeLabEnabled } from "@/hooks/useSmokeLabEnabled"; import { useReviewCount } from "@/pages/apps/useReviewCount"; import { SidebarNavItem } from "./SidebarNavItem"; import { contextualSidebarStyles } from "./contextual-sidebar-styles"; /** * Secondary sidebar for the Apps area. * * Connectors combines discovery, account management, and connection health. * Review keeps governed actions waiting on the user's approval. Advanced * developer surfaces remain hidden unless one is explicitly enabled. */ export function AppsSidebar() { const { pathname } = useLocation(); const reviewCount = useReviewCount(); const { enabled: smokeLabEnabled } = useSmokeLabEnabled(); const developerTabs = DEVELOPER_TABS.filter((tab) => { // Temporarily hide Gateways and Profiles until they are ready to ship. // Keep their tab definitions and routes intact so we can bring them back later. if (tab.key === "gateways" || tab.key === "profiles") return false; return !isExperimentalToolTab(tab.key) || smokeLabEnabled; }); if (pathname.endsWith("/apps/chat/connect")) return ; const chatDetail = pathname.match(/\/apps\/chat\/([^/]+)(?:\/(?:settings|access|conversations|activity)|\/reviews(?:\/[^/]+)?)?\/?$/); if (chatDetail) return ; return ( ); } /** Mobile collection navigation replaces the desktop Browse/Review rail. */ export function AppsMobileNav() { const reviewCount = useReviewCount(); const segmentClass = ({ isActive }: { isActive: boolean }) => `flex min-w-0 flex-1 items-center justify-center gap-2 rounded-md px-3 py-2 text-sm no-underline transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${isActive ? "bg-accent text-foreground" : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`; return ; }