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): new-layout admin shell, builder canvas, chat pinning (#13742)
Abhimanyu Yadavc29ca86f885a
diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsxindex 6d93aebf41..870d73f183 100644--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx@@ -16,7 +16,9 @@ import {import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";import { AdminImpersonationBanner } from "../admin/components/AdminImpersonationBanner";import { GlobalSearchOverlay } from "../components/GlobalSearchModal/GlobalSearchOverlay";+import { WorkspaceFilesTrigger } from "../copilot/components/WorkspaceFilesTrigger/WorkspaceFilesTrigger";import { PaywallGate } from "../PaywallGate/PaywallGate";+import { BuilderSidebarAutoClose } from "./components/BuilderSidebarAutoClose/BuilderSidebarAutoClose";import { InsetHeaderTitle } from "./components/InsetHeaderTitle/InsetHeaderTitle";import { usePlatformChrome } from "./usePlatformChrome";@@ -24,14 +26,22 @@ interface Props {children: ReactNode;}+// Mobile header buttons float over the content, so they get a pill surface to+// stay readable against whatever scrolls underneath.+const mobileTriggerClassName =+ "rounded-full border border-[#DADADC] bg-white hover:bg-[#F5F5F6]";+export function PlatformChrome({ children }: Props) {const {showNewLayout,isNewLayoutActive,showTourSidebar,overlayInsetHeader,+ isCopilotRoute,hasInsetHeaderTitle,isSettingsRoute,+ isAdminRoute,+ isBuilderRoute,} = usePlatformChrome();// The collapsed-by-default sidebar ships with the brain-dump experience.const isBrainDumpEnabled = useGetFlag(Flag.ONBOARDING_BRAIN_DUMP);@@ -61,9 +71,10 @@ export function PlatformChrome({ children }: Props) {if (showNewLayout) {return (<SidebarProvider- defaultOpen={!isBrainDumpEnabled}+ defaultOpen={!isBuilderRoute && !isBrainDumpEnabled}style={{ "--sidebar-width": "18.25rem" } as CSSProperties}>+ <BuilderSidebarAutoClose /><AppSidebar /><SidebarInset className="bg-[#f9f9f9]"><header@@ -80,8 +91,15 @@ export function PlatformChrome({ children }: Props) {><div className="mx-auto flex w-full max-w-7xl items-center gap-2 px-6 md:px-8"><div className="pointer-events-auto md:hidden">- <SidebarTrigger />+ <SidebarTrigger className={mobileTriggerClassName} /></div>+ {/* Copilot treats up-to-lg as mobile (overlay context panel),+ so its workspace-files toggle stays visible past md. */}+ {isCopilotRoute && (+ <div className="pointer-events-auto lg:hidden">+ <WorkspaceFilesTrigger className={mobileTriggerClassName} />+ </div>+ )}<InsetHeaderTitle /></div></header>@@ -93,10 +111,11 @@ 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) {+ // Settings and admin render their own sidebar shells (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 || isAdminRoute) && isNewLayoutActive) {return (<main className="flex h-screen w-full flex-col"><AdminImpersonationBanner />diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/useBuilderSidebarAutoClose.test.ts b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/useBuilderSidebarAutoClose.test.tsnew file mode 100644index 0000000000..b71b451a8a--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/useBuilderSidebarAutoClose.test.ts@@ -0,0 +1,101 @@+import { renderHook } from "@testing-library/react";+import { beforeEach, describe, expect, it, vi } from "vitest";++import { useBuilderSidebarAutoClose } from "../components/BuilderSidebarAutoClose/useBuilderSidebarAutoClose";++const mockUsePathname = vi.fn<() => string | null>();+const mockSetOpen = vi.fn<(open: boolean) => void>();+let sidebarOpen = true;++vi.mock("next/navigation", () => ({+ usePathname: () => mockUsePathname(),+}));++vi.mock("@/components/ui/sidebar", () => ({+ useSidebar: () => ({ open: sidebarOpen, setOpen: mockSetOpen }),+}));++function renderAt(pathname: string) {+ mockUsePathname.mockReturnValue(pathname);+ return renderHook(() => useBuilderSidebarAutoClose());+}++beforeEach(() => {+ mockUsePathname.mockReset();+ mockSetOpen.mockReset();+ sidebarOpen = true;+});++describe("useBuilderSidebarAutoClose", () => {+ it("closes the sidebar when navigating into the builder", () => {+ const { rerender } = renderAt("/marketplace");+ expect(mockSetOpen).not.toHaveBeenCalled();++ mockUsePathname.mockReturnValue("/build");+ rerender();++ expect(mockSetOpen).toHaveBeenCalledWith(false);+ });++ it("restores the pre-builder state when navigating away", () => {+ const { rerender } = renderAt("/marketplace");++ mockUsePathname.mockReturnValue("/build/123");+ rerender();+ sidebarOpen = false;++ mockSetOpen.mockClear();+ mockUsePathname.mockReturnValue("/library");+ rerender();++ expect(mockSetOpen).toHaveBeenCalledWith(true);+ });++ it("leaves a sidebar that was already closed before the builder closed", () => {+ sidebarOpen = false;+ const { rerender } = renderAt("/marketplace");++ mockUsePathname.mockReturnValue("/build");+ rerender();++ mockSetOpen.mockClear();+ mockUsePathname.mockReturnValue("/marketplace");+ rerender();++ expect(mockSetOpen).toHaveBeenCalledWith(false);+ });++ it("does not re-close the sidebar when it is manually re-opened on /build", () => {+ const { rerender } = renderAt("/build");+ expect(mockSetOpen).toHaveBeenCalledWith(false);++ mockSetOpen.mockClear();+ sidebarOpen = true;+ rerender();++ expect(mockSetOpen).not.toHaveBeenCalled();+ });++ it("restores the app default after a hard load straight into the builder", () => {+ // A hard load seeds the provider closed (SidebarProvider defaultOpen), so+ // the seeded `false` must not be mistaken for a user preference.+ sidebarOpen = false;+ const { rerender } = renderAt("/build");++ mockSetOpen.mockClear();+ mockUsePathname.mockReturnValue("/marketplace");+ rerender();++ expect(mockSetOpen).toHaveBeenCalledWith(true);+ });++ it("ignores repeated navigation between builder sub-routes", () => {+ const { rerender } = renderAt("/build");+ mockSetOpen.mockClear();++ mockUsePathname.mockReturnValue("/build/abc");+ rerender();++ expect(mockSetOpen).not.toHaveBeenCalled();+ });+});diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/BuilderSidebarAutoClose/BuilderSidebarAutoClose.tsx b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/BuilderSidebarAutoClose/BuilderSidebarAutoClose.tsxnew file mode 100644index 0000000000..90f8322978--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/BuilderSidebarAutoClose/BuilderSidebarAutoClose.tsx@@ -0,0 +1,12 @@+"use client";++import { useBuilderSidebarAutoClose } from "./useBuilderSidebarAutoClose";++// The builder needs the full canvas, so entering /build always starts with the+// sidebar collapsed — the user can still re-open it manually. Leaving /build+// restores whatever state the sidebar was in before.+export function BuilderSidebarAutoClose() {+ useBuilderSidebarAutoClose();++ return null;+}diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/BuilderSidebarAutoClose/useBuilderSidebarAutoClose.ts b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/BuilderSidebarAutoClose/useBuilderSidebarAutoClose.tsnew file mode 100644index 0000000000..1327db2f69--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/BuilderSidebarAutoClose/useBuilderSidebarAutoClose.ts@@ -0,0 +1,38 @@+import { useSidebar } from "@/components/ui/sidebar";+import { matchesRoute } from "@/lib/utils";+import { usePathname } from "next/navigation";+import { useEffect, useRef } from "react";++export function useBuilderSidebarAutoClose() {+ const pathname = usePathname();+ const { open, setOpen } = useSidebar();+ const isBuildRoute = matchesRoute(pathname, "/build");++ const openBeforeBuildRef = useRef<boolean | null>(null);+ const openRef = useRef(open);+ openRef.current = open;+ // setOpen's identity changes whenever `open` does, so the effect must only+ // act on route transitions — otherwise a manual re-open on /build would+ // re-trigger it and snap the sidebar shut again. Starts as null so the+ // first run can tell a hard load on /build apart from navigating into it.+ const wasBuildRouteRef = useRef<boolean | null>(null);++ useEffect(() => {+ const prev = wasBuildRouteRef.current;+ if (isBuildRoute === prev) return;+ wasBuildRouteRef.current = isBuildRoute;++ if (isBuildRoute) {+ // On a hard load straight into /build the provider was seeded closed+ // (defaultOpen), so "state before build" is the app default (open),+ // not the seeded value.+ openBeforeBuildRef.current = prev === null ? true : openRef.current;+ setOpen(false);+ return;+ }+ if (openBeforeBuildRef.current !== null) {+ setOpen(openBeforeBuildRef.current);+ openBeforeBuildRef.current = null;+ }+ }, [isBuildRoute, setOpen]);+}diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.ts b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.tsindex bdafd02ebb..1cc82ef4bb 100644--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.ts+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.ts@@ -2,6 +2,7 @@ import { usePathname } from "next/navigation";import { useEffect, useState } from "react";import { useAuth } from "@/lib/auth/hooks/useAuth";+import { matchesRoute } from "@/lib/utils";import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";import { getRouteTitle } from "./components/InsetHeaderTitle/InsetHeaderTitle";@@ -35,22 +36,23 @@ export function usePlatformChrome() {const [isMounted, setIsMounted] = useState(false);useEffect(() => setIsMounted(true), []);- const isExcludedRoute = NEW_LAYOUT_EXCLUDED_PREFIXES.some((prefix) => {- if (!pathname) return false;- return pathname === prefix || pathname.startsWith(`${prefix}/`);- });+ const isExcludedRoute = NEW_LAYOUT_EXCLUDED_PREFIXES.some((prefix) =>+ matchesRoute(pathname, prefix),+ );- const isMarketplaceRoute =- pathname === "/marketplace" ||- Boolean(pathname?.startsWith("/marketplace/"));+ const isMarketplaceRoute = matchesRoute(pathname, "/marketplace");- const isCopilotRoute =- pathname === "/copilot" || Boolean(pathname?.startsWith("/copilot/"));+ const isCopilotRoute = matchesRoute(pathname, "/copilot");++ const isBuilderRoute = matchesRoute(pathname, "/build");// 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/"));+ const isSettingsRoute = matchesRoute(pathname, "/settings");++ // Admin mirrors settings under the new layout: its own settings-style+ // sidebar shell (see admin/layout.tsx), no top Navbar.+ const isAdminRoute = matchesRoute(pathname, "/admin");// 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.@@ -66,12 +68,20 @@ export function usePlatformChrome() {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.+ // above it, so messages scroll to the viewport top. Kept separate from+ // `isCopilotRoute` so a future overlay-header route doesn't inherit+ // copilot's header controls.overlayInsetHeader: isCopilotRoute,+ isCopilotRoute,// Titleless pages collapse the header on desktop so content doesn't sit// below an empty strip; on mobile it stays for the sidebar trigger.hasInsetHeaderTitle: Boolean(getRouteTitle(pathname)),showTourSidebar,isSettingsRoute,+ isAdminRoute,+ // The builder wants the full canvas — the sidebar starts collapsed there+ // (defaultOpen seed for hard loads; BuilderSidebarAutoClose handles+ // client-side navigation).+ isBuilderRoute,};}diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/AdminLayoutShell.test.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/AdminLayoutShell.test.tsxnew file mode 100644index 0000000000..a0aa981510--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/AdminLayoutShell.test.tsx@@ -0,0 +1,96 @@+import type { AnchorHTMLAttributes, ReactNode } from "react";+import { render, screen } from "@/tests/integrations/test-utils";+import { beforeEach, describe, expect, it, vi } from "vitest";++type MockLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {+ children: ReactNode;+ href: string;+};++const { usePathnameMock, usePlatformChromeMock } = vi.hoisted(() => ({+ usePathnameMock: vi.fn(() => "/admin/marketplace"),+ usePlatformChromeMock: vi.fn(() => ({ isNewLayoutActive: false })),+}));++vi.mock("next/navigation", () => ({+ useRouter: () => ({+ push: vi.fn(),+ replace: vi.fn(),+ prefetch: vi.fn(),+ back: vi.fn(),+ forward: vi.fn(),+ refresh: vi.fn(),+ }),+ usePathname: usePathnameMock,+ useSearchParams: () => new URLSearchParams(),+ useParams: () => ({}),+}));++vi.mock("next/link", () => ({+ __esModule: true,+ default: function MockLink({ children, href, ...props }: MockLinkProps) {+ return (+ <a href={href} {...props}>+ {children}+ </a>+ );+ },+ useLinkStatus: () => ({ pending: false }),+}));++vi.mock("@/app/(platform)/PlatformChrome/usePlatformChrome", () => ({+ usePlatformChrome: usePlatformChromeMock,+}));++import AdminLayout from "../layout";++describe("AdminLayout shell switching", () => {+ beforeEach(() => {+ usePathnameMock.mockReturnValue("/admin/marketplace");+ usePlatformChromeMock.mockReturnValue({ isNewLayoutActive: false });+ });++ it("renders the new admin shell with its own Back link when the new layout is active", () => {+ usePlatformChromeMock.mockReturnValue({ isNewLayoutActive: true });++ render(+ <AdminLayout>+ <p>admin page body</p>+ </AdminLayout>,+ );++ expect(screen.getByText("admin page body")).toBeDefined();+ // The new shell owns navigation (no top Navbar), so it must expose a way back.+ expect(+ screen.getAllByRole("link", { name: /back to home/i }).length,+ ).toBeGreaterThan(0);+ });++ it("renders the classic shell without the new admin Back link when the flag is off", () => {+ render(+ <AdminLayout>+ <p>admin page body</p>+ </AdminLayout>,+ );++ expect(screen.getByText("admin page body")).toBeDefined();+ expect(screen.queryByRole("link", { name: /back to home/i })).toBeNull();+ });++ it("keeps every admin destination reachable in the new shell", () => {+ usePlatformChromeMock.mockReturnValue({ isNewLayoutActive: true });++ render(+ <AdminLayout>+ <p>admin page body</p>+ </AdminLayout>,+ );++ expect(+ screen.getAllByRole("link", { name: /marketplace management/i }).length,+ ).toBeGreaterThan(0);+ expect(+ screen.getAllByRole("link", { name: /admin user management/i }).length,+ ).toBeGreaterThan(0);+ });+});diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/AdminMobileNav.test.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/AdminMobileNav.test.tsxnew file mode 100644index 0000000000..6d9750573e--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/AdminMobileNav.test.tsx@@ -0,0 +1,98 @@+import type { AnchorHTMLAttributes, ReactNode } from "react";+import {+ render,+ screen,+ fireEvent,+ waitFor,+} from "@/tests/integrations/test-utils";+import { beforeEach, describe, expect, it, vi } from "vitest";++type MockLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {+ children: ReactNode;+ href: string;+};++const { usePathnameMock } = vi.hoisted(() => ({+ usePathnameMock: vi.fn(() => "/admin/spending"),+}));++vi.mock("next/navigation", () => ({+ useRouter: () => ({+ push: vi.fn(),+ replace: vi.fn(),+ prefetch: vi.fn(),+ back: vi.fn(),+ forward: vi.fn(),+ refresh: vi.fn(),+ }),+ usePathname: usePathnameMock,+ useSearchParams: () => new URLSearchParams(),+ useParams: () => ({}),+}));++vi.mock("next/link", () => ({+ __esModule: true,+ default: function MockLink({ children, href, ...props }: MockLinkProps) {+ return (+ <a href={href} {...props}>+ {children}+ </a>+ );+ },+ useLinkStatus: () => ({ pending: false }),+}));++import { AdminMobileNav } from "../components/AdminMobileNav/AdminMobileNav";+import { adminNavItems } from "../components/AdminSidebar/helpers";++describe("AdminMobileNav", () => {+ beforeEach(() => {+ usePathnameMock.mockReturnValue("/admin/spending");+ });++ it("trigger shows the current page label", () => {+ render(<AdminMobileNav />);++ expect(+ screen.getByRole("button", { name: /admin navigation/i }).textContent,+ ).toContain("User Spending");+ });++ it("falls back to the first nav item when the pathname matches nothing", () => {+ usePathnameMock.mockReturnValue("/admin");+ render(<AdminMobileNav />);++ expect(+ screen.getByRole("button", { name: /admin navigation/i }).textContent,+ ).toContain(adminNavItems[0].label);+ });++ it("opens a popover listing every admin section", async () => {+ render(<AdminMobileNav />);++ fireEvent.click(screen.getByRole("button", { name: /admin navigation/i }));++ for (const { label } of adminNavItems) {+ expect(+ await screen.findByRole("link", { name: new RegExp(label, "i") }),+ ).toBeDefined();+ }+ });++ it("selecting an item closes the popover", async () => {+ render(<AdminMobileNav />);++ fireEvent.click(screen.getByRole("button", { name: /admin navigation/i }));++ const memoryLink = await screen.findByRole("link", {+ name: /memory inspector/i,+ });+ fireEvent.click(memoryLink);++ await waitFor(() => {+ expect(+ screen.queryByRole("link", { name: /memory inspector/i }),+ ).toBeNull();+ });+ });+});diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/AdminSidebar.test.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/AdminSidebar.test.tsxnew file mode 100644index 0000000000..132d8a1ab0--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/admin/__tests__/AdminSidebar.test.tsx@@ -0,0 +1,97 @@+import type { AnchorHTMLAttributes, ReactNode } from "react";+import { render, screen } from "@/tests/integrations/test-utils";+import { beforeEach, describe, expect, it, vi } from "vitest";++type MockLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {+ children: ReactNode;+ href: string;+};++const { usePathnameMock } = vi.hoisted(() => ({+ usePathnameMock: vi.fn(() => "/admin/marketplace"),+}));++vi.mock("next/navigation", () => ({+ useRouter: () => ({+ push: vi.fn(),+ replace: vi.fn(),+ prefetch: vi.fn(),+ back: vi.fn(),+ forward: vi.fn(),+ refresh: vi.fn(),+ }),+ usePathname: usePathnameMock,+ useSearchParams: () => new URLSearchParams(),+ useParams: () => ({}),+}));++vi.mock("next/link", () => ({+ __esModule: true,+ default: function MockLink({ children, href, ...props }: MockLinkProps) {+ return (+ <a href={href} {...props}>+ {children}+ </a>+ );+ },+ useLinkStatus: () => ({ pending: false }),+}));++import { AdminSidebar } from "../components/AdminSidebar/AdminSidebar";+import { adminNavItems } from "../components/AdminSidebar/helpers";++describe("AdminSidebar", () => {+ beforeEach(() => {+ usePathnameMock.mockReturnValue("/admin/marketplace");+ });++ it("renders a Back link to /copilot and every admin nav item with its href", () => {+ render(<AdminSidebar />);++ const back = screen.getByRole("link", { name: /back/i });+ expect(back.getAttribute("href")).toBe("/copilot");++ for (const { label, href } of adminNavItems) {+ const link = screen.getByRole("link", { name: new RegExp(label, "i") });+ expect(link.getAttribute("href")).toBe(href);+ }+ });++ it("marks the nav item matching the current pathname as active", () => {+ usePathnameMock.mockReturnValue("/admin/spending");+ render(<AdminSidebar />);++ expect(+ screen+ .getByRole("link", { name: /user spending/i })+ .getAttribute("aria-current"),+ ).toBe("page");+ expect(+ screen+ .getByRole("link", { name: /marketplace management/i })+ .getAttribute("aria-current"),+ ).toBeNull();+ });++ it("treats nested paths under a nav item as active", () => {+ usePathnameMock.mockReturnValue("/admin/memory/entity/123");+ render(<AdminSidebar />);++ expect(+ screen+ .getByRole("link", { name: /memory inspector/i })+ .getAttribute("aria-current"),+ ).toBe("page");+ });++ it("does not mark a nav item active on a partial href match", () => {+ usePathnameMock.mockReturnValue("/admin/bots-legacy");+ render(<AdminSidebar />);++ expect(+ screen+ .getByRole("link", { name: /bot analytics/i })+ .getAttribute("aria-current"),+ ).toBeNull();+ });+});diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminClassicShell.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminClassicShell.tsxnew file mode 100644index 0000000000..65427bcffd--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminClassicShell.tsx@@ -0,0 +1,88 @@+import { Sidebar } from "@/components/__legacy__/Sidebar";+import { IconSliders } from "@/components/__legacy__/ui/icons";+import {+ BrainIcon,+ Calculator01Icon,+ DollarSignIcon,+ File02Icon,+ GaugeIcon,+ Pulse01Icon,+ ReceiptTextIcon,+ Robot01Icon,+ Search01Icon,+ UserMultipleIcon,+} from "@hugeicons/core-free-icons";+import { ReactNode } from "react";++import { Icon } from "@/components/atoms/Icon/Icon";++const sidebarLinkGroups = [+ {+ links: [+ {+ text: "Marketplace Management",+ href: "/admin/marketplace",+ icon: <Icon icon={UserMultipleIcon} className="h-6 w-6" />,+ },+ {+ text: "User Spending",+ href: "/admin/spending",+ icon: <Icon icon={DollarSignIcon} className="h-6 w-6" />,+ },+ {+ text: "System Diagnostics",+ href: "/admin/diagnostics",+ icon: <Icon icon={Pulse01Icon} className="h-6 w-6" />,+ },+ {+ text: "User Impersonation",+ href: "/admin/impersonation",+ icon: <Icon icon={Search01Icon} className="h-6 w-6" />,+ },+ {+ text: "Rate Limits",+ href: "/admin/rate-limits",+ icon: <Icon icon={GaugeIcon} className="h-6 w-6" />,+ },+ {+ text: "Platform Costs",+ href: "/admin/platform-costs",+ icon: <Icon icon={ReceiptTextIcon} className="h-6 w-6" />,+ },+ {+ text: "Execution Analytics",+ href: "/admin/execution-analytics",+ icon: <Icon icon={File02Icon} className="h-6 w-6" />,+ },+ {+ text: "Bot Analytics",+ href: "/admin/bots",+ icon: <Icon icon={Robot01Icon} className="h-6 w-6" />,+ },+ {+ text: "Block Cost Estimates",+ href: "/admin/block-cost-estimates",+ icon: <Icon icon={Calculator01Icon} className="h-6 w-6" />,+ },+ {+ text: "Memory Inspector",+ href: "/admin/memory",+ icon: <Icon icon={BrainIcon} className="h-6 w-6" />,+ },+ {+ text: "Admin User Management",+ href: "/admin/settings",+ icon: <IconSliders className="h-6 w-6" />,+ },+ ],+ },+];++export function AdminClassicShell({ children }: { children: ReactNode }) {+ return (+ <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)/admin/components/AdminMobileNav/AdminMobileNav.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminMobileNav/AdminMobileNav.tsxnew file mode 100644index 0000000000..e9652d72bd--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminMobileNav/AdminMobileNav.tsx@@ -0,0 +1,98 @@+"use client";++import { useState } from "react";+import Link from "next/link";+import { ArrowDown01Icon, ArrowLeft02Icon } from "@hugeicons/core-free-icons";+import { Icon as UIIcon } from "@/components/atoms/Icon/Icon";+import {+ Popover,+ PopoverContent,+ PopoverTrigger,+} from "@/components/molecules/Popover/Popover";+import { Text } from "@/components/atoms/Text/Text";+import { cn } from "@/lib/utils";+import { useAdminSidebar } from "../AdminSidebar/useAdminSidebar";++export function AdminMobileNav() {+ const { items } = useAdminSidebar();+ const [open, setOpen] = useState(false);+ const current = items.find((i) => i.isActive) ?? items[0];++ return (+ <div className="flex items-center gap-2 bg-[#F9F9FA] px-4 py-3 md:hidden">+ <Link+ href="/copilot"+ aria-label="Back to home"+ className="flex items-center gap-1 rounded-[8px] py-1 pr-2 text-[#505057] transition-colors hover:text-[#1F1F20]"+ >+ <UIIcon icon={ArrowLeft02Icon} size={16} />+ </Link>+ <Popover open={open} onOpenChange={setOpen}>+ <PopoverTrigger asChild>+ <button+ type="button"+ className="flex w-fit items-center gap-2 rounded-full border border-[#DADADC] bg-white px-3 py-2 outline-none focus-visible:ring-2 focus-visible:ring-[#3E3E43]"+ aria-label={`Admin navigation, current: ${current.label}`}+ >+ <span className="flex items-center gap-2">+ <UIIcon icon={current.Icon} size={16} className="text-black" />+ <Text+ variant="body"+ as="span"+ className="font-medium text-[#1F1F20]"+ >+ {current.label}+ </Text>+ </span>+ <UIIcon+ icon={ArrowDown01Icon}+ size={16}+ className={cn(+ "text-[#505057] transition-transform",+ open && "rotate-180",+ )}+ />+ </button>+ </PopoverTrigger>+ <PopoverContent+ align="start"+ sideOffset={8}+ className="w-[calc(100vw-32px)] max-w-sm p-2"+ >+ <nav className="flex flex-col gap-[4px]">+ {items.map(({ label, href, Icon, isActive }) => (+ <Link+ key={href}+ href={href}+ aria-current={isActive ? "page" : undefined}+ onClick={() => setOpen(false)}+ className={cn(+ "flex h-[38px] items-center gap-2 rounded-[8px] px-3",+ isActive ? "bg-[#EFEFF0]" : "hover:bg-[#F5F5F6]",+ )}+ >+ <UIIcon+ icon={Icon}+ size={16}+ className={isActive ? "text-black" : "text-[#1F1F20]"}+ />+ <Text+ variant="body"+ as="span"+ className={cn(+ "flex-1",+ isActive+ ? "font-medium text-[#1F1F20]"+ : "font-normal text-[#505057]",+ )}+ >+ {label}+ </Text>+ </Link>+ ))}+ </nav>+ </PopoverContent>+ </Popover>+ </div>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminNewShell.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminNewShell.tsxnew file mode 100644index 0000000000..90e144dc12--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminNewShell.tsx@@ -0,0 +1,39 @@+"use client";++import { ScrollArea } from "@/components/ui/scroll-area";+import { motion, useReducedMotion } from "framer-motion";+import { usePathname } from "next/navigation";+import { ReactNode } from "react";++import { AdminMobileNav } from "./AdminMobileNav/AdminMobileNav";+import { AdminSidebar } from "./AdminSidebar/AdminSidebar";++// Mirrors the new /settings shell: own sidebar with a Back link, no top+// Navbar (PlatformChrome renders the bare shell for /admin under the new+// layout).+export function AdminNewShell({ children }: { children: ReactNode }) {+ const pathname = usePathname();+ const reduceMotion = useReducedMotion();++ return (+ <div className="flex h-full w-full overflow-hidden bg-[#F9F9FA]">+ <AdminSidebar />+ <div className="flex min-w-0 flex-1 flex-col overflow-hidden">+ <AdminMobileNav />+ <main className="flex-1 overflow-hidden bg-[#F9F9FA]">+ <ScrollArea className="h-full">+ <motion.div+ key={pathname}+ initial={reduceMotion ? { opacity: 0 } : { opacity: 0, y: 8 }}+ animate={{ opacity: 1, y: 0 }}+ transition={{ duration: 0.28, ease: [0, 0, 0.2, 1] as const }}+ className="mx-auto w-full max-w-[1360px] px-4 pb-8 pt-2 md:px-6 md:pt-6"+ >+ {children}+ </motion.div>+ </ScrollArea>+ </main>+ </div>+ </div>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminSidebar/AdminSidebar.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminSidebar/AdminSidebar.tsxnew file mode 100644index 0000000000..22e628c468--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminSidebar/AdminSidebar.tsx@@ -0,0 +1,58 @@+"use client";++import { SettingsNavItem } from "@/app/(platform)/settings/components/SettingsSidebar/SettingsNavItem";+import { Text } from "@/components/atoms/Text/Text";+import { Icon } from "@/components/atoms/Icon/Icon";+import { ArrowLeft02Icon } from "@hugeicons/core-free-icons";+import { motion, useReducedMotion } from "framer-motion";+import Link from "next/link";+import { useAdminSidebar } from "./useAdminSidebar";++export function AdminSidebar() {+ const { items } = useAdminSidebar();+ const reduceMotion = useReducedMotion();++ const container = {+ hidden: {},+ show: {+ transition: {+ staggerChildren: reduceMotion ? 0 : 0.04,+ delayChildren: 0.08,+ },+ },+ };++ return (+ <motion.aside+ initial={reduceMotion ? { opacity: 0 } : { opacity: 0, x: -10 }}+ animate={{ opacity: 1, x: 0 }}+ transition={{ duration: 0.25, ease: [0, 0, 0.2, 1] as const }}+ className="hidden h-full w-[268px] shrink-0 overflow-y-auto border-r border-[#DADADC] bg-[#F9F9FA] px-[10px] pt-[13px] md:block"+ >+ <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]"+ >+ <Icon icon={ArrowLeft02Icon} size={16} />+ <Text variant="body" as="span" className="font-medium">+ Back+ </Text>+ </Link>+ <motion.nav+ variants={container}+ initial="hidden"+ animate="show"+ className="flex flex-col items-start gap-[7px]"+ >+ {items.map((item) => (+ <SettingsNavItem+ key={item.href}+ item={item}+ isActive={item.isActive}+ />+ ))}+ </motion.nav>+ </motion.aside>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminSidebar/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminSidebar/helpers.tsnew file mode 100644index 0000000000..3dcf1a4aa2--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminSidebar/helpers.ts@@ -0,0 +1,62 @@+import {+ BrainIcon,+ Calculator01Icon,+ DollarSignIcon,+ File02Icon,+ GaugeIcon,+ Pulse01Icon,+ ReceiptTextIcon,+ Robot01Icon,+ Search01Icon,+ SlidersHorizontalIcon,+ UserMultipleIcon,+} from "@hugeicons/core-free-icons";+import type { IconSvgElement } from "@hugeicons/react";++export interface AdminNavItem {+ label: string;+ href: string;+ Icon: IconSvgElement;+}++export const adminNavItems: AdminNavItem[] = [+ {+ label: "Marketplace Management",+ href: "/admin/marketplace",+ Icon: UserMultipleIcon,+ },+ { label: "User Spending", href: "/admin/spending", Icon: DollarSignIcon },+ {+ label: "System Diagnostics",+ href: "/admin/diagnostics",+ Icon: Pulse01Icon,+ },+ {+ label: "User Impersonation",+ href: "/admin/impersonation",+ Icon: Search01Icon,+ },+ { label: "Rate Limits", href: "/admin/rate-limits", Icon: GaugeIcon },+ {+ label: "Platform Costs",+ href: "/admin/platform-costs",+ Icon: ReceiptTextIcon,+ },+ {+ label: "Execution Analytics",+ href: "/admin/execution-analytics",+ Icon: File02Icon,+ },+ { label: "Bot Analytics", href: "/admin/bots", Icon: Robot01Icon },+ {+ label: "Block Cost Estimates",+ href: "/admin/block-cost-estimates",+ Icon: Calculator01Icon,+ },+ { label: "Memory Inspector", href: "/admin/memory", Icon: BrainIcon },+ {+ label: "Admin User Management",+ href: "/admin/settings",+ Icon: SlidersHorizontalIcon,+ },+];diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminSidebar/useAdminSidebar.ts b/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminSidebar/useAdminSidebar.tsnew file mode 100644index 0000000000..5d5c5de147--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/admin/components/AdminSidebar/useAdminSidebar.ts@@ -0,0 +1,14 @@+import { matchesRoute } from "@/lib/utils";+import { usePathname } from "next/navigation";+import { adminNavItems } from "./helpers";++export function useAdminSidebar() {+ const pathname = usePathname();++ const items = adminNavItems.map((item) => ({+ ...item,+ isActive: matchesRoute(pathname, item.href),+ }));++ return { items };+}diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/layout.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/layout.tsxindex c5b39c2ec4..abdd7ba615 100644--- a/autogpt_platform/frontend/src/app/(platform)/admin/layout.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/admin/layout.tsx@@ -1,90 +1,20 @@-import { Sidebar } from "@/components/__legacy__/Sidebar";-import { IconSliders } from "@/components/__legacy__/ui/icons";-import {- BrainIcon,- Calculator01Icon,- DollarSignIcon,- File02Icon,- GaugeIcon,- Pulse01Icon,- ReceiptTextIcon,- Robot01Icon,- Search01Icon,- UserMultipleIcon,-} from "@hugeicons/core-free-icons";-import { Icon } from "@/components/atoms/Icon/Icon";+"use client";-const sidebarLinkGroups = [- {- links: [- {- text: "Marketplace Management",- href: "/admin/marketplace",- icon: <Icon icon={UserMultipleIcon} className="h-6 w-6" />,- },- {- text: "User Spending",- href: "/admin/spending",- icon: <Icon icon={DollarSignIcon} className="h-6 w-6" />,- },- {- text: "System Diagnostics",- href: "/admin/diagnostics",- icon: <Icon icon={Pulse01Icon} className="h-6 w-6" />,- },- {- text: "User Impersonation",- href: "/admin/impersonation",- icon: <Icon icon={Search01Icon} className="h-6 w-6" />,- },- {- text: "Rate Limits",- href: "/admin/rate-limits",- icon: <Icon icon={GaugeIcon} className="h-6 w-6" />,- },- {- text: "Platform Costs",- href: "/admin/platform-costs",- icon: <Icon icon={ReceiptTextIcon} className="h-6 w-6" />,- },- {- text: "Execution Analytics",- href: "/admin/execution-analytics",- icon: <Icon icon={File02Icon} className="h-6 w-6" />,- },- {- text: "Bot Analytics",- href: "/admin/bots",- icon: <Icon icon={Robot01Icon} className="h-6 w-6" />,- },- {- text: "Block Cost Estimates",- href: "/admin/block-cost-estimates",- icon: <Icon icon={Calculator01Icon} className="h-6 w-6" />,- },- {- text: "Memory Inspector",- href: "/admin/memory",- icon: <Icon icon={BrainIcon} className="h-6 w-6" />,- },- {- text: "Admin User Management",- href: "/admin/settings",- icon: <IconSliders className="h-6 w-6" />,- },- ],- },-];+import { usePlatformChrome } from "@/app/(platform)/PlatformChrome/usePlatformChrome";+import { ReactNode } from "react";-export default function AdminLayout({- children,-}: {- children: React.ReactNode;-}) {- return (- <div className="flex h-full w-full flex-col lg:flex-row">- <Sidebar linkGroups={sidebarLinkGroups} />- <div className="flex-1 pl-4">{children}</div>- </div>- );+import { AdminClassicShell } from "./components/AdminClassicShell";+import { AdminNewShell } from "./components/AdminNewShell";++// Switcher between the classic admin shell (legacy sidebar under the top+// Navbar) and the new-layout shell (settings-style sidebar, no Navbar). The+// classic shell can be deleted wholesale once the new layout ships.+export default function AdminLayout({ children }: { children: ReactNode }) {+ const { isNewLayoutActive } = usePlatformChrome();++ if (isNewLayoutActive) {+ return <AdminNewShell>{children}</AdminNewShell>;+ }++ return <AdminClassicShell>{children}</AdminClassicShell>;}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsxindex 90f9d020c9..98c3a552a9 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx@@ -5,6 +5,7 @@ import { DotDistortionShader } from "@/components/ui/dot-distortion-shader";import { SidebarProvider } from "@/components/ui/sidebar";import { useAuth } from "@/lib/auth/hooks/useAuth";import { NAVBAR_HEIGHT_PX } from "@/lib/constants";+import { cn } from "@/lib/utils";import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";import { usePlatformChrome } from "../PlatformChrome/usePlatformChrome";import dynamic from "next/dynamic";@@ -92,6 +93,7 @@ export function CopilotPage() {<MainAreaisMobile={isMobile}isArtifactsEnabled={isArtifactsEnabled}+ showNewLayout={showNewLayout}isBrainDumpEnabled={Boolean(isBrainDumpEnabled)}sessionId={sessionId}droppedFiles={droppedFiles}@@ -111,6 +113,7 @@ export function CopilotPage() {interface MainAreaProps {isMobile: boolean;isArtifactsEnabled: boolean;+ showNewLayout: boolean;isBrainDumpEnabled: boolean;sessionId: string | null;droppedFiles: File[];@@ -120,6 +123,7 @@ interface MainAreaProps {function MainArea({isMobile,isArtifactsEnabled,+ showNewLayout,isBrainDumpEnabled,sessionId,droppedFiles,@@ -142,8 +146,17 @@ function MainArea({className="relative flex min-w-0 flex-1 flex-col overflow-hidden px-0"onFilesDropped={setDroppedFiles}>- {isMobile && <MobileHeader />}- <div className="flex flex-col gap-3 px-4 pt-4 empty:hidden">+ {/* New layout replaces these floating buttons: sessions live in the+ app sidebar, workspace files toggle sits in the inset header. */}+ {isMobile && !showNewLayout && <MobileHeader />}+ <div+ className={cn(+ "flex flex-col gap-3 px-4 pt-4 empty:hidden",+ // Clear the floating inset-header controls (sidebar toggle ++ // workspace-files trigger) that overlay the top-left corner.+ showNewLayout && "max-lg:pt-16",+ )}+ ><LowCreditBanner /><NotificationBanner /></div>diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsxindex 0792802e5b..71116b9d77 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx@@ -41,6 +41,7 @@ import { useGlobalSearchStore } from "@/app/(platform)/components/GlobalSearchMoimport { useRouter } from "next/navigation";import { ChatSessionRow } from "./components/ChatSessionRow/ChatSessionRow";import { ExpertSessionGroup } from "./components/ExpertSessionGroup/ExpertSessionGroup";+import { HeaderAction } from "./components/HeaderAction";import { DeleteChatDialog } from "../DeleteChatDialog/DeleteChatDialog";import { UsagePopover } from "../UsageLimits/UsagePopover/UsagePopover";import { NotificationToggle } from "./components/NotificationToggle/NotificationToggle";@@ -374,34 +375,42 @@ export function ChatSidebar() {<Text variant="h3" size="body-medium">Your chats</Text>- <div className="flex items-center">+ <div className="flex items-center [&_button:hover]:!bg-zinc-100 [&_button]:!h-8 [&_button]:!w-8 [&_button]:!min-w-0 [&_button]:!rounded-full [&_button]:!p-0 [&_button]:!text-zinc-600 [&_svg]:!size-[1.125rem]">{isChatSearchEnabled ? (- <ShadcnButton- type="button"- variant="ghost"- size="icon-sm"- aria-label="Search chats"- onClick={() => openSearch()}- className="rounded-full text-zinc-600 hover:bg-zinc-100"- >- <Icon icon={Search01Icon} className="!size-5" />- </ShadcnButton>+ <HeaderAction label="Search chats">+ <ShadcnButton+ type="button"+ variant="ghost"+ size="icon-sm"+ aria-label="Search chats"+ onClick={() => openSearch()}+ >+ <Icon icon={Search01Icon} className="!size-5" />+ </ShadcnButton>+ </HeaderAction>) : null}{isArtifactsEnabled ? (- <ShadcnButton- type="button"- variant="ghost"- size="icon-sm"- aria-label="Files"- onClick={() => router.push("/artifacts")}- className="rounded-full text-zinc-600 hover:bg-zinc-100"- >- <Icon icon={Files01Icon} className="!size-5" />- </ShadcnButton>+ <HeaderAction label="Files">+ <ShadcnButton+ type="button"+ variant="ghost"+ size="icon-sm"+ aria-label="Files"+ onClick={() => router.push("/artifacts")}+ >+ <Icon icon={Files01Icon} className="!size-5" />+ </ShadcnButton>+ </HeaderAction>) : null}- <UsagePopover />- <NotificationToggle />- <SidebarTrigger />+ <HeaderAction label="Usage limits">+ <UsagePopover />+ </HeaderAction>+ <HeaderAction label="Notification settings">+ <NotificationToggle />+ </HeaderAction>+ <HeaderAction label="Collapse sidebar">+ <SidebarTrigger />+ </HeaderAction></div></div>{sessionId ? (diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/components/HeaderAction.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/components/HeaderAction.tsxnew file mode 100644index 0000000000..33565bef27--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/components/HeaderAction.tsx@@ -0,0 +1,23 @@+"use client";++import {+ Tooltip,+ TooltipContent,+ TooltipTrigger,+} from "@/components/atoms/Tooltip/BaseTooltip";++interface Props {+ label: string;+ children: React.ReactNode;+}++export function HeaderAction({ label, children }: Props) {+ return (+ <Tooltip>+ <TooltipTrigger asChild>+ <span className="inline-flex">{children}</span>+ </TooltipTrigger>+ <TooltipContent side="bottom">{label}</TooltipContent>+ </Tooltip>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/UsageLimits/UsagePopover/UsagePopover.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/UsageLimits/UsagePopover/UsagePopover.tsxindex a055d25c55..72825f0e2d 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/UsageLimits/UsagePopover/UsagePopover.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/UsageLimits/UsagePopover/UsagePopover.tsx@@ -14,7 +14,7 @@ import { formatTierLabel, TIER_BADGE_CLASS_NAME } from "../../usageHelpers";import { StorageBar } from "../StorageBar";import { UsageBar } from "../UsageBar";import { useUsagePopover } from "./useUsagePopover";-import { Chart01Icon } from "@hugeicons/core-free-icons";+import { GaugeIcon } from "@hugeicons/core-free-icons";import { Icon } from "@/components/atoms/Icon/Icon";interface Props {@@ -35,7 +35,7 @@ export function UsagePopover({ trigger, align = "start" }: Props) {<PopoverTrigger asChild>{trigger ?? (<Button variant="ghost" size="icon" aria-label="Usage limits">- <Icon icon={Chart01Icon} className="!size-5" />+ <Icon icon={GaugeIcon} className="!size-5" /></Button>)}</PopoverTrigger>diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFilesTrigger/WorkspaceFilesTrigger.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFilesTrigger/WorkspaceFilesTrigger.tsxnew file mode 100644index 0000000000..3e86baa371--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFilesTrigger/WorkspaceFilesTrigger.tsx@@ -0,0 +1,32 @@+"use client";++import { Button } from "@/components/ui/button";+import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";+import { Icon } from "@/components/atoms/Icon/Icon";+import { Folder01Icon } from "@hugeicons/core-free-icons";+import { useCopilotUIStore } from "../../store";++interface Props {+ className?: string;+}++// Sits next to the sidebar toggle in the new-layout inset header and mirrors+// SidebarTrigger's ghost styling (no border, no shadow).+export function WorkspaceFilesTrigger({ className }: Props) {+ const toggleContextPanel = useCopilotUIStore((s) => s.toggleContextPanel);+ const isContextPanelEnabled = useGetFlag(Flag.ARTIFACTS);++ if (!isContextPanelEnabled) return null;++ return (+ <Button+ variant="ghost"+ size="icon"+ className={className}+ onClick={toggleContextPanel}+ aria-label="Open workspace files"+ >+ <Icon icon={Folder01Icon} className="!size-5" />+ </Button>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFilesTrigger/__tests__/WorkspaceFilesTrigger.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFilesTrigger/__tests__/WorkspaceFilesTrigger.test.tsxnew file mode 100644index 0000000000..f66640d64a--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/WorkspaceFilesTrigger/__tests__/WorkspaceFilesTrigger.test.tsx@@ -0,0 +1,74 @@+import { render, screen, fireEvent } from "@/tests/integrations/test-utils";+import { beforeEach, describe, expect, it, vi } from "vitest";++// Only the artifacts flag resolves — querying any other flag returns undefined,+// so the trigger disappears and the assertions below fail loudly.+const { artifactsEnabledMock, useGetFlagMock, toggleContextPanelMock } =+ vi.hoisted(() => {+ const artifactsEnabledMock = { current: true };+ return {+ artifactsEnabledMock,+ useGetFlagMock: vi.fn((flag: string) =>+ flag === "artifacts" ? artifactsEnabledMock.current : undefined,+ ),+ toggleContextPanelMock: vi.fn(),+ };+ });++vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {+ const actual =+ await importOriginal<+ typeof import("@/services/feature-flags/use-get-flag")+ >();+ return { ...actual, useGetFlag: useGetFlagMock };+});++vi.mock("../../../store", () => ({+ useCopilotUIStore: (selector: (state: unknown) => unknown) =>+ selector({ toggleContextPanel: toggleContextPanelMock }),+}));++import { Flag } from "@/services/feature-flags/use-get-flag";+import { WorkspaceFilesTrigger } from "../WorkspaceFilesTrigger";++describe("WorkspaceFilesTrigger", () => {+ beforeEach(() => {+ toggleContextPanelMock.mockClear();+ useGetFlagMock.mockClear();+ artifactsEnabledMock.current = true;+ });++ it("gates on the artifacts flag specifically", () => {+ render(<WorkspaceFilesTrigger />);++ expect(useGetFlagMock).toHaveBeenCalledWith(Flag.ARTIFACTS);+ });++ it("toggles the context panel when clicked", () => {+ render(<WorkspaceFilesTrigger />);++ fireEvent.click(+ screen.getByRole("button", { name: /open workspace files/i }),+ );++ expect(toggleContextPanelMock).toHaveBeenCalledTimes(1);+ });++ it("renders nothing when the artifacts flag is off", () => {+ artifactsEnabledMock.current = false;++ render(<WorkspaceFilesTrigger />);++ expect(+ screen.queryByRole("button", { name: /open workspace files/i }),+ ).toBeNull();+ });++ it("forwards className so the header can restyle it", () => {+ render(<WorkspaceFilesTrigger className="rounded-full" />);++ expect(+ screen.getByRole("button", { name: /open workspace files/i }).className,+ ).toContain("rounded-full");+ });+});diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/NewAgentLibraryView.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/NewAgentLibraryView.tsxindex 39acdfc6ee..4aebe8f712 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/NewAgentLibraryView.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/NewAgentLibraryView.tsx@@ -25,6 +25,7 @@ import { SelectedTriggerAgentView } from "./components/selected-views/SelectedTrimport { SelectedTriggerView } from "./components/selected-views/SelectedTriggerView/SelectedTriggerView";import { SelectedViewLayout } from "./components/selected-views/SelectedViewLayout";import { SidebarRunsList } from "./components/sidebar/SidebarRunsList/SidebarRunsList";+import { usePlatformChrome } from "@/app/(platform)/PlatformChrome/usePlatformChrome";import { AGENT_LIBRARY_SECTION_PADDING_X } from "./helpers";import { useMarketplaceUpdate } from "./hooks/useMarketplaceUpdate";import { useNewAgentLibraryView } from "./useNewAgentLibraryView";@@ -67,6 +68,7 @@ export function NewAgentLibraryView() {} = useMarketplaceUpdate({ agent });const [changelogOpen, setChangelogOpen] = useState(false);+ const { isNewLayoutActive } = usePlatformChrome();useEffect(() => {if (agent) {@@ -225,8 +227,24 @@ export function NewAgentLibraryView() {return (<>- <div className="mx-4 grid h-full w-full grid-cols-1 gap-0 pt-3 md:ml-4 md:mr-0 md:gap-4 lg:grid-cols-[25%_70%]">- <SectionWrap className="mb-3 block">+ <div+ className={cn(+ isNewLayoutActive+ ? // New sidebar layout: detail panel sits next to the app sidebar,+ // the runs list becomes a fixed column on the right, and both+ // panels own their scroll on desktop (h-svh + minmax rows)+ // instead of assuming a top-navbar page. Children's mb-3 (from+ // the classic layout) would overflow the viewport-sized rows.+ "grid h-full w-full min-w-0 grid-cols-1 gap-4 px-4 pb-3 pt-3 lg:h-svh lg:grid-cols-[minmax(0,1fr)_340px] lg:grid-rows-[minmax(0,1fr)] lg:[&>*]:mb-0"+ : "mx-4 grid h-full w-full grid-cols-1 gap-0 pt-3 md:ml-4 md:mr-0 md:gap-4 lg:grid-cols-[25%_70%]",+ )}+ >+ <SectionWrap+ className={cn(+ "mb-3 block",+ isNewLayoutActive && "lg:order-2 lg:flex lg:min-h-0 lg:flex-col",+ )}+ ><divclassName={cn("border-b border-zinc-100 pb-5",@@ -253,15 +271,25 @@ export function NewAgentLibraryView() {/></div>- <SidebarRunsList- agent={agent}- selectedRunId={activeItemId ?? undefined}- onSelectRun={handleSelectRun}- onClearSelectedRun={handleClearSelectedRun}- onScheduleDeleted={handleScheduleDeleted}- onTabChange={setActiveTab}- onCountsChange={handleCountsChange}- />+ {/* The tabs panel inside SidebarRunsList is flex-1 with basis 0, so+ it collapses (clipping the cards) unless its root is stretched to+ fill the column height. */}+ <div+ className={cn(+ isNewLayoutActive &&+ "lg:flex lg:min-h-0 lg:flex-1 lg:flex-col lg:[&>div]:min-h-0 lg:[&>div]:flex-1",+ )}+ >+ <SidebarRunsList+ agent={agent}+ selectedRunId={activeItemId ?? undefined}+ onSelectRun={handleSelectRun}+ onClearSelectedRun={handleClearSelectedRun}+ onScheduleDeleted={handleScheduleDeleted}+ onTabChange={setActiveTab}+ onCountsChange={handleCountsChange}+ />+ </div></SectionWrap>{activeItemId ? (diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsxindex 7881b24c7c..da2ad27932 100644--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx@@ -24,7 +24,7 @@ export const MainMarkeplacePage = () => {if (hasError) {return (- <div className="mx-auto w-screen max-w-[1360px]">+ <div className="mx-auto w-full max-w-[1360px]"><main className="px-4"><div className="flex min-h-[400px] items-center justify-center"><ErrorCarddiff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPageLoading.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPageLoading.tsxindex 9b2b02a2f8..d4cd2d31eb 100644--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPageLoading.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPageLoading.tsx@@ -3,7 +3,7 @@ import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";export function MainSearchResultPageLoading() {return (<div className="w-full">- <div className="mx-auto min-h-screen max-w-[1440px] px-10 lg:min-w-[1440px]">+ <div className="mx-auto min-h-screen w-full max-w-[1440px] px-6 md:px-10">{/* Go back button */}<div className="mb-4 mt-5"><Skeleton className="h-9 w-24 rounded-full" />diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/MainSearchResultPage.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/MainSearchResultPage.tsxindex 854b1cc837..b4eaf9f6e6 100644--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/MainSearchResultPage.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/search/components/MainSearchResultPage/MainSearchResultPage.tsx@@ -57,7 +57,7 @@ export const MainSearchResultPage = ({}return (<div className="w-full">- <div className="mx-auto min-h-screen max-w-[1440px] px-10 lg:min-w-[1440px]">+ <div className="mx-auto min-h-screen w-full max-w-[1440px] px-6 md:px-10"><div className="mb-4 mt-5"><Buttonvariant="secondary"diff --git a/autogpt_platform/frontend/src/app/(platform)/profile/(user)/__tests__/useNewSettingsRedirect.test.tsx b/autogpt_platform/frontend/src/app/(platform)/profile/(user)/__tests__/useNewSettingsRedirect.test.tsxnew file mode 100644index 0000000000..08742e1e08--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/profile/(user)/__tests__/useNewSettingsRedirect.test.tsx@@ -0,0 +1,75 @@+import { renderHook } from "@testing-library/react";+import { beforeEach, describe, expect, it, vi } from "vitest";++const { usePathnameMock, usePlatformChromeMock, replaceMock } = vi.hoisted(+ () => ({+ usePathnameMock: vi.fn(() => "/profile"),+ usePlatformChromeMock: vi.fn(() => ({ isNewLayoutActive: true })),+ replaceMock: vi.fn(),+ }),+);++vi.mock("next/navigation", () => ({+ useRouter: () => ({+ push: vi.fn(),+ replace: replaceMock,+ prefetch: vi.fn(),+ back: vi.fn(),+ forward: vi.fn(),+ refresh: vi.fn(),+ }),+ usePathname: usePathnameMock,+ useSearchParams: () => new URLSearchParams(),+ useParams: () => ({}),+}));++vi.mock("@/app/(platform)/PlatformChrome/usePlatformChrome", () => ({+ usePlatformChrome: usePlatformChromeMock,+}));++import { useNewSettingsRedirect } from "../useNewSettingsRedirect";++describe("useNewSettingsRedirect", () => {+ beforeEach(() => {+ replaceMock.mockClear();+ usePlatformChromeMock.mockReturnValue({ isNewLayoutActive: true });+ });++ const mappings: [string, string][] = [+ ["/profile", "/settings/profile"],+ ["/profile/dashboard", "/settings/creator-dashboard"],+ ["/profile/credits", "/settings/billing"],+ ["/profile/integrations", "/settings/integrations"],+ ["/profile/settings", "/settings/account"],+ ["/profile/api-keys", "/settings/api-keys"],+ ["/profile/oauth-apps", "/settings/oauth-apps"],+ ];++ it.each(mappings)("redirects %s to %s", (from, to) => {+ usePathnameMock.mockReturnValue(from);++ const { result } = renderHook(() => useNewSettingsRedirect());++ expect(result.current.isRedirecting).toBe(true);+ expect(replaceMock).toHaveBeenCalledWith(to);+ });++ it("falls back to /settings/profile for an unmapped legacy path", () => {+ usePathnameMock.mockReturnValue("/profile/something-else");++ const { result } = renderHook(() => useNewSettingsRedirect());++ expect(result.current.isRedirecting).toBe(true);+ expect(replaceMock).toHaveBeenCalledWith("/settings/profile");+ });++ it("does not redirect while the classic layout is active", () => {+ usePlatformChromeMock.mockReturnValue({ isNewLayoutActive: false });+ usePathnameMock.mockReturnValue("/profile");++ const { result } = renderHook(() => useNewSettingsRedirect());++ expect(result.current.isRedirecting).toBe(false);+ expect(replaceMock).not.toHaveBeenCalled();+ });+});diff --git a/autogpt_platform/frontend/src/app/(platform)/profile/(user)/layout.tsx b/autogpt_platform/frontend/src/app/(platform)/profile/(user)/layout.tsxindex 870c3e9674..9afa3f9688 100644--- a/autogpt_platform/frontend/src/app/(platform)/profile/(user)/layout.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/profile/(user)/layout.tsx@@ -13,9 +13,11 @@ import {UserCircleIcon,} from "@hugeicons/core-free-icons";import { Icon } from "@/components/atoms/Icon/Icon";+import { useNewSettingsRedirect } from "./useNewSettingsRedirect";export default function Layout({ children }: { children: React.ReactNode }) {const isPaymentEnabled = useGetFlag(Flag.ENABLE_PLATFORM_PAYMENT);+ const { isRedirecting } = useNewSettingsRedirect();const sidebarLinkGroups = [{@@ -63,6 +65,10 @@ export default function Layout({ children }: { children: React.ReactNode }) {},];+ // Under the new layout these legacy pages redirect to /settings — render+ // nothing while the replace() is in flight so the old shell never flashes.+ if (isRedirecting) return null;+return (<div className="flex min-h-screen w-full max-w-[1360px] flex-col lg:flex-row"><Sidebar linkGroups={sidebarLinkGroups} />diff --git a/autogpt_platform/frontend/src/app/(platform)/profile/(user)/useNewSettingsRedirect.ts b/autogpt_platform/frontend/src/app/(platform)/profile/(user)/useNewSettingsRedirect.tsnew file mode 100644index 0000000000..cfa0c16b79--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/profile/(user)/useNewSettingsRedirect.ts@@ -0,0 +1,33 @@+"use client";++import { usePlatformChrome } from "@/app/(platform)/PlatformChrome/usePlatformChrome";+import { usePathname, useRouter } from "next/navigation";+import { useEffect } from "react";++// The old /profile pages are superseded by /settings under the new layout.+// Each legacy page maps to its closest new-settings equivalent.+const LEGACY_TO_NEW_SETTINGS: Record<string, string> = {+ "/profile": "/settings/profile",+ "/profile/dashboard": "/settings/creator-dashboard",+ "/profile/credits": "/settings/billing",+ "/profile/integrations": "/settings/integrations",+ "/profile/settings": "/settings/account",+ "/profile/api-keys": "/settings/api-keys",+ "/profile/oauth-apps": "/settings/oauth-apps",+};++export function useNewSettingsRedirect() {+ const { isNewLayoutActive } = usePlatformChrome();+ const pathname = usePathname();+ const router = useRouter();++ const redirectTo = isNewLayoutActive+ ? (LEGACY_TO_NEW_SETTINGS[pathname ?? ""] ?? "/settings/profile")+ : null;++ useEffect(() => {+ if (redirectTo) router.replace(redirectTo);+ }, [redirectTo, router]);++ return { isRedirecting: Boolean(redirectTo) };+}diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/SettingsNavItem.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/SettingsNavItem.tsxindex d27b72c291..015efbc9b8 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/SettingsNavItem.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/SettingsNavItem.tsx@@ -69,12 +69,12 @@ export function SettingsNavItem({ item, isActive }: Props) {};return (- <motion.div variants={variants} className="w-[217px]">+ <motion.div variants={variants} className="w-full"><Linkhref={item.href}aria-current={isActive ? "page" : undefined}className={cn(- "flex h-[38px] w-[217px] items-center gap-2 rounded-[8px] px-3 text-[#505057] transition-colors",+ "flex h-[38px] w-full items-center gap-2 rounded-[8px] px-3 text-[#505057] transition-colors",isActive ? "bg-[#EFEFF0]" : "hover:bg-[#F5F5F6]",)}>diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/TourChatHeader.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/TourChatHeader.tsxindex bfbe085a4c..3accdc41e5 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/TourChatHeader.tsx+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/TourChatHeader.tsx@@ -19,8 +19,7 @@ export function TourChatHeader({ scenarioLabel, scenarioIcon }: Props) {return (<header className="flex shrink-0 items-center justify-between gap-2 border-b border-zinc-200/70 bg-white/70 px-3 py-2 backdrop-blur-sm md:px-4"><div className="flex min-w-0 items-center gap-1.5">- {/* SidebarTrigger drops className, so the responsive hiding lives on- a wrapper — on mobile this is the only way to reach the sidebar. */}+ {/* On mobile this is the only way to reach the sidebar. */}<div className="md:hidden"><SidebarTrigger /></div>diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/RecentChats.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/RecentChats.tsxindex c94051d273..d04c61cc05 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/RecentChats.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/RecentChats.tsx@@ -7,6 +7,8 @@ import { useExpertMap } from "@/app/(platform)/copilot/useExpertMap";import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";import { SidebarMenu } from "@/components/ui/sidebar";import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";+import { Icon } from "@/components/atoms/Icon/Icon";+import { PinIcon } from "@hugeicons/core-free-icons";import { ExpertChatGroup } from "./components/ExpertChatGroup/ExpertChatGroup";import { RecentChatItem } from "./components/RecentChatItem/RecentChatItem";import { groupSessionsByDate } from "./helpers";@@ -14,6 +16,7 @@ import { useRecentChats } from "./useRecentChats";export function RecentChats() {const chatSharingEnabled = useGetFlag(Flag.CHAT_SHARING);+ const chatPinningEnabled = useGetFlag(Flag.CHAT_PINNING);const isExpertsEnabled = useGetFlag(Flag.HIRE_EXPERTS);const { expertsById } = useExpertMap();const {@@ -23,6 +26,7 @@ export function RecentChats() {isLoadingMore,loadMore,activeSessionId,+ togglePin,editingSessionId,editingTitle,setEditingTitle,@@ -68,6 +72,8 @@ export function RecentChats() {isExporting={exportingIds.has(session.id)}isDeleting={isDeleting}chatSharingEnabled={chatSharingEnabled}+ chatPinningEnabled={chatPinningEnabled}+ onPin={togglePin}onRename={startRename}onExport={exportChat}onShare={setSharingSessionId}@@ -76,11 +82,28 @@ export function RecentChats() {);}+ const pinnedSessions = chatPinningEnabled+ ? sessions.filter((session) => !!session.is_pinned)+ : [];+ const unpinnedSessions =+ pinnedSessions.length > 0+ ? sessions.filter((session) => !session.is_pinned)+ : sessions;+return (<><div className="mt-2 flex flex-col gap-4">+ {pinnedSessions.length > 0 && (+ <div>+ <div className="flex items-center gap-1.5 px-2 pb-1.5 text-xs font-medium text-zinc-500">+ <Icon icon={PinIcon} className="size-3.5" />+ <span className="truncate">Pinned</span>+ </div>+ <SidebarMenu>{pinnedSessions.map(renderItem)}</SidebarMenu>+ </div>+ )}{isExpertsEnabled- ? groupSessionsByExpert(sessions).map((group) => {+ ? groupSessionsByExpert(unpinnedSessions).map((group) => {const expert = group.expertId? expertsById.get(group.expertId): null;@@ -99,7 +122,7 @@ export function RecentChats() {/>);})- : groupSessionsByDate(sessions).map((group) => (+ : groupSessionsByDate(unpinnedSessions).map((group) => (<div key={group.label}><div className="flex items-center gap-1.5 px-2 pb-1.5 text-xs font-medium text-zinc-500"><span className="truncate">{group.label}</span>diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/RecentChats.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/RecentChats.test.tsxindex 536b2d9a2f..cfe49475db 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/RecentChats.test.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/RecentChats.test.tsx@@ -13,6 +13,8 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { useCopilotUIStore } from "@/app/(platform)/copilot/store";import { RecentChats } from "../RecentChats";+const mockEnabledFlags = new Set<string>(["chat-sharing"]);+vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {const actual =await importOriginal<@@ -20,7 +22,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {>();return {...actual,- useGetFlag: (flag: string) => flag === "chat-sharing",+ useGetFlag: (flag: string) => mockEnabledFlags.has(flag),};});@@ -28,6 +30,7 @@ interface SessionSeed {id: string;title: string;updated_at: string;+ is_pinned?: boolean;}function makeSession(seed: SessionSeed) {@@ -35,6 +38,7 @@ function makeSession(seed: SessionSeed) {id: seed.id,title: seed.title,is_processing: false,+ is_pinned: seed.is_pinned ?? false,created_at: seed.updated_at,updated_at: seed.updated_at,};@@ -60,6 +64,7 @@ beforeEach(() => {afterEach(() => {vi.useRealTimers();server.resetHandlers();+ mockEnabledFlags.delete("chat-pinning");});describe("RecentChats — empty + loading", () => {@@ -92,6 +97,61 @@ describe("RecentChats — grouped list", () => {});});+describe("RecentChats — pinned split", () => {+ const pinnedAndDated = [+ makeSession({+ id: "pinned",+ title: "Pinned chat",+ updated_at: YESTERDAY,+ is_pinned: true,+ }),+ makeSession({ id: "loose", title: "Loose chat", updated_at: TODAY }),+ ];++ it("lifts pinned sessions out of the date groups", async () => {+ mockEnabledFlags.add("chat-pinning");+ server.use(+ getGetV2ListSessionsMockHandler200({+ sessions: pinnedAndDated,+ total: pinnedAndDated.length,+ }),+ );+ renderRecentChats();++ const pinnedGroup = (await screen.findByText("Pinned")).closest(+ "div",+ )?.parentElement;+ if (!pinnedGroup) throw new Error("pinned group not found");+ expect(within(pinnedGroup).getByText("Pinned chat")).toBeDefined();++ // The only "Yesterday" session is pinned, so that date group disappears.+ expect(screen.queryByText("Yesterday")).toBeNull();++ const todayGroup = screen.getByText("Today").closest("div")?.parentElement;+ if (!todayGroup) throw new Error("today group not found");+ expect(within(todayGroup).getByText("Loose chat")).toBeDefined();+ expect(within(todayGroup).queryByText("Pinned chat")).toBeNull();+ });++ it("keeps pinned sessions in their date group when the flag is off", async () => {+ server.use(+ getGetV2ListSessionsMockHandler200({+ sessions: pinnedAndDated,+ total: pinnedAndDated.length,+ }),+ );+ renderRecentChats();++ await screen.findByText("Pinned chat");+ expect(screen.queryByText("Pinned")).toBeNull();+ const yesterdayGroup = screen+ .getByText("Yesterday")+ .closest("div")?.parentElement;+ if (!yesterdayGroup) throw new Error("yesterday group not found");+ expect(within(yesterdayGroup).getByText("Pinned chat")).toBeDefined();+ });+});+describe("RecentChats — load more", () => {it("hides 'Load more' when all sessions are loaded", async () => {server.use(diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/useRecentChats.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/useRecentChats.test.tsxindex be652b0a1b..a2e3918ee4 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/useRecentChats.test.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/useRecentChats.test.tsx@@ -130,6 +130,51 @@ describe("useRecentChats — rename", () => {});});+describe("useRecentChats — pin", () => {+ it("sends the flipped is_pinned value", async () => {+ const bodies: unknown[] = [];+ server.use(+ http.patch("*/api/chat/sessions/:id/pinned", async ({ request }) => {+ bodies.push(await request.json());+ return HttpResponse.json({});+ }),+ );+ const { result } = renderHook(() => useRecentChats(), {+ wrapper: makeWrapper(),+ });++ act(() => result.current.togglePin("s1", false));+ await waitFor(() => expect(bodies).toHaveLength(1));+ expect(bodies[0]).toEqual({ is_pinned: true });++ act(() => result.current.togglePin("s1", true));+ await waitFor(() => expect(bodies).toHaveLength(2));+ expect(bodies[1]).toEqual({ is_pinned: false });+ });++ it("toasts when the pin request fails", async () => {+ server.use(+ http.patch("*/api/chat/sessions/:id/pinned", () =>+ HttpResponse.json({ detail: "nope" }, { status: 500 }),+ ),+ );+ const { result } = renderHook(() => useRecentChats(), {+ wrapper: makeWrapper(),+ });++ act(() => result.current.togglePin("s1", false));++ await waitFor(() => {+ expect(toastMock).toHaveBeenCalledWith(+ expect.objectContaining({+ title: "Failed to update chat",+ variant: "destructive",+ }),+ );+ });+ });+});+describe("useRecentChats — export", () => {it("toasts success after a successful export", async () => {server.use(diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/RecentChatItem/RecentChatItem.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/RecentChatItem/RecentChatItem.tsxindex 3f055f1cae..d3d7cc4ef6 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/RecentChatItem/RecentChatItem.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/RecentChatItem/RecentChatItem.tsx@@ -14,7 +14,7 @@ import {SidebarMenuButton,SidebarMenuItem,} from "@/components/ui/sidebar";-import Link from "next/link";+import Link, { useLinkStatus } from "next/link";import { useRef } from "react";import {Delete02Icon,@@ -22,6 +22,8 @@ import {Loading03Icon,MoreHorizontalIcon,PencilIcon,+ PinIcon,+ PinOffIcon,Share03Icon,} from "@hugeicons/core-free-icons";import { Icon } from "@/components/atoms/Icon/Icon";@@ -31,6 +33,7 @@ interface Session {title?: string | null;source_platform?: string | null;is_processing?: boolean | null;+ is_pinned?: boolean | null;updated_at: string;}@@ -45,12 +48,29 @@ interface Props {isExporting: boolean;isDeleting: boolean;chatSharingEnabled: boolean;+ chatPinningEnabled: boolean;+ onPin: (id: string, isPinned: boolean) => void;onRename: (id: string, title: string | null | undefined) => void;onExport: (id: string, title: string | null | undefined) => void;onShare: (id: string) => void;onDelete: (id: string, title: string | null | undefined) => void;}+// Rendered inside the <Link>, so useLinkStatus reports that link's pending+// navigation — mirrors the loader on the main sidebar nav links.+function ChatLinkLoader() {+ const { pending } = useLinkStatus();++ if (!pending) return null;++ return (+ <LoadingSpinner+ size="small"+ className="ml-auto !size-4 shrink-0 text-zinc-500"+ />+ );+}+export function RecentChatItem({session,isActive,@@ -62,6 +82,8 @@ export function RecentChatItem({isExporting,isDeleting,chatSharingEnabled,+ chatPinningEnabled,+ onPin,onRename,onExport,onShare,@@ -127,6 +149,7 @@ export function RecentChatItem({<ChatOriginIcon sourcePlatform={session.source_platform} />) : null}<span className="truncate">{title}</span>+ <ChatLinkLoader /></Link></SidebarMenuButton>@@ -144,6 +167,18 @@ export function RecentChatItem({</SidebarMenuAction></DropdownMenuTrigger><DropdownMenuContent align="end">+ {chatPinningEnabled && (+ <DropdownMenuItem+ onClick={() => onPin(session.id, !!session.is_pinned)}+ >+ {session.is_pinned ? (+ <Icon icon={PinOffIcon} className="mr-2 h-4 w-4" />+ ) : (+ <Icon icon={PinIcon} className="mr-2 h-4 w-4" />+ )}+ {session.is_pinned ? "Unpin chat" : "Pin chat"}+ </DropdownMenuItem>+ )}<DropdownMenuItem onClick={() => onRename(session.id, session.title)}><Icon icon={PencilIcon} className="mr-2 h-4 w-4" />Renamediff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/RecentChatItem/__tests__/RecentChatItem.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/RecentChatItem/__tests__/RecentChatItem.test.tsxindex 91906e5922..76f648709c 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/RecentChatItem/__tests__/RecentChatItem.test.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/components/RecentChatItem/__tests__/RecentChatItem.test.tsx@@ -9,6 +9,7 @@ interface Session {title?: string | null;source_platform?: string | null;is_processing?: boolean | null;+ is_pinned?: boolean | null;updated_at: string;}@@ -32,6 +33,8 @@ function makeProps(isExporting: false,isDeleting: false,chatSharingEnabled: false,+ chatPinningEnabled: false,+ onPin: vi.fn(),onRename: vi.fn(),onExport: vi.fn(),onShare: vi.fn(),@@ -177,3 +180,43 @@ describe("RecentChatItem — actions menu", () => {expect(await screen.findByText(/exporting/i)).toBeDefined();});});++describe("RecentChatItem — pinning", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ });++ it("hides the pin action when pinning is disabled", async () => {+ renderItem(makeProps({ chatPinningEnabled: false }));++ openActions();+ await screen.findByRole("menuitem", { name: /rename/i });+ expect(screen.queryByRole("menuitem", { name: /pin chat/i })).toBeNull();+ });++ it("offers Pin chat for an unpinned session and reports it as not yet pinned", async () => {+ const onPin = vi.fn();+ renderItem(makeProps({ chatPinningEnabled: true, onPin }));++ openActions();+ fireEvent.click(await screen.findByRole("menuitem", { name: "Pin chat" }));+ expect(onPin).toHaveBeenCalledWith("s1", false);+ });++ it("offers Unpin chat for a pinned session and reports it as currently pinned", async () => {+ const onPin = vi.fn();+ renderItem(+ makeProps({+ chatPinningEnabled: true,+ onPin,+ session: { ...baseSession, is_pinned: true },+ }),+ );++ openActions();+ fireEvent.click(+ await screen.findByRole("menuitem", { name: "Unpin chat" }),+ );+ expect(onPin).toHaveBeenCalledWith("s1", true);+ });+});diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/useRecentChats.ts b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/useRecentChats.tsindex 23689dfce6..bc2afacc09 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/useRecentChats.ts+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/useRecentChats.ts@@ -1,5 +1,6 @@import {getV2GetSession,+ usePatchV2UpdateSessionPinned,usePatchV2UpdateSessionTitle,} from "@/app/api/__generated__/endpoints/chat/chat";import { fetchAndExportChat } from "@/app/(platform)/copilot/helpers/exportChatAsMarkdown";@@ -36,6 +37,22 @@ export function useRecentChats() {cancelDelete,} = useSessionDeletion();+ const { mutate: setSessionPinned } = usePatchV2UpdateSessionPinned({+ mutation: {+ onSuccess: () => {+ queryClient.invalidateQueries({ queryKey: SESSION_LIST_QUERY_KEY });+ },+ onError: (error) => {+ toast({+ title: "Failed to update chat",+ description:+ error instanceof Error ? error.message : "An error occurred",+ variant: "destructive",+ });+ },+ },+ });+const { mutate: renameSession } = usePatchV2UpdateSessionTitle({mutation: {onSuccess: () => {@@ -54,6 +71,10 @@ export function useRecentChats() {},});+ function togglePin(id: string, isPinned: boolean) {+ setSessionPinned({ sessionId: id, data: { is_pinned: !isPinned } });+ }+function startRename(id: string, title: string | null | undefined) {setEditingSessionId(id);setEditingTitle(title || "");@@ -99,6 +120,7 @@ export function useRecentChats() {isLoadingMore,loadMore,activeSessionId,+ togglePin,editingSessionId,editingTitle,setEditingTitle,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 d9ed78f741..99ca2fa26d 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@@ -50,6 +50,18 @@ describe("getAccountMenuItems", () => {expect(texts).not.toContain("Admin");});+ test("new layout points What's new at the changelog docs", () => {+ const items = getAccountMenuItems(undefined, true).flatMap(+ (group) => group.items,+ );+ const whatsNew = items.find((item) => item.text === "What's new");++ expect(whatsNew?.href).toBe(+ "https://agpt.co/docs/platform/changelog/changelog/",+ );+ expect(whatsNew?.external).toBe(true);+ });+test("new layout adds an Admin entry for admin users", () => {const texts = flattenTexts(getAccountMenuItems("admin", true));diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/__tests__/WalletCompactPanel.test.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/__tests__/WalletCompactPanel.test.tsxindex 295defc293..fa151b0a0b 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/__tests__/WalletCompactPanel.test.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/__tests__/WalletCompactPanel.test.tsx@@ -4,7 +4,7 @@ import userEvent from "@testing-library/user-event";import { describe, expect, it, vi } from "vitest";import { WalletCompactPanel } from "../components/WalletCompactPanel";-import { getEarnRows, getTaskGroups, TaskGroup } from "../helpers";+import { getEarnGroups, getTaskGroups, TaskGroup } from "../helpers";vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {const actual =@@ -58,68 +58,64 @@ const completedSteps: OnboardingStep[] = ["MARKETPLACE_ADD_AGENT",];-describe("getEarnRows", () => {- it("collapses a fully completed group into a single Done row", () => {- const rows = getEarnRows(groups, completedSteps);-- expect(rows).toEqual([- {- key: "First Wins",- label: "First Wins · 2 of 2",- done: true,- amount: 0,- },- {- key: "SCHEDULE_AGENT",- label: "Schedule your first agent",- done: false,- amount: 1,- },- {- key: "RUN_3_DAYS",- label: "Run agents 3 days in a row",- done: false,- amount: 2,- },- ]);+describe("getEarnGroups", () => {+ it("marks a fully completed group done and collapsed by default", () => {+ const earnGroups = getEarnGroups(groups, completedSteps);++ expect(earnGroups[0]).toEqual({+ key: "First Wins",+ label: "First Wins · 2 of 2",+ done: true,+ amount: 0,+ defaultOpen: false,+ rows: [+ {+ key: "ONBOARDING_COMPLETE",+ label: "Complete onboarding",+ done: true,+ amount: 3,+ },+ {+ key: "MARKETPLACE_ADD_AGENT",+ label: "Get an agent from the marketplace",+ done: true,+ amount: 1,+ },+ ],+ });});- it("lists every task of a group that is still in progress", () => {- const rows = getEarnRows(groups, ["SCHEDULE_AGENT"]);+ it("keeps an in-progress group expanded and sums the remaining rewards", () => {+ const earnGroups = getEarnGroups(groups, ["SCHEDULE_AGENT"]);- expect(rows.map((row) => row.key)).toEqual([- "ONBOARDING_COMPLETE",- "MARKETPLACE_ADD_AGENT",- "SCHEDULE_AGENT",- "RUN_3_DAYS",- ]);- expect(rows.find((row) => row.key === "SCHEDULE_AGENT")?.done).toBe(true);+ expect(earnGroups[1].label).toBe("Consistency Challenge · 1 of 2");+ expect(earnGroups[1].done).toBe(false);+ expect(earnGroups[1].defaultOpen).toBe(true);+ expect(earnGroups[1].amount).toBe(2);+ expect(earnGroups[1].rows.map((row) => row.done)).toEqual([true, false]);});it("treats a missing completedSteps list as nothing claimed", () => {- const rows = getEarnRows(groups, undefined);-- expect(rows.map((row) => row.key)).toEqual([- "ONBOARDING_COMPLETE",- "MARKETPLACE_ADD_AGENT",- "SCHEDULE_AGENT",- "RUN_3_DAYS",- ]);- expect(rows.every((row) => !row.done)).toBe(true);+ const earnGroups = getEarnGroups(groups, undefined);++ expect(earnGroups.every((group) => !group.done)).toBe(true);+ expect(+ earnGroups.flatMap((group) => group.rows).every((row) => !row.done),+ ).toBe(true);});it("keeps every real onboarding task reachable", () => {const realGroups = getTaskGroups(null);- const rows = getEarnRows(realGroups, []);+ const earnGroups = getEarnGroups(realGroups, []);- expect(rows).toHaveLength(+ expect(earnGroups.flatMap((group) => group.rows)).toHaveLength(realGroups.reduce((total, group) => total + group.tasks.length, 0),);});});describe("WalletCompactPanel", () => {- it("shows the balance, the earn list and the completed group as Done", () => {+ it("shows the balance and one header row per group", () => {render(<WalletCompactPanelgroups={groups}@@ -134,11 +130,10 @@ describe("WalletCompactPanel", () => {expect(screen.getByText("Earn credits")).toBeDefined();expect(screen.getByText("First Wins · 2 of 2")).toBeDefined();expect(screen.getByText("Done")).toBeDefined();- expect(screen.getByText("Schedule your first agent")).toBeDefined();- expect(screen.getByText("$2.00")).toBeDefined();+ expect(screen.getByText("Consistency Challenge · 0 of 2")).toBeDefined();});- it("collapses the earn credits list when the accordion is toggled", async () => {+ it("hides a completed group's tasks until its header is expanded", async () => {render(<WalletCompactPanelgroups={groups}@@ -148,11 +143,61 @@ describe("WalletCompactPanel", () => {/>,);- await userEvent.click(screen.getByRole("button", { name: /Earn credits/ }));+ expect(screen.queryByText("Complete onboarding")).toBeNull();++ await userEvent.click(+ screen.getByRole("button", { name: /First Wins · 2 of 2/ }),+ );++ expect(screen.getByText("Complete onboarding")).toBeDefined();+ expect(screen.getByText("Get an agent from the marketplace")).toBeDefined();+ });++ it("shows an in-progress group's tasks by default and collapses on toggle", async () => {+ render(+ <WalletCompactPanel+ groups={groups}+ completedSteps={completedSteps}+ formattedCredits="$9.79"+ onAddCredits={() => {}}+ />,+ );++ expect(screen.getByText("Schedule your first agent")).toBeDefined();+ expect(screen.getByText("$2.00")).toBeDefined();++ await userEvent.click(+ screen.getByRole("button", { name: /Consistency Challenge/ }),+ );expect(screen.queryByText("Schedule your first agent")).toBeNull();});+ it("collapses a group once its last task is completed", () => {+ const { rerender } = render(+ <WalletCompactPanel+ groups={groups}+ completedSteps={["SCHEDULE_AGENT"]}+ formattedCredits="$9.79"+ onAddCredits={() => {}}+ />,+ );++ expect(screen.getByText("Run agents 3 days in a row")).toBeDefined();++ rerender(+ <WalletCompactPanel+ groups={groups}+ completedSteps={["SCHEDULE_AGENT", "RUN_3_DAYS"]}+ formattedCredits="$9.79"+ onAddCredits={() => {}}+ />,+ );++ expect(screen.queryByText("Run agents 3 days in a row")).toBeNull();+ expect(screen.getByText("Consistency Challenge · 2 of 2")).toBeDefined();+ });+it("calls onAddCredits when the Add credits row is clicked", async () => {const onAddCredits = vi.fn();render(diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/components/WalletCompactPanel.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/components/WalletCompactPanel.tsxindex be5769470f..6afdf4e3f2 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/components/WalletCompactPanel.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/components/WalletCompactPanel.tsx@@ -1,15 +1,18 @@"use client";import { Text } from "@/components/atoms/Text/Text";-import { Collapsible } from "@/components/molecules/Collapsible/Collapsible";+import { Icon } from "@/components/atoms/Icon/Icon";+import { cn } from "@/lib/utils";import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";-import { getEarnRows, TaskGroup } from "../helpers";import {+ ArrowDown01Icon,CheckmarkBadge01Icon,CircleIcon,CreditCardIcon,} from "@hugeicons/core-free-icons";-import { Icon } from "@/components/atoms/Icon/Icon";+import { useState } from "react";++import { EarnGroup, EarnRow, getEarnGroups, TaskGroup } from "../helpers";interface Props {groups: TaskGroup[];@@ -25,7 +28,7 @@ export function WalletCompactPanel({onAddCredits,}: Props) {const isPaymentEnabled = useGetFlag(Flag.ENABLE_PLATFORM_PAYMENT);- const rows = getEarnRows(groups, completedSteps);+ const earnGroups = getEarnGroups(groups, completedSteps);return (<div className="flex flex-col gap-1">@@ -47,44 +50,89 @@ export function WalletCompactPanel({</button>)}- <Collapsible- defaultOpen- triggerClassName="px-3 pb-1.5 pt-2"- trigger={<Text variant="body-medium">Earn credits</Text>}+ <div className="px-3 pb-1.5 pt-2">+ <Text variant="body-medium">Earn credits</Text>+ </div>+ <div className="max-h-[20rem] overflow-y-auto scrollbar-thin scrollbar-track-transparent scrollbar-thumb-zinc-200">+ {earnGroups.map((group) => (+ // `defaultOpen` is part of the key so finishing the last task in a+ // group remounts its section and re-seeds it collapsed, instead of+ // leaving the completed group stuck open.+ <EarnGroupSection+ key={`${group.key}:${group.defaultOpen}`}+ group={group}+ />+ ))}+ </div>+ </div>+ );+}++function EarnGroupSection({ group }: { group: EarnGroup }) {+ const [open, setOpen] = useState(group.defaultOpen);++ return (+ <div>+ <button+ type="button"+ onClick={() => setOpen((prev) => !prev)}+ aria-expanded={open}+ className="flex w-full items-start justify-between gap-3 rounded-large px-3 py-1.5 text-left transition-colors hover:bg-zinc-50">- <div className="max-h-[20rem] overflow-y-auto">- {rows.map((row) => (- <div- key={row.key}- className="flex items-start justify-between gap-3 px-3 py-1.5"- >- <div className="flex min-w-0 items-start gap-2.5">- <span className="mt-0.5 shrink-0">- {row.done ? (- <Icon- icon={CheckmarkBadge01Icon}- size={18}- className="text-[#00a656]"- aria-label="completed"- />- ) : (- <Icon- icon={CircleIcon}- size={16}- className="text-zinc-400"- aria-label="pending"- />- )}- </span>- <Text variant="body">{row.label}</Text>- </div>- <span className="shrink-0 font-sans text-sm text-zinc-500">- {row.done ? "Done" : `$${row.amount.toFixed(2)}`}- </span>- </div>- ))}- </div>- </Collapsible>+ <span className="flex min-w-0 items-start gap-2.5">+ <StatusIcon done={group.done} />+ <Text variant="body-medium">{group.label}</Text>+ <Icon+ icon={ArrowDown01Icon}+ size={14}+ className={cn(+ "mt-1 shrink-0 text-zinc-400 transition-transform duration-200",+ open && "rotate-180",+ )}+ />+ </span>+ <span className="shrink-0 font-sans text-sm text-zinc-500">+ {group.done ? "Done" : `$${group.amount.toFixed(2)}`}+ </span>+ </button>++ {open && group.rows.map((row) => <EarnTaskRow key={row.key} row={row} />)}+ </div>+ );+}++function EarnTaskRow({ row }: { row: EarnRow }) {+ return (+ <div className="flex items-start justify-between gap-3 py-1.5 pl-8 pr-3">+ <div className="flex min-w-0 items-start gap-2.5">+ <StatusIcon done={row.done} />+ <Text variant="body">{row.label}</Text>+ </div>+ <span className="shrink-0 font-sans text-sm text-zinc-500">+ {row.done ? "Done" : `$${row.amount.toFixed(2)}`}+ </span></div>);}++function StatusIcon({ done }: { done: boolean }) {+ return (+ <span className="mt-0.5 shrink-0">+ {done ? (+ <Icon+ icon={CheckmarkBadge01Icon}+ size={18}+ className="text-[#00a656]"+ aria-label="completed"+ />+ ) : (+ <Icon+ icon={CircleIcon}+ size={16}+ className="text-zinc-400"+ aria-label="pending"+ />+ )}+ </span>+ );+}diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/helpers.ts b/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/helpers.tsindex 2452eea64f..2f2e7029b5 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/helpers.ts+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/helpers.ts@@ -115,12 +115,23 @@ export interface EarnRow {amount: number;}+export interface EarnGroup {+ key: string;+ label: string;+ done: boolean;+ /** Sum of the rewards still claimable in this group (0 when done). */+ amount: number;+ /** Done groups start collapsed; in-progress groups start expanded. */+ defaultOpen: boolean;+ rows: EarnRow[];+}+/**- * Flattens the task groups into a single list for the compact panel: a fully- * completed group collapses to one "Done" row, while any group still in- * progress contributes one row per task.+ * Shapes the task groups for the compact panel accordion: every group gets a+ * "Name · N of M" header row, keeps its tasks as sub-rows, and starts+ * collapsed only once fully completed.*/-export function getEarnRows(+export function getEarnGroups(groups: TaskGroup[],// The onboarding payload is typed as always carrying `completedSteps`, but// the rest of the wallet already guards against it being absent — do the same@@ -128,28 +139,28 @@ export function getEarnRows(// TypeError. Plain string[] (not OnboardingStep[]): stored rows may contain// legacy step names; the typed task ids still get typo protection.completedSteps: string[] | undefined,-): EarnRow[] {+): EarnGroup[] {const claimed = completedSteps ?? [];- return groups.flatMap((group): EarnRow[] => {- const completed = group.tasks.filter((task) => claimed.includes(task.id));-- if (completed.length === group.tasks.length) {- return [- {- key: group.name,- label: `${group.name} · ${completed.length} of ${group.tasks.length}`,- done: true,- amount: 0,- },- ];- }-- return group.tasks.map((task) => ({+ return groups.map((group): EarnGroup => {+ const rows = group.tasks.map((task) => ({key: task.id,label: task.name,done: claimed.includes(task.id),amount: task.amount,}));+ const completedCount = rows.filter((row) => row.done).length;+ const done = completedCount === rows.length;++ return {+ key: group.name,+ label: `${group.name} · ${completedCount} of ${rows.length}`,+ done,+ amount: rows+ .filter((row) => !row.done)+ .reduce((total, row) => total + row.amount, 0),+ defaultOpen: !done,+ rows,+ };});}diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/helpers.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/helpers.tsxindex bd61da6f87..123659db80 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/helpers.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/helpers.tsx@@ -110,7 +110,7 @@ function getNewLayoutAccountMenuItems(userRole?: string): MenuItemGroup[] {{icon: IconType.WhatsNew,text: "What's new",- href: "https://agpt.co/changelog",+ href: "https://agpt.co/docs/platform/changelog/changelog/",external: true,},{diff --git a/autogpt_platform/frontend/src/components/ui/sidebar.tsx b/autogpt_platform/frontend/src/components/ui/sidebar.tsxindex 3f0494e623..9f72083430 100644--- a/autogpt_platform/frontend/src/components/ui/sidebar.tsx+++ b/autogpt_platform/frontend/src/components/ui/sidebar.tsx@@ -281,7 +281,7 @@ Sidebar.displayName = "Sidebar";const SidebarTrigger = React.forwardRef<React.ElementRef<typeof Button>,React.ComponentProps<typeof Button>->(({ onClick }, ref) => {+>(({ className, onClick }, ref) => {const { toggleSidebar } = useSidebar();return (@@ -290,6 +290,7 @@ const SidebarTrigger = React.forwardRef<data-sidebar="trigger"variant="ghost"size="icon"+ className={className}onClick={(event) => {onClick?.(event);toggleSidebar();diff --git a/autogpt_platform/frontend/src/lib/__tests__/utils.test.ts b/autogpt_platform/frontend/src/lib/__tests__/utils.test.tsindex 72b79e4633..c0c8be3866 100644--- a/autogpt_platform/frontend/src/lib/__tests__/utils.test.ts+++ b/autogpt_platform/frontend/src/lib/__tests__/utils.test.ts@@ -1,5 +1,9 @@import { describe, expect, test } from "vitest";-import { agentGraphExportFilename, setNestedProperty } from "../utils";+import {+ agentGraphExportFilename,+ matchesRoute,+ setNestedProperty,+} from "../utils";const testCases = [{@@ -131,3 +135,52 @@ describe("agentGraphExportFilename", () => {);});});++const matchesRouteCases = [+ { name: "null pathname", pathname: null, base: "/build", expected: false },+ {+ name: "undefined pathname",+ pathname: undefined,+ base: "/build",+ expected: false,+ },+ { name: "exact match", pathname: "/build", base: "/build", expected: true },+ {+ name: "sub-route match",+ pathname: "/admin/bots",+ base: "/admin",+ expected: true,+ },+ {+ name: "deep sub-route match",+ pathname: "/admin/bots/42",+ base: "/admin",+ expected: true,+ },+ {+ name: "partial prefix is not a match",+ pathname: "/builder",+ base: "/build",+ expected: false,+ },+ {+ name: "sibling route sharing a prefix is not a match",+ pathname: "/admin-legacy/bots",+ base: "/admin",+ expected: false,+ },+ {+ name: "unrelated route",+ pathname: "/copilot",+ base: "/build",+ expected: false,+ },+];++describe("matchesRoute", () => {+ for (const { name, pathname, base, expected } of matchesRouteCases) {+ test(name, () => {+ expect(matchesRoute(pathname, base)).toBe(expected);+ });+ }+});diff --git a/autogpt_platform/frontend/src/lib/utils.ts b/autogpt_platform/frontend/src/lib/utils.tsindex 197048beb3..ebf880ec75 100644--- a/autogpt_platform/frontend/src/lib/utils.ts+++ b/autogpt_platform/frontend/src/lib/utils.ts@@ -455,3 +455,15 @@ export function getApprovedMarketplaceUrl(args: {}return `/marketplace/agent/${encodeURIComponent(args.creatorUsername)}/${encodeURIComponent(args.slug)}`;}++/**+ * True when `pathname` is `base` itself or one of its sub-routes. Tolerates the+ * `null` that `usePathname()` is typed to return.+ */+export function matchesRoute(+ pathname: string | null | undefined,+ base: string,+): boolean {+ if (!pathname) return false;+ return pathname === base || pathname.startsWith(`${base}/`);+}