AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(frontend): app sidebar layout with redesigned profile menu, org switcher & agent activity (#13628)
Abhimanyu Yadava45bcf08457e
diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsxindex 2c49169018..34d9f0b27c 100644--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx@@ -26,9 +26,11 @@ interface Props {export function PlatformChrome({ children }: Props) {const {showNewLayout,+ isNewLayoutActive,showTourSidebar,overlayInsetHeader,hasInsetHeaderTitle,+ isSettingsRoute,} = usePlatformChrome();const content = (@@ -55,7 +57,9 @@ export function PlatformChrome({ children }: Props) {if (showNewLayout) {return (- <SidebarProvider style={{ "--sidebar-width": "19rem" } as CSSProperties}>+ <SidebarProvider+ style={{ "--sidebar-width": "18.25rem" } as CSSProperties}+ ><AppSidebar /><SidebarInset className="bg-[#f9f9f9]"><header@@ -85,6 +89,19 @@ export function PlatformChrome({ children }: Props) {);}+ // Settings renders its own sidebar shell (with a Back link) — no top Navbar.+ // Only the new layout drops the Navbar here; classic users keep it below so+ // they don't lose global nav (wallet, account menu) or a way back on mobile.+ if (isSettingsRoute && isNewLayoutActive) {+ return (+ <main className="flex h-screen w-full flex-col">+ <AdminImpersonationBanner />+ <GlobalSearchOverlay />+ <section className="flex-1">{content}</section>+ </main>+ );+ }+return (<main className="flex h-screen w-full flex-col"><Navbar />diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/usePlatformChrome.test.ts b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/usePlatformChrome.test.tsindex 7ed8b4547f..2477b36049 100644--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/usePlatformChrome.test.ts+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/usePlatformChrome.test.ts@@ -71,6 +71,18 @@ describe("usePlatformChrome", () => {});});+ it("excludes /admin routes from the new layout but keeps the flag active", async () => {+ pathnameMock.mockReturnValue("/admin/marketplace");+ const { result } = renderHook(() => usePlatformChrome());++ await waitFor(() => {+ // The admin section brings its own sidebar, so the app sidebar shell is+ // suppressed even though the new-layout flag itself is active.+ expect(result.current.showNewLayout).toBe(false);+ expect(result.current.isNewLayoutActive).toBe(true);+ });+ });+it.each(["/reset-password","/auth/auth-code-error",diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.ts b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.tsindex 54e73f8bee..4656d4305b 100644--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.ts+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.ts@@ -9,9 +9,11 @@ import { getRouteTitle } from "./components/InsetHeaderTitle/InsetHeaderTitle";// Routes that must stay outside the new top-level sidebar layout. Login,// signup and onboarding already live in the (no-navbar) group. These// (platform) routes should not show the app sidebar — reset-password and the-// auth/error/unauthorized pages are all reachable while unauthenticated.+// auth/error/unauthorized pages are all reachable while unauthenticated, and+// /admin brings its own admin sidebar (see admin/layout.tsx).const NEW_LAYOUT_EXCLUDED_PREFIXES = ["/settings",+ "/admin","/reset-password","/auth/auth-code-error","/error",@@ -45,14 +47,24 @@ export function usePlatformChrome() {const isCopilotRoute =pathname === "/copilot" || Boolean(pathname?.startsWith("/copilot/"));+ // Settings brings its own sidebar (with a Back link), so it renders without+ // the top Navbar even though it opts out of the new app-sidebar layout.+ const isSettingsRoute =+ pathname === "/settings" || Boolean(pathname?.startsWith("/settings/"));+// Logged-out marketplace visitors get the tour demo sidebar as an upsell.// Waits for the session check so it never flashes at logged-in users.const showTourSidebar =isMounted && isMarketplaceRoute && !isUserLoading && !isLoggedIn;+ // The new layout is only active after mount (see hydration note above). This+ // is the flag on its own, independent of the per-route exclusions, so shells+ // for excluded routes (e.g. settings) can still gate their new-layout chrome.+ const isNewLayoutActive = isMounted && Boolean(isNewLayoutEnabled);+return {- showNewLayout:- isMounted && isNewLayoutEnabled && !isExcludedRoute && !showTourSidebar,+ showNewLayout: isNewLayoutActive && !isExcludedRoute && !showTourSidebar,+ isNewLayoutActive,// On copilot the inset header floats over the chat instead of stacking// above it, so messages scroll to the viewport top.overlayInsetHeader: isCopilotRoute,@@ -60,5 +72,6 @@ export function usePlatformChrome() {// below an empty strip; on mobile it stays for the sidebar trigger.hasInsetHeaderTitle: Boolean(getRouteTitle(pathname)),showTourSidebar,+ isSettingsRoute,};}diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/layout.test.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/layout.test.tsxindex d0ea04602b..0667c7aafc 100644--- a/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/layout.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/layout.test.tsx@@ -1,31 +1,22 @@import { render, screen } from "@/tests/integrations/test-utils";-import { describe, expect, it, vi } from "vitest";+import { describe, expect, it } from "vitest";import AdminLayout from "../layout";-vi.mock("@/components/__legacy__/Sidebar", () => ({- Sidebar: ({- linkGroups,- }: {- linkGroups: { links: { text: string }[] }[];- }) => (- <nav data-testid="sidebar">- {linkGroups[0].links.map((link) => (- <span key={link.text}>{link.text}</span>- ))}- </nav>- ),-}));+const ADMIN_LINKS = [+ { text: "Marketplace Management", href: "/admin/marketplace" },+ { text: "User Spending", href: "/admin/spending" },+ { text: "System Diagnostics", href: "/admin/diagnostics" },+ { text: "User Impersonation", href: "/admin/impersonation" },+ { text: "Rate Limits", href: "/admin/rate-limits" },+ { text: "Platform Costs", href: "/admin/platform-costs" },+ { text: "Execution Analytics", href: "/admin/execution-analytics" },+ { text: "Bot Analytics", href: "/admin/bots" },+ { text: "Block Cost Estimates", href: "/admin/block-cost-estimates" },+ { text: "Memory Inspector", href: "/admin/memory" },+ { text: "Admin User Management", href: "/admin/settings" },+];describe("AdminLayout", () => {- it("renders sidebar with System Diagnostics link", () => {- render(- <AdminLayout>- <div>Child Content</div>- </AdminLayout>,- );- expect(screen.getByText("System Diagnostics")).toBeDefined();- });-it("renders child content", () => {render(<AdminLayout>@@ -35,19 +26,17 @@ describe("AdminLayout", () => {expect(screen.getByText("Test Child")).toBeDefined();});- it("renders all admin navigation links", () => {+ it("renders every admin sidebar link with the correct href", () => {render(<AdminLayout><div /></AdminLayout>,);- expect(screen.getByText("Marketplace Management")).toBeDefined();- expect(screen.getByText("User Spending")).toBeDefined();- expect(screen.getByText("System Diagnostics")).toBeDefined();- expect(screen.getByText("User Impersonation")).toBeDefined();- expect(screen.getByText("Rate Limits")).toBeDefined();- expect(screen.getByText("Platform Costs")).toBeDefined();- expect(screen.getByText("Execution Analytics")).toBeDefined();- expect(screen.getByText("Admin User Management")).toBeDefined();+ const links = screen.getAllByRole("link");+ for (const { text, href } of ADMIN_LINKS) {+ const link = links.find((el) => el.getAttribute("href") === href);+ expect(link).toBeDefined();+ expect(link?.textContent).toContain(text);+ }});});diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/layout.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/layout.tsxindex 70d3fd7e4f..bd1f82dc83 100644--- a/autogpt_platform/frontend/src/app/(platform)/admin/layout.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/admin/layout.tsx@@ -1,14 +1,14 @@import { Sidebar } from "@/components/__legacy__/Sidebar";import {- Users,- CurrencyDollar,- MagnifyingGlass,- Gauge,- Receipt,- FileText,- Heartbeat,+ UsersIcon,+ CurrencyDollarIcon,+ MagnifyingGlassIcon,+ GaugeIcon,+ ReceiptIcon,+ FileTextIcon,+ HeartbeatIcon,CalculatorIcon,- Brain,+ BrainIcon,RobotIcon,} from "@phosphor-icons/react/dist/ssr";@@ -20,37 +20,37 @@ const sidebarLinkGroups = [{text: "Marketplace Management",href: "/admin/marketplace",- icon: <Users className="h-6 w-6" />,+ icon: <UsersIcon className="h-6 w-6" />,},{text: "User Spending",href: "/admin/spending",- icon: <CurrencyDollar className="h-6 w-6" />,+ icon: <CurrencyDollarIcon className="h-6 w-6" />,},{text: "System Diagnostics",href: "/admin/diagnostics",- icon: <Heartbeat className="h-6 w-6" />,+ icon: <HeartbeatIcon className="h-6 w-6" />,},{text: "User Impersonation",href: "/admin/impersonation",- icon: <MagnifyingGlass className="h-6 w-6" />,+ icon: <MagnifyingGlassIcon className="h-6 w-6" />,},{text: "Rate Limits",href: "/admin/rate-limits",- icon: <Gauge className="h-6 w-6" />,+ icon: <GaugeIcon className="h-6 w-6" />,},{text: "Platform Costs",href: "/admin/platform-costs",- icon: <Receipt className="h-6 w-6" />,+ icon: <ReceiptIcon className="h-6 w-6" />,},{text: "Execution Analytics",href: "/admin/execution-analytics",- icon: <FileText className="h-6 w-6" />,+ icon: <FileTextIcon className="h-6 w-6" />,},{text: "Bot Analytics",@@ -65,7 +65,7 @@ const sidebarLinkGroups = [{text: "Memory Inspector",href: "/admin/memory",- icon: <Brain className="h-6 w-6" />,+ icon: <BrainIcon className="h-6 w-6" />,},{text: "Admin User Management",@@ -82,7 +82,7 @@ export default function AdminLayout({children: React.ReactNode;}) {return (- <div className="flex min-h-screen w-full flex-col lg:flex-row">+ <div className="flex h-full w-full flex-col lg:flex-row"><Sidebar linkGroups={sidebarLinkGroups} /><div className="flex-1 pl-4">{children}</div></div>diff --git a/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/GlobalSearchOverlay.tsx b/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/GlobalSearchOverlay.tsxindex c6102f4da6..524d739e32 100644--- a/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/GlobalSearchOverlay.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/GlobalSearchOverlay.tsx@@ -7,11 +7,11 @@ import { GlobalSearchModal } from "./GlobalSearchModal";import { selectSearchResult } from "./selectSearchResult";import { useGlobalSearchStore } from "./useGlobalSearchStore";-// Mounted once in the platform layout so Cmd/Ctrl+K opens the search palette-// from any page. Renders a single modal instance driven by the shared store.+// Mounted once in the platform layout so Cmd/Ctrl+Shift+K opens the search+// palette from any page. Renders a single modal instance driven by the store.export function GlobalSearchOverlay() {// Search is a first-class part of the new layout (sidebar Search item +- // Cmd/Ctrl+K), so enable it whenever that layout is on, independent of the+ // Cmd/Ctrl+Shift+K), so enable it whenever that layout is on, independent of// chat-search flag that gates it in the classic layout.const isChatSearchEnabled = useGetFlag(Flag.CHAT_SEARCH);const isNewLayoutEnabled = useGetFlag(Flag.AUTOGPT_NEW_LAYOUT);@@ -38,13 +38,17 @@ export function GlobalSearchOverlay() {if (event.repeat) return;if (event.key.toLocaleLowerCase() !== "k") return;if (!event.metaKey && !event.ctrlKey) return;+ // The new layout binds Cmd/Ctrl+Shift+K; the classic chat-search path+ // keeps its original plain Cmd/Ctrl+K, so only require Shift on the new+ // layout to avoid changing the classic binding.+ if (isNewLayoutEnabled && !event.shiftKey) return;event.preventDefault();useGlobalSearchStore.getState().toggleSearch();}document.addEventListener("keydown", handleSearchShortcut);return () => document.removeEventListener("keydown", handleSearchShortcut);- }, [isEnabled]);+ }, [isEnabled, isNewLayoutEnabled]);if (!isEnabled) return null;diff --git a/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/__tests__/GlobalSearchOverlay.test.tsx b/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/__tests__/GlobalSearchOverlay.test.tsxindex 34f8c15ad9..f30ff1924a 100644--- a/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/__tests__/GlobalSearchOverlay.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/__tests__/GlobalSearchOverlay.test.tsx@@ -103,7 +103,7 @@ describe("GlobalSearchOverlay", () => {it("opens with Cmd+K, focuses the input, and shows recent chats", async () => {render(<GlobalSearchOverlay />);- fireEvent.keyDown(document, { key: "k", metaKey: true });+ fireEvent.keyDown(document, { key: "k", metaKey: true, shiftKey: true });const dialog = await screen.findByRole("dialog");const input = screen.getByRole("textbox", { name: /global search/i });@@ -111,11 +111,19 @@ describe("GlobalSearchOverlay", () => {expect(await within(dialog).findByText("Revenue forecast")).toBeDefined();});+ it("opens with plain Cmd+K on the classic chat-search path (no Shift required)", async () => {+ render(<GlobalSearchOverlay />);++ fireEvent.keyDown(document, { key: "k", metaKey: true });++ expect(await screen.findByRole("dialog")).toBeDefined();+ });+it("filters results, shows empty copy, and clears the query", async () => {const user = userEvent.setup();render(<GlobalSearchOverlay />);- fireEvent.keyDown(document, { key: "k", metaKey: true });+ fireEvent.keyDown(document, { key: "k", metaKey: true, shiftKey: true });await user.type(screen.getByRole("textbox", { name: /global search/i }),"forecast",@@ -157,7 +165,7 @@ describe("GlobalSearchOverlay", () => {it("closes the palette after navigation lands on a new route", async () => {const { rerender } = render(<GlobalSearchOverlay />);- fireEvent.keyDown(document, { key: "k", metaKey: true });+ fireEvent.keyDown(document, { key: "k", metaKey: true, shiftKey: true });expect(await screen.findByRole("dialog")).toBeDefined();mockPathname = "/library";@@ -172,7 +180,7 @@ describe("GlobalSearchOverlay", () => {const user = userEvent.setup();render(<GlobalSearchOverlay />);- fireEvent.keyDown(document, { key: "k", metaKey: true });+ fireEvent.keyDown(document, { key: "k", metaKey: true, shiftKey: true });const dialog = await screen.findByRole("dialog");await user.type(@@ -189,9 +197,9 @@ describe("GlobalSearchOverlay", () => {expect(screen.queryByRole("dialog")).toBeNull();});- fireEvent.keyDown(document, { key: "k", ctrlKey: true });+ fireEvent.keyDown(document, { key: "k", ctrlKey: true, shiftKey: true });expect(await screen.findByRole("dialog")).toBeDefined();- fireEvent.keyDown(document, { key: "k", ctrlKey: true });+ fireEvent.keyDown(document, { key: "k", ctrlKey: true, shiftKey: true });await vi.waitFor(() => {expect(screen.queryByRole("dialog")).toBeNull();});diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/SettingsSidebar.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/SettingsSidebar.test.tsxindex b04f6b2b13..8c1419716c 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/SettingsSidebar.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/SettingsSidebar.test.tsx@@ -53,10 +53,11 @@ describe("SettingsSidebar", () => {usePathnameMock.mockReturnValue("/settings/profile");});- it("renders SETTINGS header and all 6 nav items with correct hrefs", () => {+ it("renders a Back link to /copilot and all 6 nav items with correct hrefs", () => {render(<SettingsSidebar />);- expect(screen.getByText("SETTINGS")).toBeDefined();+ const back = screen.getByRole("link", { name: /back/i });+ expect(back.getAttribute("href")).toBe("/copilot");for (const { label, href } of expectedItems) {const link = screen.getByRole("link", { name: new RegExp(label, "i") });diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/SettingsSidebar.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/SettingsSidebar.tsxindex 8fa4b8fe9d..d110c5dac5 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/SettingsSidebar.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/SettingsSidebar.tsx@@ -1,6 +1,8 @@"use client";import { motion, useReducedMotion } from "framer-motion";+import Link from "next/link";+import { ArrowLeftIcon } from "@phosphor-icons/react";import { Text } from "@/components/atoms/Text/Text";import { useSettingsSidebar } from "./useSettingsSidebar";import { SettingsNavItem } from "./SettingsNavItem";@@ -26,13 +28,16 @@ export function SettingsSidebar() {transition={{ duration: 0.25, ease: [0, 0, 0.2, 1] as const }}className="hidden h-full w-[237px] shrink-0 overflow-y-auto border-r border-[#DADADC] bg-[#F9F9FA] px-[10px] pt-[13px] md:block">- <Text- variant="label"- as="span"- className="mb-[16px] block px-4 font-medium text-[#27272a]"+ <Link+ href="/copilot"+ aria-label="Back to home"+ className="mb-[16px] flex w-fit items-center gap-2 rounded-[8px] px-4 py-1 text-[#505057] transition-colors hover:text-[#1F1F20]">- SETTINGS- </Text>+ <ArrowLeftIcon size={16} weight="bold" />+ <Text variant="body" as="span" className="font-medium">+ Back+ </Text>+ </Link><motion.navvariants={container}initial="hidden"diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/layout.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/layout.tsxindex 4c071f493b..8a567df16c 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/layout.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/layout.tsx@@ -4,7 +4,6 @@ import { ReactNode } from "react";import { usePathname } from "next/navigation";import { motion, useReducedMotion } from "framer-motion";import { ScrollArea } from "@/components/ui/scroll-area";-import { NAVBAR_HEIGHT_PX } from "@/lib/constants";import { SettingsSidebar } from "./components/SettingsSidebar/SettingsSidebar";import { SettingsMobileNav } from "./components/SettingsMobileNav/SettingsMobileNav";@@ -13,10 +12,7 @@ export default function SettingsLayout({ children }: { children: ReactNode }) {const reduceMotion = useReducedMotion();return (- <div- className="flex w-full overflow-hidden bg-[#F9F9FA]"- style={{ height: `calc(100vh - ${NAVBAR_HEIGHT_PX}px)` }}- >+ <div className="flex h-full w-full overflow-hidden bg-[#F9F9FA]"><SettingsSidebar /><div className="flex flex-1 flex-col overflow-hidden"><SettingsMobileNav />diff --git a/autogpt_platform/frontend/src/components/__legacy__/ui/icons.tsx b/autogpt_platform/frontend/src/components/__legacy__/ui/icons.tsxindex cdc3abac7d..1bd1890deb 100644--- a/autogpt_platform/frontend/src/components/__legacy__/ui/icons.tsx+++ b/autogpt_platform/frontend/src/components/__legacy__/ui/icons.tsx@@ -1840,6 +1840,7 @@ export enum IconType {Chat,Billing,Help,+ WhatsNew,}export function getIconForSocial(diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsxindex ac34964076..7b8b28b6a6 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx@@ -21,20 +21,21 @@ import {FlowArrowIcon,FolderIcon,type Icon,- SparkleIcon,+ NotePencilIcon,SquaresFourIcon,StorefrontIcon,} from "@phosphor-icons/react";-import { Button } from "@/components/atoms/Button/Button";import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";+import { isEditableElement } from "@/lib/platform";import { cn } from "@/lib/utils";import { motion, useReducedMotion } from "framer-motion";import Link, { useLinkStatus } from "next/link";-import { usePathname } from "next/navigation";-import { ComponentProps, ReactNode, Suspense } from "react";+import { usePathname, useRouter } from "next/navigation";+import { ComponentProps, ReactNode, Suspense, useEffect } from "react";import { getSidebarItemVariants, sidebarContainerVariants } from "./animations";import { AppSidebarHeader } from "./components/AppSidebarHeader/AppSidebarHeader";import { RecentChats } from "./components/RecentChats/RecentChats";+import { ShortcutHint } from "./components/ShortcutHint/ShortcutHint";import { SidebarSearch } from "./components/SidebarSearch/SidebarSearch";import { SidebarUserActions } from "./components/SidebarUserActions/SidebarUserActions";@@ -83,7 +84,30 @@ function NewTaskIcon() {return <LoadingSpinner size="small" className="shrink-0" />;}- return <SparkleIcon className="size-4" />;+ return <NotePencilIcon className="size-5" />;+}++// New Task shares the nav-item styling with the main links so it sits in the+// same section with a uniform gap, instead of being a standalone CTA button.+function NewTaskItem() {+ const pathname = usePathname();++ return (+ <SidebarMenuItem>+ <SidebarMenuButton+ asChild+ tooltip="New Task"+ isActive={isLinkActive(pathname, "/copilot")}+ className="h-auto rounded-xl p-2 pl-3 font-normal data-[active=true]:!bg-zinc-100 data-[active=true]:font-normal group-data-[collapsible=icon]:!p-1.5 hover:!bg-zinc-100 [&>svg]:size-5"+ >+ <Link href="/copilot">+ <NewTaskIcon />+ <span className="truncate">New Task</span>+ <ShortcutHint letter="O" />+ </Link>+ </SidebarMenuButton>+ </SidebarMenuItem>+ );}function NavMenu({@@ -104,7 +128,7 @@ function NavMenu({asChildtooltip={link.name}isActive={isLinkActive(pathname, link.href)}- className="h-auto rounded-lg p-2 font-normal data-[active=true]:!bg-zinc-100 data-[active=true]:font-normal group-data-[collapsible=icon]:!p-1.5 hover:!bg-zinc-100 [&>svg]:size-5"+ className="h-auto rounded-xl p-2 pl-3 font-normal data-[active=true]:!bg-zinc-100 data-[active=true]:font-normal group-data-[collapsible=icon]:!p-1.5 hover:!bg-zinc-100 [&>svg]:size-5"><Link href={link.href}><link.icon className="size-5" />@@ -140,7 +164,7 @@ function CollapsibleNavGroup({><SidebarGroupLabelasChild- className="text-[13px] font-medium text-zinc-500"+ className="text-[13px] font-medium text-zinc-500 group-data-[collapsible=icon]:hidden"><CollapsibleTrigger>{label}@@ -176,6 +200,23 @@ type Props = ComponentProps<typeof Sidebar>;export function AppSidebar(props: Props) {const reduceMotion = useReducedMotion();const itemVariants = getSidebarItemVariants(!!reduceMotion);+ const router = useRouter();++ // New Task shortcut: Cmd/Ctrl+Shift+O opens a fresh chat on /copilot.+ useEffect(() => {+ function handleNewTaskShortcut(event: KeyboardEvent) {+ if (event.repeat) return;+ if (event.key.toLocaleLowerCase() !== "o") return;+ if (!event.metaKey && !event.ctrlKey) return;+ if (!event.shiftKey) return;+ if (isEditableElement(document.activeElement)) return;+ event.preventDefault();+ router.push("/copilot");+ }++ document.addEventListener("keydown", handleNewTaskShortcut);+ return () => document.removeEventListener("keydown", handleNewTaskShortcut);+ }, [router]);return (<Sidebar@@ -193,37 +234,17 @@ export function AppSidebar(props: Props) {className="flex min-h-0 flex-1 flex-col gap-2"><motion.div variants={itemVariants}>- <SidebarGroup className="mt-2 py-1 group-data-[collapsible=icon]:mt-0">- <SidebarGroupContent>- <Button- as="NextLink"- href="/copilot"- variant="primary"- size="small"- aria-label="New Task"- leftIcon={<NewTaskIcon />}- className={cn(- "relative h-10 w-full overflow-hidden",- "shadow-[inset_0_1px_0_rgba(255,255,255,0.18),0_4px_16px_-6px_rgba(139,92,246,0.45)]",- "transition-all duration-300",- "hover:-translate-y-px hover:shadow-[inset_0_1px_0_rgba(255,255,255,0.3),0_6px_22px_-6px_rgba(139,92,246,0.7)]",- "before:absolute before:inset-0 before:-translate-x-full before:bg-gradient-to-r before:from-transparent before:via-white/20 before:to-transparent before:transition-transform before:duration-700 before:ease-out hover:before:translate-x-full",- "motion-reduce:transition-none motion-reduce:before:hidden motion-reduce:hover:translate-y-0",- "group-data-[collapsible=icon]:size-8 group-data-[collapsible=icon]:min-w-0 group-data-[collapsible=icon]:px-0",- )}- >- <span className="truncate group-data-[collapsible=icon]:hidden">- New Task- </span>- </Button>- </SidebarGroupContent>- </SidebarGroup>- </motion.div>-- <motion.div variants={itemVariants}>- <SidebarGroup className="mt-2 py-1 group-data-[collapsible=icon]:mt-0">+ <SidebarGroup className="mt-0 py-1"><SidebarGroupContent>- <NavMenu links={MAIN_LINKS} leading={<SidebarSearch />} />+ <NavMenu+ links={MAIN_LINKS}+ leading={+ <>+ <NewTaskItem />+ <SidebarSearch />+ </>+ }+ /></SidebarGroupContent></SidebarGroup></motion.div>diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/AppSidebarHeader/AppSidebarHeader.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/AppSidebarHeader/AppSidebarHeader.tsxindex 4f43990db6..2894c76eeb 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/AppSidebarHeader/AppSidebarHeader.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/AppSidebarHeader/AppSidebarHeader.tsx@@ -16,19 +16,19 @@ export function AppSidebarHeader() {const isCollapsed = state === "collapsed";return (- <SidebarHeader className="mb-2.5 flex animate-fade-in flex-row items-center justify-between gap-2 p-2 group-data-[collapsible=icon]:flex-col">+ <SidebarHeader className="mb-1 flex animate-fade-in flex-row items-center justify-between gap-2 p-2 group-data-[collapsible=icon]:flex-col"><Linkhref="/copilot"aria-label="AutoGPT"className={cn("flex items-center",- isCollapsed && "group-focus-within:hidden group-hover:hidden",+ isCollapsed && "h-8 group-focus-within:hidden group-hover:hidden",)}>{isCollapsed ? (- <AutoGPTLogo hideText viewBox="47 -1 42 42" className="size-8" />+ <AutoGPTLogo hideText viewBox="47 -1 42 42" className="size-7" />) : (- <AutoGPTLogo className="ml-2.5 mt-2 h-10 w-auto" />+ <AutoGPTLogo className="-mt-1 ml-2.5 h-7 w-auto" />)}</Link>diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/ShortcutHint/ShortcutHint.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/ShortcutHint/ShortcutHint.tsxnew file mode 100644index 0000000000..e9b651a6d9--- /dev/null+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/ShortcutHint/ShortcutHint.tsx@@ -0,0 +1,36 @@+"use client";++import { useEffect, useState } from "react";+import { isMacPlatform } from "@/lib/platform";+import { cn } from "@/lib/utils";++interface Props {+ letter: string;+ className?: string;+}++export function ShortcutHint({ letter, className }: Props) {+ const [isMac, setIsMac] = useState(true);+ useEffect(() => setIsMac(isMacPlatform()), []);++ const keys = [isMac ? "⌘" : "Ctrl", "⇧", letter];++ return (+ <span+ aria-hidden+ className={cn(+ "ml-auto flex items-center gap-0.5 opacity-0 group-hover/menu-item:opacity-100 group-data-[collapsible=icon]:hidden",+ className,+ )}+ >+ {keys.map((key) => (+ <kbd+ key={key}+ className="rounded border border-zinc-300 bg-zinc-50 px-1.5 py-1 font-sans text-[0.7rem] leading-none text-zinc-700"+ >+ {key}+ </kbd>+ ))}+ </span>+ );+}diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarSearch/SidebarSearch.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarSearch/SidebarSearch.tsxindex ee08348eb7..1c8225467b 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarSearch/SidebarSearch.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarSearch/SidebarSearch.tsx@@ -3,6 +3,7 @@import { useGlobalSearchStore } from "@/app/(platform)/components/GlobalSearchModal/useGlobalSearchStore";import { SidebarMenuButton, SidebarMenuItem } from "@/components/ui/sidebar";import { MagnifyingGlassIcon } from "@phosphor-icons/react";+import { ShortcutHint } from "../ShortcutHint/ShortcutHint";export function SidebarSearch() {const openSearch = useGlobalSearchStore((state) => state.openSearch);@@ -12,10 +13,11 @@ export function SidebarSearch() {<SidebarMenuButtontooltip="Search"onClick={openSearch}- className="font-normal group-data-[collapsible=icon]:!p-1.5 hover:!bg-zinc-200 [&>svg]:size-5"+ className="h-auto rounded-xl p-2 pl-3 font-normal group-data-[collapsible=icon]:!p-1.5 hover:!bg-zinc-100 [&>svg]:size-5"><MagnifyingGlassIcon className="size-5" /><span className="truncate">Search</span>+ <ShortcutHint letter="K" /></SidebarMenuButton></SidebarMenuItem>);diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarUserActions/SidebarUserActions.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarUserActions/SidebarUserActions.tsxindex 3bdc24d821..270c8181fb 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarUserActions/SidebarUserActions.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarUserActions/SidebarUserActions.tsx@@ -2,24 +2,29 @@import { useGetV2GetUserProfile } from "@/app/api/__generated__/endpoints/store/store";import { okData } from "@/app/api/helpers";-import { UsageIndicator } from "@/app/(platform)/PlatformChrome/components/UsageIndicator/UsageIndicator";import {Tooltip,TooltipContent,TooltipTrigger,} from "@/components/atoms/Tooltip/BaseTooltip";import { AccountMenu } from "@/components/layout/Navbar/components/AccountMenu/AccountMenu";-import { AgentActivityDropdown } from "@/components/layout/Navbar/components/AgentActivityDropdown/AgentActivityDropdown";import { Wallet } from "@/components/layout/Navbar/components/Wallet/Wallet";import { getAccountMenuItems } from "@/components/layout/Navbar/helpers";-import { SidebarFooter } from "@/components/ui/sidebar";+import { SidebarFooter, useSidebar } from "@/components/ui/sidebar";+import {+ Tooltip as SidebarTooltip,+ TooltipContent as SidebarTooltipContent,+ TooltipTrigger as SidebarTooltipTrigger,+} from "@/components/ui/tooltip";import { isLogoutInProgress } from "@/lib/autogpt-server-api/helpers";import { useSupabase } from "@/lib/supabase/hooks/useSupabase";export function SidebarUserActions() {const { user, isLoggedIn, isUserLoading } = useSupabase();+ const { state } = useSidebar();+ const isCollapsed = state === "collapsed";const logoutInProgress = isLogoutInProgress();- const dynamicMenuItems = getAccountMenuItems(user?.role);+ const dynamicMenuItems = getAccountMenuItems(user?.role, true);const { data: profile, isLoading: isProfileLoading } = useGetV2GetUserProfile({@@ -35,25 +40,32 @@ export function SidebarUserActions() {const isLoadingProfile = isProfileLoading || isUserLoading;+ const accountMenu = (+ <AccountMenu+ userName={profile?.name || profile?.username}+ userEmail={user?.email}+ avatarSrc={profile?.avatar_url ?? ""}+ menuItemGroups={dynamicMenuItems}+ isLoading={isLoadingProfile}+ newLayout+ side="top"+ align="start"+ />+ );+return (- <SidebarFooter className="border-t border-zinc-100 px-4 shadow-[0_-2px_8px_rgba(0,0,0,0.04)]">+ <SidebarFooter className="border-t border-zinc-100 px-4"><div className="flex w-full items-center justify-between group-data-[collapsible=icon]:flex-col group-data-[collapsible=icon]:gap-1">- <Tooltip>- <TooltipTrigger asChild>- <div className="[&_button:hover]:bg-zinc-100 [&_button[data-state=open]]:bg-zinc-100 [&_button]:flex [&_button]:h-8 [&_button]:w-8 [&_button]:items-center [&_button]:justify-center [&_button]:rounded-lg [&_button]:bg-transparent [&_button]:p-0 [&_button]:transition-colors [&_svg]:!size-5">- <AgentActivityDropdown />- </div>- </TooltipTrigger>- <TooltipContent side="top">Agent activity</TooltipContent>- </Tooltip>- <Tooltip>- <TooltipTrigger asChild>- <div>- <UsageIndicator />- </div>- </TooltipTrigger>- <TooltipContent side="top">Today's usage</TooltipContent>- </Tooltip>+ {isCollapsed ? (+ <SidebarTooltip>+ <SidebarTooltipTrigger asChild>+ <div>{accountMenu}</div>+ </SidebarTooltipTrigger>+ <SidebarTooltipContent side="right">Account</SidebarTooltipContent>+ </SidebarTooltip>+ ) : (+ accountMenu+ )}{profile && (<Tooltip><TooltipTrigger asChild>@@ -64,20 +76,6 @@ export function SidebarUserActions() {<TooltipContent side="top">Credits</TooltipContent></Tooltip>)}- <Tooltip>- <TooltipTrigger asChild>- <div>- <AccountMenu- userName={profile?.name || profile?.username}- userEmail={user?.email}- avatarSrc={profile?.avatar_url ?? ""}- menuItemGroups={dynamicMenuItems}- isLoading={isLoadingProfile}- />- </div>- </TooltipTrigger>- <TooltipContent side="top">Account</TooltipContent>- </Tooltip></div></SidebarFooter>);diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarUserActions/__tests__/SidebarUserActions.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarUserActions/__tests__/SidebarUserActions.test.tsxindex 7bd00811f0..4990f9fd67 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarUserActions/__tests__/SidebarUserActions.test.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarUserActions/__tests__/SidebarUserActions.test.tsx@@ -11,10 +11,11 @@ vi.mock("@/lib/supabase/hooks/useSupabase", () => ({useSupabase: () => mockUseSupabase(),}));-vi.mock(- "@/components/layout/Navbar/components/AgentActivityDropdown/AgentActivityDropdown",- () => ({ AgentActivityDropdown: () => <div data-testid="agent-activity" /> }),-);+vi.mock("@/components/ui/sidebar", async (importOriginal) => {+ const actual = await importOriginal<object>();+ return { ...actual, useSidebar: () => ({ state: "expanded" }) };+});+vi.mock("@/components/layout/Navbar/components/Wallet/Wallet", () => ({Wallet: () => <div data-testid="wallet" />,}));@@ -26,10 +27,6 @@ vi.mock(),}),);-vi.mock(- "@/app/(platform)/PlatformChrome/components/UsageIndicator/UsageIndicator",- () => ({ UsageIndicator: () => <div data-testid="usage-indicator" /> }),-);beforeEach(() => {server.use(@@ -67,9 +64,9 @@ describe("SidebarUserActions", () => {});render(<SidebarUserActions />);- expect(screen.getByTestId("agent-activity")).toBeDefined();- expect(screen.getByTestId("usage-indicator")).toBeDefined();expect(screen.getByTestId("account-menu")).toBeDefined();expect(await screen.findByTestId("wallet")).toBeDefined();+ expect(screen.queryByTestId("agent-activity")).toBeNull();+ expect(screen.queryByTestId("usage-indicator")).toBeNull();});});diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/AccountMenu.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/AccountMenu.tsxindex a0c8f3cc6a..8bee172ba7 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/AccountMenu.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/AccountMenu.tsx@@ -6,6 +6,7 @@ import {} from "@/components/molecules/Popover/Popover";import * as React from "react";import { MenuItemGroup } from "../../helpers";+import { AccountMenuNewLayout } from "./AccountMenuNewLayout";import { AccountLogoutOption } from "./components/AccountLogoutOption";import { AccountMenuRow } from "./components/AccountMenuRow";import { InitialAvatar } from "./components/InitialAvatar";@@ -18,6 +19,12 @@ interface Props {hideNavBarUsername?: boolean;menuItemGroups: MenuItemGroup[];isLoading?: boolean;+ // New sidebar layout variant — gated behind the AUTOGPT_NEW_LAYOUT flag,+ // opted into only by the (flag-gated) sidebar. Classic Navbar keeps the+ // original menu below.+ newLayout?: boolean;+ side?: "top" | "right" | "bottom" | "left";+ align?: "start" | "center" | "end";}export function AccountMenu({@@ -26,9 +33,26 @@ export function AccountMenu({avatarSrc,menuItemGroups,isLoading = false,+ newLayout = false,+ side,+ align,}: Props) {const popupId = React.useId();+ if (newLayout) {+ return (+ <AccountMenuNewLayout+ userName={userName}+ userEmail={userEmail}+ avatarSrc={avatarSrc}+ menuItemGroups={menuItemGroups}+ isLoading={isLoading}+ side={side}+ align={align}+ />+ );+ }+return (<Popover><PopoverTrigger asChild>diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/AccountMenuNewLayout.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/AccountMenuNewLayout.tsxnew file mode 100644index 0000000000..da1e2498f5--- /dev/null+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/AccountMenuNewLayout.tsx@@ -0,0 +1,134 @@+import {+ Popover,+ PopoverContent,+ PopoverTrigger,+} from "@/components/molecules/Popover/Popover";+import * as React from "react";+import { MenuItemGroup } from "../../helpers";+import { AccountLogoutOption } from "./components/AccountLogoutOption";+import { AccountMenuActivityRow } from "./components/AccountMenuActivityRow";+import { AccountMenuHeader } from "./components/AccountMenuHeader";+import { AccountMenuRow } from "./components/AccountMenuRow";+import { InitialAvatar } from "./components/InitialAvatar";+import { getAccountMenuPhosphorIcon } from "./helpers";++interface Props {+ userName?: string;+ userEmail?: string;+ avatarSrc?: string;+ menuItemGroups: MenuItemGroup[];+ isLoading?: boolean;+ side?: "top" | "right" | "bottom" | "left";+ align?: "start" | "center" | "end";+}++export function AccountMenuNewLayout({+ userName,+ userEmail,+ avatarSrc,+ menuItemGroups,+ isLoading = false,+ side = "top",+ align = "start",+}: Props) {+ const popupId = React.useId();++ return (+ <Popover>+ <PopoverTrigger asChild>+ <button+ type="button"+ className="flex cursor-pointer items-center space-x-3 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-neutral-300"+ aria-label="Open profile menu"+ aria-controls={popupId}+ aria-haspopup="true"+ data-testid="profile-popout-menu-trigger"+ >+ <InitialAvatar src={avatarSrc} name={userName} className="h-8 w-8" />+ </button>+ </PopoverTrigger>++ <PopoverContent+ id={popupId}+ side={side}+ align={align}+ sideOffset={8}+ className="w-72 overflow-hidden rounded-2xl border border-neutral-200 bg-white px-0 py-2 shadow-lg"+ data-testid="account-menu-popover"+ >+ <div className="px-2">+ <AccountMenuHeader+ userName={userName}+ userEmail={userEmail}+ avatarSrc={avatarSrc}+ isLoading={isLoading}+ />+ </div>++ {menuItemGroups.map((group, groupIndex) => {+ const isLogoutGroup = group.items.some(+ (item) => item.text === "Log out",+ );+ const showDivider = groupIndex === 0 || isLogoutGroup;++ return (+ <React.Fragment key={`group-${groupIndex}`}>+ {showDivider && <div className="mx-3 my-1 h-px bg-neutral-200" />}+ <div className="px-2 py-1">+ <ul className="flex flex-col gap-0.5">+ {group.items.map((item, itemIndex) => {+ const key = `${groupIndex}-${itemIndex}-${item.text}`;+ const icon = getAccountMenuPhosphorIcon(+ item.icon,+ "regular",+ );++ if (item.text === "Log out") {+ return (+ <li key={key}>+ <AccountLogoutOption weight="regular" />+ </li>+ );+ }++ if (item.href) {+ return (+ <li key={key}>+ <AccountMenuRow+ as="link"+ href={item.href}+ external={item.external}+ icon={icon}+ label={item.text}+ newLayout+ />+ </li>+ );+ }++ return (+ <li key={key}>+ <AccountMenuRow+ as="button"+ onClick={item.onClick}+ icon={icon}+ label={item.text}+ newLayout+ />+ </li>+ );+ })}+ {groupIndex === 0 && (+ <li>+ <AccountMenuActivityRow />+ </li>+ )}+ </ul>+ </div>+ </React.Fragment>+ );+ })}+ </PopoverContent>+ </Popover>+ );+}diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/__tests__/AccountMenu.test.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/__tests__/AccountMenu.test.tsxindex 0653387d24..0707c72dac 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/__tests__/AccountMenu.test.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/__tests__/AccountMenu.test.tsx@@ -146,4 +146,44 @@ describe("AccountMenu", () => {expect(screen.getByTestId("profile-popout-menu-trigger")).toBeDefined();expect(screen.getAllByText("A").length).toBeGreaterThan(0);});++ test("new layout renders the organization switcher header trigger", () => {+ render(+ <AccountMenu+ userName="Ada"+ userEmail="[email protected]"+ menuItemGroups={baseGroups}+ newLayout+ />,+ );++ expect(screen.getByTestId("account-menu-org-trigger")).toBeDefined();+ });++ test("new layout renders the agent activity row trigger", () => {+ render(+ <AccountMenu+ userName="Ada"+ userEmail="[email protected]"+ menuItemGroups={baseGroups}+ newLayout+ />,+ );++ expect(screen.getByTestId("account-menu-activity-trigger")).toBeDefined();+ expect(screen.getByText("Activity")).toBeDefined();+ });++ test("classic layout does not render org/activity triggers", () => {+ render(+ <AccountMenu+ userName="Ada"+ userEmail="[email protected]"+ menuItemGroups={baseGroups}+ />,+ );++ expect(screen.queryByTestId("account-menu-org-trigger")).toBeNull();+ expect(screen.queryByTestId("account-menu-activity-trigger")).toBeNull();+ });});diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/__tests__/helpers.test.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/__tests__/helpers.test.tsxindex 8285da48c2..a49867d756 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/__tests__/helpers.test.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/__tests__/helpers.test.tsx@@ -1,6 +1,14 @@import { IconType } from "@/components/__legacy__/ui/icons";import { describe, expect, test } from "vitest";import { getAccountMenuPhosphorIcon } from "../helpers";+import {+ getAccountMenuItems,+ getAccountMenuOptionIcon,+} from "../../../helpers";++function flattenTexts(groups: ReturnType<typeof getAccountMenuItems>) {+ return groups.flatMap((group) => group.items.map((item) => item.text));+}describe("getAccountMenuPhosphorIcon", () => {test.each([@@ -11,6 +19,7 @@ describe("getAccountMenuPhosphorIcon", () => {IconType.Settings,IconType.Billing,IconType.Help,+ IconType.WhatsNew,IconType.LogOut,])("returns a Phosphor icon element for %s", (icon) => {const result = getAccountMenuPhosphorIcon(icon);@@ -22,3 +31,55 @@ describe("getAccountMenuPhosphorIcon", () => {expect(result).toBeNull();});});++describe("getAccountMenuItems", () => {+ test("new layout groups profile settings and a footer without Admin for non-admins", () => {+ const groups = getAccountMenuItems(undefined, true);+ const texts = flattenTexts(groups);++ expect(texts).toEqual(+ expect.arrayContaining([+ "Profile",+ "Settings",+ "Billing",+ "What's new",+ "Help & Docs",+ "Log out",+ ]),+ );+ expect(texts).not.toContain("Admin");+ });++ test("new layout adds an Admin entry for admin users", () => {+ const texts = flattenTexts(getAccountMenuItems("admin", true));++ expect(texts).toContain("Admin");+ expect(texts).toContain("Log out");+ });++ test("classic layout differs from the new layout grouping", () => {+ const classic = flattenTexts(getAccountMenuItems(undefined));+ const newLayout = flattenTexts(getAccountMenuItems(undefined, true));++ expect(classic).toContain("Profile");+ expect(newLayout).not.toEqual(classic);+ });+});++describe("getAccountMenuOptionIcon", () => {+ test.each([+ IconType.Edit,+ IconType.Settings,+ IconType.Billing,+ IconType.Help,+ IconType.WhatsNew,+ IconType.Sliders,+ IconType.LogOut,+ ])("returns an icon element for %s", (icon) => {+ expect(getAccountMenuOptionIcon(icon)).not.toBeNull();+ });++ test("falls back to a default icon for unmapped types", () => {+ expect(getAccountMenuOptionIcon(IconType.UploadCloud)).not.toBeNull();+ });+});diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountLogoutOption.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountLogoutOption.tsxindex 9e2afac94d..9a92ebdb12 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountLogoutOption.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountLogoutOption.tsx@@ -3,7 +3,11 @@ import { SignOutIcon } from "@phosphor-icons/react";import { useRouter } from "next/navigation";import { AccountMenuRow } from "./AccountMenuRow";-export function AccountLogoutOption() {+interface Props {+ weight?: "bold" | "regular";+}++export function AccountLogoutOption({ weight = "bold" }: Props) {const router = useRouter();function handleLogout() {@@ -15,8 +19,9 @@ export function AccountLogoutOption() {as="button"destructivelabel="Log out"+ newLayout={weight === "regular"}icon={- <SignOutIcon className="h-[18px] w-[18px] shrink-0" weight="bold" />+ <SignOutIcon className="h-[18px] w-[18px] shrink-0" weight={weight} />}onClick={handleLogout}/>diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuActivityRow.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuActivityRow.tsxnew file mode 100644index 0000000000..e6842e779a--- /dev/null+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuActivityRow.tsx@@ -0,0 +1,82 @@+"use client";++import {+ Popover,+ PopoverContent,+ PopoverTrigger,+} from "@/components/molecules/Popover/Popover";+import { CaretRightIcon, PulseIcon } from "@phosphor-icons/react";+import * as React from "react";+import { ActivityDropdown } from "../../AgentActivityDropdown/components/ActivityDropdown/ActivityDropdown";+import { formatNotificationCount } from "../../AgentActivityDropdown/helpers";+import { useAgentActivityDropdown } from "../../AgentActivityDropdown/useAgentActivityDropdown";++const rowClasses =+ "group relative flex w-full items-center gap-3 rounded-lg py-2 pl-3 pr-2 text-left text-sm font-normal text-neutral-700 outline-none transition-colors duration-200 ease-out hover:bg-neutral-100 focus-visible:bg-neutral-100 focus-visible:outline-none data-[state=open]:bg-neutral-100";++export function AccountMenuActivityRow() {+ const { activeExecutions, recentCompletions, recentFailures } =+ useAgentActivityDropdown();++ const popupId = React.useId();++ const totalCount =+ activeExecutions.length + recentCompletions.length + recentFailures.length;++ return (+ <Popover>+ <PopoverTrigger asChild>+ <button+ type="button"+ className={rowClasses}+ aria-controls={popupId}+ aria-haspopup="true"+ data-testid="account-menu-activity-trigger"+ >+ <span+ className="absolute left-0 top-1/2 h-5 w-[3px] -translate-y-1/2 rounded-full bg-neutral-900 opacity-0 transition-opacity duration-200 group-hover:opacity-100 group-focus-visible:opacity-100 group-data-[state=open]:opacity-100"+ aria-hidden="true"+ />+ <span className="relative z-10 flex shrink-0 items-center">+ <PulseIcon+ className="h-[18px] w-[18px] shrink-0"+ weight="regular"+ />+ </span>+ <span className="relative z-10 truncate">Activity</span>+ {totalCount > 0 && (+ <span+ data-testid="account-menu-activity-total"+ className="relative z-10 flex h-5 min-w-5 items-center justify-center rounded-full bg-neutral-200 px-1.5 text-[11px] font-semibold text-neutral-700"+ >+ {formatNotificationCount(totalCount)}+ </span>+ )}+ <span className="flex-1" aria-hidden="true" />+ <CaretRightIcon+ className="relative z-10 shrink-0 text-neutral-700"+ size={16}+ weight="regular"+ aria-hidden="true"+ />+ </button>+ </PopoverTrigger>++ <PopoverContent+ id={popupId}+ side="right"+ align="end"+ sideOffset={12}+ className="w-80 rounded-2xl border border-neutral-200 p-0 shadow-lg"+ data-testid="account-menu-activity-popover"+ >+ <ActivityDropdown+ activeExecutions={activeExecutions}+ recentCompletions={recentCompletions}+ recentFailures={recentFailures}+ newLayout+ />+ </PopoverContent>+ </Popover>+ );+}diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuHeader.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuHeader.tsxnew file mode 100644index 0000000000..635158aea6--- /dev/null+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuHeader.tsx@@ -0,0 +1,81 @@+"use client";++import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";+import {+ Popover,+ PopoverContent,+ PopoverTrigger,+} from "@/components/molecules/Popover/Popover";+import { CaretRightIcon } from "@phosphor-icons/react";+import * as React from "react";+import { AccountMenuOrgList } from "./AccountMenuOrgList";+import { InitialAvatar } from "./InitialAvatar";++interface Props {+ userName?: string;+ userEmail?: string;+ avatarSrc?: string;+ isLoading?: boolean;+}++export function AccountMenuHeader({+ userName,+ userEmail,+ avatarSrc,+ isLoading = false,+}: Props) {+ const popupId = React.useId();++ return (+ <Popover>+ <PopoverTrigger asChild>+ <button+ type="button"+ className="group flex w-full items-center gap-3 rounded-xl px-3 py-3 text-left outline-none transition-colors data-[state=open]:bg-neutral-100 hover:bg-neutral-100 focus-visible:bg-neutral-100"+ aria-controls={popupId}+ aria-haspopup="true"+ data-testid="account-menu-org-trigger"+ >+ <InitialAvatar src={avatarSrc} name={userName} className="h-8 w-8" />+ <div className="flex min-w-0 flex-1 flex-col gap-0.5">+ {isLoading || !userName || !userEmail ? (+ <>+ <Skeleton className="h-3.5 w-24" />+ <Skeleton className="h-3 w-32" />+ </>+ ) : (+ <>+ <span className="truncate text-sm font-semibold leading-tight text-neutral-900">+ {userName}+ </span>+ <span+ data-testid="account-menu-user-email"+ className="truncate text-sm leading-tight text-neutral-700"+ >+ {userEmail}+ </span>+ </>+ )}+ </div>+ <CaretRightIcon+ className="shrink-0 text-neutral-700"+ size={16}+ weight="regular"+ aria-hidden="true"+ />+ </button>+ </PopoverTrigger>++ <PopoverContent+ id={popupId}+ side="right"+ align="start"+ sideOffset={12}+ className="w-64 rounded-2xl border border-neutral-200 p-0 shadow-lg"+ data-testid="account-menu-org-popover"+ >+ <AccountMenuOrgList />+ </PopoverContent>+ </Popover>+ );+}diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuOrgList.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuOrgList.tsxnew file mode 100644index 0000000000..3190219070--- /dev/null+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuOrgList.tsx@@ -0,0 +1,115 @@+"use client";++import Avatar, {+ AvatarFallback,+ AvatarImage,+} from "@/components/atoms/Avatar/Avatar";+import { CheckIcon, GearSixIcon, PlusIcon } from "@phosphor-icons/react";+import Link from "next/link";+import { useOrgTeamSwitcher } from "../../OrgTeamSwitcher/useOrgTeamSwitcher";++export function AccountMenuOrgList() {+ const { orgs, teams, activeOrg, activeTeam, switchOrg, switchTeam } =+ useOrgTeamSwitcher();++ // UI-only for now. To wire this up: call the generated+ // `usePostV2CreateOrganization` hook (POST /api/orgs) with a+ // `CreateOrgRequest` ({ name, slug, description? }); on success invalidate+ // the org list query so `OrgTeamProvider` refetches GET /api/orgs, then+ // `switchOrg(newOrg.id)` to make the new org active.+ function handleCreateOrganization() {+ // TODO: connect to backend (usePostV2CreateOrganization) + revalidate orgs.+ }++ const createOrgButton = (+ <button+ type="button"+ className="flex w-full items-center gap-2 rounded-lg bg-neutral-100 px-2 py-1.5 text-sm text-neutral-700 hover:bg-neutral-200"+ onClick={handleCreateOrganization}+ data-testid="create-organization-button"+ >+ <span className="flex h-5 w-5 items-center justify-center">+ <PlusIcon size={14} />+ </span>+ <span className="flex-1 truncate text-left">Create organization</span>+ </button>+ );++ if (orgs.length === 0) {+ return (+ <div className="flex flex-col gap-2 p-2">+ <div className="px-2 py-1 text-sm text-neutral-500">+ No organizations yet+ </div>+ {createOrgButton}+ </div>+ );+ }++ return (+ <div className="flex flex-col gap-2 p-2">+ <div className="flex flex-col gap-0.5">+ <span className="px-2 py-1 text-xs font-medium uppercase text-neutral-400">+ Organizations+ </span>+ {orgs.map((org) => (+ <button+ key={org.id}+ type="button"+ className="flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-neutral-700 hover:bg-neutral-100"+ onClick={() => switchOrg(org.id)}+ >+ <Avatar className="h-5 w-5">+ <AvatarImage src={org.avatarUrl ?? ""} alt="" />+ <AvatarFallback className="text-xs">+ {org.name.charAt(0)}+ </AvatarFallback>+ </Avatar>+ <span className="flex-1 truncate text-left">{org.name}</span>+ {org.isPersonal && (+ <span className="text-xs text-neutral-400">Personal</span>+ )}+ {org.id === activeOrg?.id && (+ <CheckIcon size={14} className="text-green-600" />+ )}+ </button>+ ))}+ {createOrgButton}+ </div>++ {teams.length > 0 && (+ <>+ <div className="border-t border-neutral-100" />+ <div className="flex flex-col gap-0.5">+ <span className="px-2 py-1 text-xs font-medium uppercase text-neutral-400">+ Teams+ </span>+ {teams.map((team) => (+ <button+ key={team.id}+ type="button"+ className="flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-neutral-700 hover:bg-neutral-100"+ onClick={() => switchTeam(team.id)}+ >+ <span className="flex-1 truncate text-left">{team.name}</span>+ {team.joinPolicy === "PRIVATE" && (+ <span className="text-xs text-neutral-400">Private</span>+ )}+ {team.id === activeTeam?.id && (+ <CheckIcon size={14} className="text-green-600" />+ )}+ </button>+ ))}+ <Link+ href="/org/teams"+ className="flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm text-neutral-500 hover:bg-neutral-100"+ >+ <GearSixIcon size={14} />+ <span>Manage teams</span>+ </Link>+ </div>+ </>+ )}+ </div>+ );+}diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuRow.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuRow.tsxindex a9de0f0d5d..265f36edb3 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuRow.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/AccountMenuRow.tsx@@ -1,5 +1,6 @@import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";import { cn } from "@/lib/utils";+import { ArrowSquareOutIcon } from "@phosphor-icons/react";import Link, { useLinkStatus } from "next/link";import * as React from "react";@@ -11,20 +12,24 @@ interface Props {destructive?: boolean;as?: "link" | "button";external?: boolean;+ // New sidebar layout variant: lighter text weight + external-link glyph.+ newLayout?: boolean;}const baseRowClasses =- "group relative flex w-full items-center gap-3 rounded-lg pl-3 pr-2 py-2 text-left text-sm font-medium outline-none transition-colors duration-200 ease-out focus-visible:outline-none";+ "group relative flex w-full items-center gap-3 rounded-lg pl-3 pr-2 py-2 text-left text-sm outline-none transition-colors duration-200 ease-out focus-visible:outline-none";function RowBody({icon,label,destructive,+ external = false,pending = false,}: {icon: React.ReactNode;label: string;destructive: boolean;+ external?: boolean;pending?: boolean;}) {const barClasses = destructive@@ -42,6 +47,12 @@ function RowBody({className="relative z-10 text-current"aria-hidden="true"/>+ ) : external ? (+ <ArrowSquareOutIcon+ className="relative z-10 shrink-0 text-neutral-700"+ size={16}+ aria-hidden="true"+ />) : null}</>);@@ -51,10 +62,12 @@ function LinkRowBody({icon,label,destructive,+ external = false,}: {icon: React.ReactNode;label: string;destructive: boolean;+ external?: boolean;}) {const { pending } = useLinkStatus();return (@@ -62,6 +75,7 @@ function LinkRowBody({icon={icon}label={label}destructive={destructive}+ external={external}pending={pending}/>);@@ -75,10 +89,16 @@ export function AccountMenuRow({destructive = false,as = "link",external = false,+ newLayout = false,}: Props) {const colorClasses = destructive? "text-neutral-700 hover:bg-red-50 hover:text-red-600 focus-visible:bg-red-50 focus-visible:text-red-600": "text-neutral-700 hover:bg-neutral-100 focus-visible:bg-neutral-100";+ const rowClasses = cn(+ baseRowClasses,+ newLayout ? "font-normal" : "font-medium",+ colorClasses,+ );if (as === "link" && href) {if (external) {@@ -87,25 +107,26 @@ export function AccountMenuRow({href={href}target="_blank"rel="noopener noreferrer"- className={cn(baseRowClasses, colorClasses)}+ className={rowClasses}>- <RowBody icon={icon} label={label} destructive={destructive} />+ <RowBody+ icon={icon}+ label={label}+ destructive={destructive}+ external={newLayout}+ /></a>);}return (- <Link href={href} className={cn(baseRowClasses, colorClasses)}>+ <Link href={href} className={rowClasses}><LinkRowBody icon={icon} label={label} destructive={destructive} /></Link>);}return (- <button- type="button"- onClick={onClick}- className={cn(baseRowClasses, colorClasses)}- >+ <button type="button" onClick={onClick} className={rowClasses}><RowBody icon={icon} label={label} destructive={destructive} /></button>);diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/__tests__/AccountMenuOrgList.test.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/__tests__/AccountMenuOrgList.test.tsxnew file mode 100644index 0000000000..8842b35c57--- /dev/null+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/components/__tests__/AccountMenuOrgList.test.tsx@@ -0,0 +1,116 @@+import { useOrgTeamStore } from "@/services/org-team/store";+import { render, screen } from "@/tests/integrations/test-utils";+import userEvent from "@testing-library/user-event";+import { beforeEach, describe, expect, it } from "vitest";++import { AccountMenuOrgList } from "../AccountMenuOrgList";++const PERSONAL_ORG = {+ id: "org-personal",+ name: "Jane's Org",+ slug: "jane",+ avatarUrl: null,+ isPersonal: true,+ memberCount: 1,+};++const COMPANY_ORG = {+ id: "org-company",+ name: "Acme Inc",+ slug: "acme",+ avatarUrl: null,+ isPersonal: false,+ memberCount: 12,+};++const DEFAULT_TEAM = {+ id: "team-default",+ name: "General",+ slug: "general",+ isDefault: true,+ joinPolicy: "OPEN",+ orgId: COMPANY_ORG.id,+};++const PRIVATE_TEAM = {+ id: "team-private",+ name: "Skunkworks",+ slug: "skunkworks",+ isDefault: false,+ joinPolicy: "PRIVATE",+ orgId: COMPANY_ORG.id,+};++function seedStore(overrides = {}) {+ useOrgTeamStore.setState({+ activeOrgID: COMPANY_ORG.id,+ activeTeamID: DEFAULT_TEAM.id,+ orgs: [PERSONAL_ORG, COMPANY_ORG],+ teams: [DEFAULT_TEAM, PRIVATE_TEAM],+ isLoaded: true,+ ...overrides,+ });+}++describe("AccountMenuOrgList", () => {+ beforeEach(() => {+ window.localStorage.clear();+ });++ it("shows an empty state with a create button when there are no orgs", () => {+ seedStore({ orgs: [], teams: [] });++ render(<AccountMenuOrgList />);++ expect(screen.getByText("No organizations yet")).toBeDefined();+ expect(screen.getByTestId("create-organization-button")).toBeDefined();+ });++ it("lists every org with a Personal badge and marks the active org", () => {+ seedStore();++ render(<AccountMenuOrgList />);++ expect(screen.getByText(PERSONAL_ORG.name)).toBeDefined();+ expect(screen.getByText(COMPANY_ORG.name)).toBeDefined();+ expect(screen.getByText("Personal")).toBeDefined();+ });++ it("lists teams with a Private badge and a manage-teams link", () => {+ seedStore();++ render(<AccountMenuOrgList />);++ expect(screen.getByText(DEFAULT_TEAM.name)).toBeDefined();+ expect(screen.getByText(PRIVATE_TEAM.name)).toBeDefined();+ expect(screen.getByText("Private")).toBeDefined();+ expect(screen.getByText("Manage teams")).toBeDefined();+ });++ it("hides the team section when the org has no teams", () => {+ seedStore({ teams: [] });++ render(<AccountMenuOrgList />);++ expect(screen.queryByText("Teams")).toBeNull();+ expect(screen.queryByText("Manage teams")).toBeNull();+ });++ it("switching org updates the active org in the store", async () => {+ seedStore();+ render(<AccountMenuOrgList />);++ await userEvent.click(screen.getByText(PERSONAL_ORG.name));++ expect(useOrgTeamStore.getState().activeOrgID).toBe(PERSONAL_ORG.id);+ });++ it("switching team updates the active team in the store", async () => {+ seedStore();+ render(<AccountMenuOrgList />);++ await userEvent.click(screen.getByText(PRIVATE_TEAM.name));++ expect(useOrgTeamStore.getState().activeTeamID).toBe(PRIVATE_TEAM.id);+ });+});diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/helpers.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/helpers.tsxindex e0fc0b3914..8ccd21219d 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/helpers.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AccountMenu/helpers.tsx@@ -3,6 +3,7 @@ import {ChartLineUpIcon,CreditCardIcon,GearIcon,+ NewspaperIcon,QuestionIcon,SignOutIcon,SlidersHorizontalIcon,@@ -10,9 +11,11 @@ import {UserIcon,} from "@phosphor-icons/react";-export function getAccountMenuPhosphorIcon(icon: IconType) {+export function getAccountMenuPhosphorIcon(+ icon: IconType,+ weight: "bold" | "regular" = "bold",+) {const className = "h-[18px] w-[18px] shrink-0";- const weight = "bold";switch (icon) {case IconType.Edit:return <UserIcon className={className} weight={weight} />;@@ -28,6 +31,8 @@ export function getAccountMenuPhosphorIcon(icon: IconType) {return <CreditCardIcon className={className} weight={weight} />;case IconType.Help:return <QuestionIcon className={className} weight={weight} />;+ case IconType.WhatsNew:+ return <NewspaperIcon className={className} weight={weight} />;case IconType.LogOut:return <SignOutIcon className={className} weight={weight} />;default:diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AgentActivityDropdown/components/ActivityDropdown/ActivityDropdown.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AgentActivityDropdown/components/ActivityDropdown/ActivityDropdown.tsxindex 885877786f..701ada418d 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/AgentActivityDropdown/components/ActivityDropdown/ActivityDropdown.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AgentActivityDropdown/components/ActivityDropdown/ActivityDropdown.tsx@@ -3,6 +3,7 @@import { Button } from "@/components/atoms/Button/Button";import { Input } from "@/components/atoms/Input/Input";import { Text } from "@/components/atoms/Text/Text";+import { cn } from "@/lib/utils";import { Bell, MagnifyingGlass, X } from "@phosphor-icons/react";import { List, type RowComponentProps } from "react-window";import { AgentExecutionWithInfo } from "../../helpers";@@ -17,21 +18,25 @@ interface Props {activeExecutions: AgentExecutionWithInfo[];recentCompletions: AgentExecutionWithInfo[];recentFailures: AgentExecutionWithInfo[];+ // New sidebar layout variant — gated behind the AUTOGPT_NEW_LAYOUT flag.+ newLayout?: boolean;}interface ActivityRowProps {executions: AgentExecutionWithInfo[];+ newLayout: boolean;}function VirtualizedActivityItem({index,style,executions,+ newLayout,}: RowComponentProps<ActivityRowProps>) {const execution = executions[index];return (<div style={style}>- <ActivityItem execution={execution} />+ <ActivityItem execution={execution} newLayout={newLayout} /></div>);}@@ -40,6 +45,7 @@ export function ActivityDropdown({activeExecutions,recentCompletions,recentFailures,+ newLayout = false,}: Props) {const {isSearchVisible,@@ -57,7 +63,7 @@ export function ActivityDropdown({// Static height for the virtualised list (react-window)const itemHeight = 72; // Height of each ActivityItem in pixels- const maxHeight = 400; // Maximum height of the dropdown+ const maxHeight = newLayout ? 320 : 400; // Maximum height of the dropdownconst listHeight = Math.min(maxHeight,@@ -69,8 +75,13 @@ export function ActivityDropdown({return (<div className="overflow-hidden">{/* Header */}- <div className="sticky top-0 z-10 px-4 pb-1 pt-0">- <div className="flex h-[60px] items-center justify-between">+ <div className={cn("sticky top-0 z-10 px-4", !newLayout && "pb-1 pt-0")}>+ <div+ className={cn(+ "flex items-center justify-between",+ newLayout ? "pb-1 pt-3" : "h-[60px]",+ )}+ >{isSearchVisible && withSearch ? (<divclassName={`${styles.searchContainer} ${@@ -101,17 +112,28 @@ export function ActivityDropdown({</div></div>) : (- <div className={styles.headerContainer}>- <Text variant="large-semibold" className="!text-black">- Agent Activity- </Text>+ <div className={cn(styles.headerContainer, newLayout && "py-0.5")}>+ {newLayout ? (+ <span className="text-xs font-medium uppercase text-neutral-500">+ Agent Activity+ </span>+ ) : (+ <Text variant="large-semibold" className="!text-black">+ Agent Activity+ </Text>+ )}{withSearch ? (<Buttonvariant="ghost"size="small"onClick={toggleSearch}aria-label="Search agents"- className="relative left-3 hover:border-transparent hover:bg-transparent"+ className={cn(+ "hover:border-transparent hover:bg-transparent",+ newLayout+ ? "!h-auto !w-fit !min-w-0 !p-0"+ : "relative left-3",+ )}><MagnifyingGlasssize={16}@@ -134,9 +156,9 @@ export function ActivityDropdown({defaultHeight={listHeight}rowCount={filteredExecutions.length}rowHeight={itemHeight}- rowProps={{ executions: filteredExecutions }}+ rowProps={{ executions: filteredExecutions, newLayout }}rowComponent={VirtualizedActivityItem}- style={{ width: 320, height: listHeight }}+ style={{ width: newLayout ? "100%" : 320, height: listHeight }}/>) : (<div className="flex h-full flex-col items-center justify-center gap-5 pb-8 pt-6">diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AgentActivityDropdown/components/ActivityItem.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AgentActivityDropdown/components/ActivityItem.tsxindex 17576e1665..d5d58bf902 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/AgentActivityDropdown/components/ActivityItem.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AgentActivityDropdown/components/ActivityItem.tsx@@ -1,9 +1,11 @@"use client";import { AgentExecutionStatus } from "@/app/api/__generated__/models/agentExecutionStatus";+import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";import { Text } from "@/components/atoms/Text/Text";import { formatTimeAgo } from "@/lib/utils/time";import {+ ArrowUpRightIcon,CheckCircleIcon,ClockIcon,StopCircleIcon,@@ -11,15 +13,38 @@ import {SpinnerIcon,MinusCircleIcon,} from "@phosphor-icons/react";-import Link from "next/link";+import { cn } from "@/lib/utils";+import Link, { useLinkStatus } from "next/link";import type { AgentExecutionWithInfo } from "../helpers";import { getExecutionDuration } from "../helpers";+function ActivityNavIndicator() {+ const { pending } = useLinkStatus();+ if (pending) {+ return (+ <LoadingSpinner+ size="small"+ className="shrink-0 text-neutral-400"+ aria-hidden="true"+ />+ );+ }+ return (+ <ArrowUpRightIcon+ size={16}+ className="shrink-0 text-neutral-400"+ aria-hidden="true"+ />+ );+}+interface Props {execution: AgentExecutionWithInfo;+ // New sidebar layout variant — gated behind the AUTOGPT_NEW_LAYOUT flag.+ newLayout?: boolean;}-export function ActivityItem({ execution }: Props) {+export function ActivityItem({ execution, newLayout = false }: Props) {function getStatusIcon() {switch (execution.status) {case AgentExecutionStatus.QUEUED:@@ -104,7 +129,10 @@ export function ActivityItem({ execution }: Props) {{/* Icon + Agent Name */}<div className="flex items-center space-x-2">{getStatusIcon()}- <Text variant="body-medium" className="max-w-44 truncate text-gray-900">+ <Text+ variant={newLayout ? "small-medium" : "body-medium"}+ className="max-w-44 truncate text-gray-900"+ >{execution.agent_name}</Text></div>@@ -124,17 +152,35 @@ export function ActivityItem({ execution }: Props) {</>);- return withExecutionLink ? (- <Link- className="block cursor-pointer border-b border-slate-50 px-2 py-3 transition-colors last:border-b-0 hover:bg-bgLightGrey"- href={linkUrl}- role="button"+ if (withExecutionLink) {+ return newLayout ? (+ <Link+ className="flex cursor-pointer items-center justify-between gap-2 rounded-xl px-2 py-3 transition-colors hover:bg-bgLightGrey"+ href={linkUrl}+ role="button"+ >+ <div className="min-w-0 flex-1">{content}</div>+ <ActivityNavIndicator />+ </Link>+ ) : (+ <Link+ className="block cursor-pointer border-b border-slate-50 px-2 py-3 transition-colors last:border-b-0 hover:bg-bgLightGrey"+ href={linkUrl}+ role="button"+ >+ {content}+ </Link>+ );+ }++ return (+ <div+ className={cn(+ "block px-2 py-3",+ newLayout ? "rounded-xl" : "border-b border-slate-50 last:border-b-0",+ )}>{content}- </Link>- ) : (- <div className="block border-b border-slate-50 px-2 py-3 last:border-b-0">- {content}</div>);}diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/AgentActivityDropdown/components/__tests__/ActivityItem.test.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/AgentActivityDropdown/components/__tests__/ActivityItem.test.tsxnew file mode 100644index 0000000000..21c90fd55d--- /dev/null+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/AgentActivityDropdown/components/__tests__/ActivityItem.test.tsx@@ -0,0 +1,73 @@+import { AgentExecutionStatus } from "@/app/api/__generated__/models/agentExecutionStatus";+import { render, screen } from "@/tests/integrations/test-utils";+import { describe, expect, it } from "vitest";++import type { AgentExecutionWithInfo } from "../../helpers";+import { ActivityItem } from "../ActivityItem";++function makeExecution(+ overrides: Partial<AgentExecutionWithInfo> = {},+): AgentExecutionWithInfo {+ return {+ id: "exec-1",+ user_id: "user-1",+ graph_id: "graph-1",+ graph_version: 1,+ status: AgentExecutionStatus.COMPLETED,+ started_at: "2026-07-21T12:00:00Z",+ ended_at: "2026-07-21T12:01:00Z",+ agent_name: "Weather Agent",+ agent_description: "Reports the weather",+ library_agent_id: "lib-agent-1",+ ...overrides,+ } as unknown as AgentExecutionWithInfo;+}++describe("ActivityItem", () => {+ it("renders a linked item with a nav indicator in the new layout", () => {+ render(<ActivityItem execution={makeExecution()} newLayout />);++ const link = screen.getByRole("button");+ expect(link.getAttribute("href")).toContain("/library/agents/lib-agent-1");+ expect(link.getAttribute("href")).toContain("activeTab=runs");+ expect(screen.getByText("Weather Agent")).toBeDefined();+ });++ it("routes review executions to the reviews tab", () => {+ render(+ <ActivityItem+ execution={makeExecution({ status: AgentExecutionStatus.REVIEW })}+ newLayout+ />,+ );++ expect(screen.getByRole("button").getAttribute("href")).toContain(+ "activeTab=reviews",+ );+ });++ it("renders a running execution in the classic layout as a link", () => {+ render(+ <ActivityItem+ execution={makeExecution({+ status: AgentExecutionStatus.RUNNING,+ ended_at: null,+ })}+ />,+ );++ expect(screen.getByRole("button")).toBeDefined();+ expect(screen.getByText("Weather Agent")).toBeDefined();+ });++ it("renders a non-linked item when the execution has no library agent", () => {+ render(+ <ActivityItem+ execution={makeExecution({ library_agent_id: undefined })}+ />,+ );++ expect(screen.queryByRole("button")).toBeNull();+ expect(screen.getByText("Weather Agent")).toBeDefined();+ });+});diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/helpers.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/helpers.tsxindex 97d7b55637..fe176fc82d 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/helpers.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/helpers.tsx@@ -13,6 +13,7 @@ import {import {ChatsIcon,CreditCardIcon,+ NewspaperIcon,QuestionIcon,StorefrontIcon,} from "@phosphor-icons/react";@@ -93,7 +94,73 @@ export const accountMenuItems: MenuItemGroup[] = [},];-export function getAccountMenuItems(userRole?: string): MenuItemGroup[] {+export function getAccountMenuItems(+ userRole?: string,+ newLayout = false,+): MenuItemGroup[] {+ return newLayout+ ? getNewLayoutAccountMenuItems(userRole)+ : getClassicAccountMenuItems(userRole);+}++// New sidebar layout grouping — gated behind the AUTOGPT_NEW_LAYOUT flag.+function getNewLayoutAccountMenuItems(userRole?: string): MenuItemGroup[] {+ const footerItems: MenuItemGroup["items"] = [+ {+ icon: IconType.WhatsNew,+ text: "What's new",+ href: "https://agpt.co/changelog",+ external: true,+ },+ {+ icon: IconType.Help,+ text: "Help & Docs",+ href: "https://agpt.co/docs",+ external: true,+ },+ ];++ if (userRole === "admin") {+ footerItems.push({+ icon: IconType.Sliders,+ text: "Admin",+ href: "/admin/marketplace",+ });+ }++ footerItems.push({+ icon: IconType.LogOut,+ text: "Log out",+ });++ return [+ {+ items: [+ {+ icon: IconType.Edit,+ text: "Profile",+ href: "/settings/profile",+ },+ {+ icon: IconType.Settings,+ text: "Settings",+ href: "/settings/account",+ },+ {+ icon: IconType.Billing,+ text: "Billing",+ href: "/settings/billing",+ },+ ],+ },+ {+ items: footerItems,+ },+ ];+}++// Classic Navbar grouping (unchanged, pre-new-layout).+function getClassicAccountMenuItems(userRole?: string): MenuItemGroup[] {const baseMenuItems: MenuItemGroup[] = [{items: [@@ -178,6 +245,8 @@ export function getAccountMenuOptionIcon(icon: IconType) {return <CreditCardIcon className={iconClass} />;case IconType.Help:return <QuestionIcon className={iconClass} />;+ case IconType.WhatsNew:+ return <NewspaperIcon className={iconClass} />;default:return <IconRefresh className={iconClass} />;}diff --git a/autogpt_platform/frontend/src/tests/integrations/setup-nextjs-mocks.tsx b/autogpt_platform/frontend/src/tests/integrations/setup-nextjs-mocks.tsxindex cb6b9ac650..e5e16dfc1d 100644--- a/autogpt_platform/frontend/src/tests/integrations/setup-nextjs-mocks.tsx+++ b/autogpt_platform/frontend/src/tests/integrations/setup-nextjs-mocks.tsx@@ -59,5 +59,6 @@ export const mockNextjsModules = () => {{children}</a>),+ useLinkStatus: () => ({ pending: false }),}));};