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): combine new tasks and recap on home (#15035)
Ubbe0dade1978c80
diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/usePlatformChrome.test.ts b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/usePlatformChrome.test.tsindex 147b75c199..1a3ba9e42f 100644--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/usePlatformChrome.test.ts+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/usePlatformChrome.test.ts@@ -145,3 +145,10 @@ describe("usePlatformChrome", () => {});});});++it("gives home the chat controls and floating header", () => {+ pathnameMock.mockReturnValue("/home");+ const { result } = renderHook(() => usePlatformChrome());+ expect(result.current.isCopilotRoute).toBe(true);+ expect(result.current.overlayInsetHeader).toBe(true);+});diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/ArtifactsPanelNavCollapse/useArtifactsPanelNavCollapse.ts b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/ArtifactsPanelNavCollapse/useArtifactsPanelNavCollapse.tsindex c1d6783a0f..0d68a34a24 100644--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/ArtifactsPanelNavCollapse/useArtifactsPanelNavCollapse.ts+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/components/ArtifactsPanelNavCollapse/useArtifactsPanelNavCollapse.ts@@ -7,7 +7,8 @@ import { useEffect, useRef } from "react";export function useArtifactsPanelNavCollapse() {const pathname = usePathname();const { open, setOpen } = useSidebar();- const isCopilotRoute = matchesRoute(pathname, "/copilot");+ const isCopilotRoute =+ matchesRoute(pathname, "/home") || matchesRoute(pathname, "/copilot");// The docked right panel: an open artifact preview or the artifacts tab.// The floating files card doesn't count — it overlays the chat column// without narrowing it. Leaving /copilot counts as closing, so the navdiff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.ts b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.tsindex 1cc82ef4bb..f823441e39 100644--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.ts+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.ts@@ -42,7 +42,8 @@ export function usePlatformChrome() {const isMarketplaceRoute = matchesRoute(pathname, "/marketplace");- const isCopilotRoute = matchesRoute(pathname, "/copilot");+ const isCopilotRoute =+ matchesRoute(pathname, "/home") || matchesRoute(pathname, "/copilot");const isBuilderRoute = matchesRoute(pathname, "/build");diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsxindex 58c6b6ebb2..36e7ce0ee6 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/CopilotPage.tsx@@ -1,7 +1,6 @@"use client";import { LowCreditBanner } from "@/components/layout/TopUpPrompt/LowCreditBanner/LowCreditBanner";-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";@@ -42,8 +41,6 @@ const ContextPanel = dynamic(export function CopilotPage() {const [droppedFiles, setDroppedFiles] = useState<File[]>([]);const isMobile = useIsMobile();- // The brain-dump experience swaps the dotted backdrop + notification- // opt-in dialog for the quieter greeting surface (banner to follow).const isBrainDumpEnabled = useGetFlag(Flag.ONBOARDING_BRAIN_DUMP);// Use the same mount-gated decision as PlatformChrome so the ChatSidebar is// hidden in lockstep with the layout swap — avoids a one-frame flash where@@ -58,7 +55,7 @@ export function CopilotPage() {if (isUserLoading || !isLoggedIn) {return (- <div className="fixed inset-0 z-50 flex items-center justify-center bg-[#f8f8f9]">+ <div className="fixed inset-0 z-50 flex items-center justify-center bg-[#f6f7fb]"><ScaleLoader className="text-neutral-400" /></div>);@@ -91,7 +88,6 @@ export function CopilotPage() {<MainAreaisMobile={isMobile}showNewLayout={showNewLayout}- isBrainDumpEnabled={Boolean(isBrainDumpEnabled)}sessionId={sessionId}droppedFiles={droppedFiles}setDroppedFiles={setDroppedFiles}@@ -108,7 +104,6 @@ export function CopilotPage() {interface MainAreaProps {isMobile: boolean;showNewLayout: boolean;- isBrainDumpEnabled: boolean;sessionId: string | null;droppedFiles: File[];setDroppedFiles: (files: File[]) => void;@@ -117,24 +112,13 @@ interface MainAreaProps {function MainArea({isMobile,showNewLayout,- isBrainDumpEnabled,sessionId,droppedFiles,setDroppedFiles,}: MainAreaProps) {- const hasSession = !!sessionId;return (<div className="flex h-full w-full flex-row overflow-hidden">- <div className="relative flex min-w-0 flex-1 overflow-hidden bg-white">- {!isBrainDumpEnabled && hasSession && (- <DotDistortionShader- dotGap={14}- dotSize={1}- opacity={0.2}- isStatic- className="pointer-events-none absolute inset-0 !bg-transparent [&_canvas]:opacity-70"- />- )}+ <div className="relative flex min-w-0 flex-1 overflow-hidden bg-[#f6f7fb]"><FileDropZoneclassName="relative flex min-w-0 flex-1 flex-col overflow-hidden px-0"onFilesDropped={setDroppedFiles}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/redirect.test.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/redirect.test.tsnew file mode 100644index 0000000000..3746cc365a--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/__tests__/redirect.test.ts@@ -0,0 +1,32 @@+import { describe, expect, it, vi } from "vitest";+import Page from "../page";++vi.mock("next/navigation", () => ({+ redirect: (url: string) => {+ throw new Error(`NEXT_REDIRECT:${url}`);+ },+}));++describe("copilot redirect", () => {+ it("redirects new tasks to home", async () => {+ await expect(Page({ searchParams: Promise.resolve({}) })).rejects.toThrow(+ "NEXT_REDIRECT:/home",+ );+ });++ it("preserves chat, expert, kickoff, and repeated query parameters", async () => {+ await expect(+ Page({+ searchParams: Promise.resolve({+ sessionId: "session/one",+ expertId: "expert-one",+ kickoff: "1",+ tag: ["a", "b"],+ absent: undefined,+ }),+ }),+ ).rejects.toThrow(+ "NEXT_REDIRECT:/home?sessionId=session%2Fone&expertId=expert-one&kickoff=1&tag=a&tag=b",+ );+ });+});diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotHome/CopilotHome.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotHome/CopilotHome.tsxdeleted file mode 100644index 410be72bec..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotHome/CopilotHome.tsx+++ /dev/null@@ -1,38 +0,0 @@-"use client";--import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";-import { BriefingCard } from "@/components/organisms/BriefingCard/BriefingCard";-import { hasRecapContent } from "@/components/organisms/BriefingCard/helpers";-import { useCopilotHome } from "./useCopilotHome";--// The short briefing recap under the composer. It is a recap only — the-// decisions inbox and team status live on /home — so the copilot's empty-// state keeps its onboarding surface (welcome dialog, greeting flow,-// suggestion themes) and the composer's recipient picker.-export function CopilotHome() {- const { briefing, isLoadingBriefing, isBriefingError, refetchBriefing } =- useCopilotHome();-- // Nothing renders until load settles so the fallback doesn't flash for- // users who do have a briefing. A failed fetch shows the error card so it- // can't masquerade as "no briefing".- if (isLoadingBriefing) return null;-- if (isBriefingError) {- return (- <ErrorCard- context="briefing"- httpError={{ message: "Failed to load your briefing" }}- onRetry={() => refetchBriefing()}- />- );- }-- // Not just "no briefing": a briefing of nothing but pending decisions has- // no runs to recap, and the card would render null. The inbox that used to- // carry that case lives on /home now, as does the workflow-runs strip that- // once stood in here, so the empty state simply stays quiet.- if (!hasRecapContent(briefing)) return null;-- return <BriefingCard briefing={briefing} />;-}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotHome/__tests__/flag-off.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotHome/__tests__/flag-off.test.tsxdeleted file mode 100644index 241e337b7a..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotHome/__tests__/flag-off.test.tsx+++ /dev/null@@ -1,86 +0,0 @@-import { expect, test, vi } from "vitest";-import { render, screen } from "@/tests/integrations/test-utils";-import { server } from "@/mocks/mock-server";-import { getGetBriefingsGetLatestBriefingMockHandler200 } from "@/app/api/__generated__/endpoints/briefings/briefings.msw";-import { EmptySession } from "../../EmptySession/EmptySession";--// The mirror of main.test.tsx: everything the briefing recap adds rides the-// experts flag, so with it off none of its surfaces may mount — the empty-// state is just the composer and its suggestions.-vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {- const actual =- await importActual<- typeof import("@/services/feature-flags/use-get-flag")- >();- return {- ...actual,- useGetFlag: () => false,- };-});--const baseProps = {- isCreatingSession: false,- onCreateSession: vi.fn(),- onSend: vi.fn(),-};--function mockHomeData() {- server.use(- // Would render something if the briefing recap mounted anyway.- getGetBriefingsGetLatestBriefingMockHandler200({- id: "briefing-1",- briefing_date: new Date(),- created_at: new Date(),- delivered_at: new Date(),- content: {- generated_at: new Date(),- timezone: "UTC",- zero_expert_fallback: false,- run_items: [- {- expert_id: "expert-1",- expert_name: "Sales Scout",- expert_avatar_url: null,- agent_name: "Lead Finder",- graph_id: "graph-1",- execution_id: "exec-1",- library_agent_id: "lib-1",- status: "COMPLETED",- summary: "Found 3 leads",- link: "/library/agents/lib-1?activeTab=runs&activeItem=exec-1",- },- ],- decision_items: [],- },- }),- );-}--test("mounts no briefing home when experts is off", async () => {- mockHomeData();-- // Absence of the rendered text alone could pass just because the briefing- // hadn't resolved yet. The briefing query only exists inside CopilotHome,- // so "never requested" is the durable proof the gate held — and it fails- // loudly if the gate is removed.- const requestedPaths: string[] = [];- function record({ request }: { request: Request }) {- requestedPaths.push(new URL(request.url).pathname);- }- server.events.on("request:start", record);-- try {- render(<EmptySession {...baseProps} />);-- // The composer mounts on the same render a CopilotHome would, so by the- // time it is on screen a mounted recap would have fired its query.- expect(await screen.findByPlaceholderText(/./)).toBeDefined();-- expect(requestedPaths.some((path) => path.includes("briefing"))).toBe(- false,- );- expect(screen.queryByText("Recap")).toBeNull();- } finally {- server.events.removeListener("request:start", record);- }-});diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotHome/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotHome/__tests__/main.test.tsxdeleted file mode 100644index 8e6c8a5a0b..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotHome/__tests__/main.test.tsx+++ /dev/null@@ -1,350 +0,0 @@-import { expect, test, vi } from "vitest";-import { http, HttpResponse } from "msw";-import userEvent from "@testing-library/user-event";-import { render, screen, waitFor } from "@/tests/integrations/test-utils";-import { server } from "@/mocks/mock-server";-import { getGetBriefingsGetLatestBriefingMockHandler200 } from "@/app/api/__generated__/endpoints/briefings/briefings.msw";-import { EmptySession } from "../../EmptySession/EmptySession";--// Rendered through EmptySession, not CopilotHome directly: the briefing recap-// mounts inside it, and the onboarding surface + composer recipient picker-// that live there must survive the experts flag being on.-vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {- const actual =- await importActual<- typeof import("@/services/feature-flags/use-get-flag")- >();- return {- ...actual,- useGetFlag: (flag: string) => flag === actual.Flag.HIRE_EXPERTS,- };-});--const baseProps = {- isCreatingSession: false,- onCreateSession: vi.fn(),- onSend: vi.fn(),-};--// The recap renders nothing until its briefing request settles, so tests-// that assert its absence wait for the mocked response rather than trusting-// a blank screen that may only mean "still loading".-function trackResponses() {- const paths: string[] = [];- function record({ request }: { request: Request }) {- paths.push(new URL(request.url).pathname);- }- server.events.on("response:mocked", record);- return {- paths,- briefingSettled: () =>- waitFor(() =>- expect(paths.some((path) => path.includes("briefings"))).toBe(true),- ),- stop: () => server.events.removeListener("response:mocked", record),- };-}--test("renders greeting and composer", async () => {- render(<EmptySession {...baseProps} />);- expect(await screen.findByPlaceholderText(/./)).toBeDefined();-});--test("shows a named kickoff status and withholds the empty composer", () => {- render(<EmptySession {...baseProps} isKickoffStarting expertName="Maria" />);-- expect(screen.getByRole("status").textContent).toContain(- "Opening Maria's workspace",- );- expect(screen.queryByPlaceholderText(/./)).toBeNull();-});--test("leaves the space under the composer empty when there is no briefing", async () => {- // The workflow-runs strip that used to fill this gap lives on /home now,- // under the briefing tile.- server.use(getGetBriefingsGetLatestBriefingMockHandler200(null));- const responses = trackResponses();-- try {- render(<EmptySession {...baseProps} />);- expect(await screen.findByPlaceholderText(/./)).toBeDefined();- await responses.briefingSettled();-- expect(screen.queryByText("Recap")).toBeNull();- expect(screen.queryByText("What's happening with your agents")).toBeNull();- } finally {- responses.stop();- }-});--test("renders briefing sections when a briefing is available", async () => {- server.use(- getGetBriefingsGetLatestBriefingMockHandler200({- id: "briefing-1",- briefing_date: new Date(),- created_at: new Date(),- delivered_at: new Date(),- content: {- generated_at: new Date(),- timezone: "UTC",- zero_expert_fallback: false,- run_items: [- {- expert_id: "expert-1",- expert_name: "Sales Scout",- expert_avatar_url: null,- agent_name: "Lead Finder",- graph_id: "graph-1",- execution_id: "exec-1",- library_agent_id: "lib-1",- status: "COMPLETED",- summary: "Found 3 leads",- link: "/library/agents/lib-1/runs/exec-1",- },- {- expert_id: "expert-2",- expert_name: "Support Bot",- expert_avatar_url: null,- agent_name: "Ticket Triager",- graph_id: "graph-2",- execution_id: "exec-2",- library_agent_id: "lib-2",- status: "FAILED",- summary: null,- link: "/library/agents/lib-2/runs/exec-2",- },- ],- decision_items: [- {- node_exec_id: "node-1",- graph_exec_id: "graph-exec-1",- title: "Approve outreach email",- expert_id: "expert-1",- expert_name: "Sales Scout",- expert_avatar_url: null,- link: "/library/agents/lib-1/runs/exec-1?node=node-1",- },- ],- },- }),- );- render(<EmptySession {...baseProps} />);-- expect(await screen.findByText("Recap")).toBeDefined();- expect(screen.getByText("Lead Finder")).toBeDefined();- expect(screen.getByText("Ticket Triager")).toBeDefined();- // A summary carries the expert it came from, matching the thread markdown.- const finding = screen.getByText(/Found 3 leads/);- expect(finding.textContent).toContain("Sales Scout");-- // The recap does not repeat the decisions: the needs-you list on /home- // shows the same pending reviews, and it can act on them.- expect(screen.queryByText(/Needs your decision/)).toBeNull();-});--test("shows three runs, then all of them behind the show-all toggle", async () => {- server.use(- getGetBriefingsGetLatestBriefingMockHandler200({- id: "briefing-1",- briefing_date: new Date(),- created_at: new Date(),- delivered_at: null,- content: {- generated_at: new Date(),- timezone: "UTC",- zero_expert_fallback: false,- run_items: Array.from({ length: 5 }, (_, i) => ({- expert_id: null,- expert_name: null,- expert_avatar_url: null,- agent_name: `Agent ${i}`,- graph_id: `graph-${i}`,- execution_id: `exec-${i}`,- library_agent_id: null,- status: "COMPLETED",- summary: null,- link: null,- })),- decision_items: [],- decision_total: 0,- },- }),- );- render(<EmptySession {...baseProps} />);-- // Every row stays mounted so the card can animate its height in both- // directions; the collapsed card clips to three rows visually, and only- // the expanded one scrolls.- expect(await screen.findByText("Agent 4")).toBeDefined();- expect(screen.getByRole("list").className).toContain("overflow-hidden");-- await userEvent.click(- screen.getByRole("button", { name: /Show all results \(5\)/ }),- );-- expect(screen.getByRole("list").className).toContain("overflow-y-auto");- expect(screen.getByRole("button", { name: /Show less/ })).toBeDefined();-});--test("links each row straight at its run", async () => {- server.use(- getGetBriefingsGetLatestBriefingMockHandler200({- id: "briefing-1",- briefing_date: new Date(),- created_at: new Date(),- delivered_at: null,- content: {- generated_at: new Date(),- timezone: "UTC",- zero_expert_fallback: false,- run_items: [- {- expert_id: "expert-1",- expert_name: "Sales Scout",- expert_avatar_url: null,- agent_name: "Lead Finder",- graph_id: "graph-1",- execution_id: "exec-1",- library_agent_id: "lib-1",- status: "COMPLETED",- summary: "Found 3 leads",- link: "/library/agents/lib-1/runs/exec-1",- },- ],- decision_items: [],- decision_total: 0,- },- }),- );- render(<EmptySession {...baseProps} />);-- const row = await screen.findByRole("link", { name: /Lead Finder/ });- expect(row.getAttribute("href")).toBe("/library/agents/lib-1/runs/exec-1");-});--test("keeps the decisions inbox and team status off the copilot recap", async () => {- // Both moved to /home. Proving the pending-reviews query never fires is- // what keeps the inbox from creeping back in: absent text alone would- // also pass while the request was still in flight. (The experts query has- // no such tell — the composer's recipient picker still needs it.)- server.use(getGetBriefingsGetLatestBriefingMockHandler200(null));- const responses = trackResponses();-- try {- render(<EmptySession {...baseProps} />);- await screen.findByPlaceholderText(/./);- await responses.briefingSettled();-- expect(responses.paths.some((path) => path.includes("review"))).toBe(false);- expect(screen.queryByText(/Needs your attention/)).toBeNull();- expect(screen.queryByRole("link", { name: /Chat with/ })).toBeNull();- } finally {- responses.stop();- }-});--test("shows an error card when the briefing fetch fails", async () => {- server.use(- http.get("/api/proxy/api/briefings/latest", () =>- HttpResponse.json({ detail: "boom" }, { status: 500 }),- ),- );- render(<EmptySession {...baseProps} />);-- expect(await screen.findByText("Failed to load your briefing")).toBeDefined();-});--test("keeps the onboarding surface and recipient picker with the experts flag on", async () => {- // hire-experts and onboarding-brain-dump are independent flags aimed at- // overlapping beta cohorts; the briefing recap must not cancel the other- // rollout out from under a brand-new user.- server.use(getGetBriefingsGetLatestBriefingMockHandler200(null));- render(<EmptySession {...baseProps} />);-- // The composer's expert picker is the only way to address an expert from- // the home, and it only renders behind the experts flag.- expect(await screen.findByText("Otto")).toBeDefined();- // Suggestion themes come from EmptySession, not the briefing block.- expect(screen.getByPlaceholderText(/./)).toBeDefined();-});--test("renders a run row without a link when the briefing has no deep link", async () => {- server.use(- getGetBriefingsGetLatestBriefingMockHandler200({- id: "briefing-1",- briefing_date: new Date(),- created_at: new Date(),- delivered_at: null,- content: {- generated_at: new Date(),- timezone: "UTC",- zero_expert_fallback: false,- run_items: [- {- expert_id: null,- expert_name: null,- expert_avatar_url: null,- agent_name: "Unlinked Agent",- graph_id: "graph-9",- execution_id: "exec-9",- library_agent_id: null,- status: "COMPLETED",- summary: null,- link: null,- },- ],- decision_items: [],- decision_total: 0,- },- }),- );- render(<EmptySession {...baseProps} />);-- const row = await screen.findByText("Unlinked Agent");- expect(row.closest("a")).toBeNull();-});--test("does not render a hollow briefing card when there are no runs", async () => {- // A run paused on an approval is not terminal, so it never lands in the- // run list — leaving a card that would show only a date.- const responses = trackResponses();- server.use(- getGetBriefingsGetLatestBriefingMockHandler200({- id: "briefing-1",- briefing_date: new Date(),- created_at: new Date(),- delivered_at: null,- content: {- generated_at: new Date(),- timezone: "UTC",- zero_expert_fallback: false,- run_items: [],- decision_items: [- {- node_exec_id: "node-1",- graph_exec_id: "graph-exec-1",- title: "Approve outreach email",- expert_id: null,- expert_name: null,- expert_avatar_url: null,- link: "/library",- },- ],- decision_total: 1,- },- }),- );-- try {- render(<EmptySession {...baseProps} />);- await screen.findByPlaceholderText(/./);- await responses.briefingSettled();-- // The decisions inbox that used to carry this case is on /home now, so- // the empty state stays blank rather than showing a dated, empty card.- expect(screen.queryByText("This morning")).toBeNull();- expect(screen.queryByText("Recap")).toBeNull();- } finally {- responses.stop();- }-});diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotHome/useCopilotHome.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotHome/useCopilotHome.tsdeleted file mode 100644index e0d596ea1e..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/CopilotHome/useCopilotHome.ts+++ /dev/null@@ -1,16 +0,0 @@-import { useGetBriefingsGetLatestBriefing } from "@/app/api/__generated__/endpoints/briefings/briefings";-import { okData } from "@/app/api/helpers";--export function useCopilotHome() {- const { data, isLoading, isError, refetch } =- useGetBriefingsGetLatestBriefing({- query: { select: (res) => okData(res) ?? null },- });-- return {- briefing: data ?? null,- isLoadingBriefing: isLoading,- isBriefingError: isError,- refetchBriefing: refetch,- };-}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsxindex 91c18d9cb3..ea4360372b 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx@@ -1,21 +1,15 @@"use client";import { ChatInput } from "@/app/(platform)/copilot/components/ChatInput/ChatInput";-import { useGetV2GetSuggestedPrompts } from "@/app/api/__generated__/endpoints/chat/chat";-import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";import { useAuth } from "@/lib/auth/hooks/useAuth";-import { DotDistortionShader } from "@/components/ui/dot-distortion-shader";import { cn } from "@/lib/utils";import { motion } from "framer-motion";-import { useLayoutEffect, useState, type ReactNode } from "react";+import type { ReactNode } from "react";import {getExpertInputPlaceholder,getGreetingName,- getInputPlaceholder,getIntroLine,- getSuggestionThemes,} from "./helpers";-import { SuggestionThemes } from "./components/SuggestionThemes/SuggestionThemes";import { OnboardingIntroCard } from "../OnboardingIntroCard/OnboardingIntroCard";import { OnboardingWelcomeDialog } from "../OnboardingWelcomeDialog/OnboardingWelcomeDialog";import { useOnboardingIntroCard } from "../OnboardingIntroCard/useOnboardingIntroCard";@@ -24,10 +18,11 @@ import type { WorkspaceAttachment } from "../../helpers/workspaceAttachments";import { EmptyHero } from "./components/EmptyHero";import { GreetingLoader } from "./components/GreetingLoader";import { ExpertKickoffLoader } from "./components/ExpertKickoffLoader/ExpertKickoffLoader";-import { CopilotHome } from "../CopilotHome/CopilotHome";+import { HomeRecap } from "@/app/(platform)/home/components/HomeRecap/HomeRecap";import { RecipientChip } from "../ChatInput/components/RecipientChip";import { ConnectionPicker } from "../ChatInput/components/ConnectionPicker/ConnectionPicker";import { useRecipientPicker } from "./useRecipientPicker";+import { useHomeComposer } from "./useHomeComposer";import { NewChatOnboarding } from "../ExpertOnboardingCard/NewChatOnboarding";interface Props {@@ -79,40 +74,22 @@ export function EmptySession({} = useRecipientPicker();const isComposerDisabled = isCreatingSession || !!isInteractionLocked;const introLine = isLoadingRecipient ? null : getIntroLine(selectedExpert);+ const recipientPicker = isExpertsEnabled ? (+ <RecipientChip+ recipient={recipient}+ options={options}+ isLoading={isLoadingRecipient}+ onSelect={selectRecipient}+ />+ ) : undefined;- const { data: suggestedPromptsResponse, isLoading: isLoadingPrompts } =- useGetV2GetSuggestedPrompts({- query: { staleTime: Infinity, gcTime: Infinity, refetchOnMount: false },- });- const themes = getSuggestionThemes(- suggestedPromptsResponse?.status === 200- ? suggestedPromptsResponse.data.themes- : undefined,- );-- const [inputPlaceholder, setInputPlaceholder] = useState(- getInputPlaceholder(),- );-- // Layout effect (not a regular effect) so the width-dependent placeholder- // is swapped in before the browser paints — otherwise the shorter default- // string flashes on screen first and visibly reflows into the longer one,- // which is what caused the placeholder to jump between wrapping above the- // icons and sitting next to them.- useLayoutEffect(() => {- function handleResize() {- setInputPlaceholder(getInputPlaceholder(window.innerWidth));- }- handleResize();- const mql = window.matchMedia("(max-width: 500px)");- mql.addEventListener("change", handleResize);- const mql2 = window.matchMedia("(max-width: 1080px)");- mql2.addEventListener("change", handleResize);- return () => {- mql.removeEventListener("change", handleResize);- mql2.removeEventListener("change", handleResize);- };- }, []);+ const { inputPlaceholder } = useHomeComposer({+ enabled:+ isExpertsEnabled &&+ !intro.isVisible &&+ !intro.isAwaitingGreeting &&+ !isKickoffStarting,+ });if (isKickoffStarting) {return <ExpertKickoffLoader expertName={expertName} />;@@ -120,16 +97,6 @@ export function EmptySession({return (<div className="relative flex h-full flex-1 items-start justify-center overflow-y-auto px-0 py-5 md:px-6 md:py-10">- {!isBrainDumpEnabled && (- <DotDistortionShader- dotGap={14}- dotSize={1}- opacity={0.2}- enableMouseInteraction={false}- breathingSpeed={0.4}- className="pointer-events-none absolute inset-0 !bg-transparent [&_canvas]:opacity-70"- />- )}<OnboardingWelcomeDialogisOpen={intro.isWelcomeOpen}onClose={intro.closeWelcome}@@ -141,20 +108,21 @@ export function EmptySession({</div><motion.divclassName={cn(- "relative z-10 w-full max-w-[52rem] text-center",+ "relative z-10 w-full text-center",+ isExpertsEnabled ? "max-w-[1120px]" : "max-w-[52rem]",// The whole greeting flow reads top-down like a letter, so it// anchors to the top from its first visible frame; the regular// hero centers itself. `my-auto` rather than the parent's// `items-center`: auto margins collapse to 0 once the content is// taller than the scroller, where centering would push the top of// the page above the scroll origin and make it unreachable.- !intro.anchorTop && "my-auto",+ !intro.anchorTop && !isExpertsEnabled && "my-auto",)}initial={{ opacity: 0 }}animate={{ opacity: 1 }}transition={{ duration: 0.3 }}>- <div className="mx-auto max-w-[52rem]">+ <div className="mx-auto max-w-[52rem] pt-6">{intro.isVisible ? (<OnboardingIntroCardname={greetingName}@@ -175,7 +143,13 @@ export function EmptySession({expertId={expertId}enabled={!isInteractionLocked}>- <EmptyHero name={greetingName} intro={introLine} />+ <EmptyHero+ name={greetingName}+ intro={introLine}+ recipientPicker={recipientPicker}+ isExpert={Boolean(selectedExpert)}+ expertRole={selectedExpert?.role}+ /></NewChatOnboarding>)}@@ -222,52 +196,17 @@ export function EmptySession({expertId={expertId}expertName={expertName}recipientPicker={- isExpertsEnabled ? (- <RecipientChip- recipient={recipient}- options={options}- isLoading={isLoadingRecipient}- onSelect={selectRecipient}- />- ) : undefined+ intro.isVisible ? recipientPicker : undefined}/></div></div>)}-- {/* The recap sits under the composer: the empty state's job is to- get a message typed, so the briefing reads as context below it- rather than as a wall above it. Workflow activity lives on- /home, under the briefing, so nothing stands in for a missing- recap here. */}- {!intro.isVisible &&- !intro.isAwaitingGreeting &&- isExpertsEnabled && (- <div className="mx-auto mb-6 w-full max-w-[42rem]">- <CopilotHome />- </div>- )}</div>- {/* The greeting page is deliberately quiet: its own prompts are- the suggestions, so the theme chips stay out of the way. Also- held while the greeting decision is pending. */}- {!intro.isVisible &&- !intro.isAwaitingGreeting &&- (isLoadingPrompts ? (- <div className="flex flex-wrap items-center justify-center gap-3">- {Array.from({ length: 4 }, (_, i) => (- <Skeleton key={i} className="h-10 w-28 shrink-0 rounded-full" />- ))}- </div>- ) : (- <SuggestionThemes- themes={themes}- onSend={onSend}- disabled={isComposerDisabled}- />- ))}+ {!intro.isVisible && !intro.isAwaitingGreeting && isExpertsEnabled && (+ <HomeRecap />+ )}</motion.div></div>);diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/__tests__/EmptySession.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/__tests__/EmptySession.test.tsxindex e37add058c..4dce86bcfb 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/__tests__/EmptySession.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/__tests__/EmptySession.test.tsx@@ -1,3 +1,7 @@+import userEvent from "@testing-library/user-event";+import { http, HttpResponse } from "msw";+import type { HomeDashboardResponse } from "@/app/api/__generated__/models/homeDashboardResponse";+import { makeDashboard } from "@/app/(platform)/home/__tests__/heldItems";import { getListExpertIdentitiesMockHandler } from "@/app/api/__generated__/endpoints/experts/experts.msw";import type { Expert } from "@/app/api/__generated__/models/expert";import { server } from "@/mocks/mock-server";@@ -8,10 +12,12 @@ import {waitFor,} from "@/tests/integrations/test-utils";import { withNuqsTestingAdapter } from "nuqs/adapters/testing";-import { describe, expect, it, vi } from "vitest";+import { beforeEach, describe, expect, it, vi } from "vitest";import { EmptySession } from "../EmptySession";+const flags = vi.hoisted(() => ({ experts: true }));+vi.mock("@/lib/auth/hooks/useAuth", () => ({useAuth: () => ({ user: null, isUserLoading: false, isLoggedIn: true }),}));@@ -23,8 +29,11 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {>();return {...actual,- useGetFlag: (flag: string) => flag === "hire-experts",- useFlagStatus: () => ({ enabled: false, ready: true }),+ useGetFlag: (flag: string) => flag === "hire-experts" && flags.experts,+ useFlagStatus: (flag: string) => ({+ enabled: flag === "hire-experts" && flags.experts,+ ready: true,+ }),};});@@ -54,24 +63,24 @@ const mariaExpert = makeExpert({const maxExpert = makeExpert({ id: "expert-max", name: "Max", role: "" });const samExpert = makeExpert({ id: "expert-sam", name: "Sam", role: "Sales" });-function renderEmptySession(searchParams: string) {+function renderEmptySession(searchParams: string, onSend = vi.fn()) {server.use(getListExpertIdentitiesMockHandler([mariaExpert, maxExpert, samExpert]),);- const Wrapper = withNuqsTestingAdapter({ searchParams });+ const Wrapper = withNuqsTestingAdapter({ searchParams, hasMemory: true });return render(<Wrapper><EmptySessionisCreatingSession={false}onCreateSession={() => {}}- onSend={() => {}}+ onSend={onSend}/></Wrapper>,);}describe("EmptySession — recipient-aware intro", () => {- it("introduces the selected expert by name and role", async () => {+ it("introduces the selected expert with an inline recipient chip", async () => {const { container } = renderEmptySession("?expertId=expert-maria");await waitFor(() =>@@ -84,7 +93,7 @@ describe("EmptySession — recipient-aware intro", () => {).toBeDefined();});- it("calls a bare-domain role an expert so the line still reads", async () => {+ it("supports an expert with a short role", async () => {const { container } = renderEmptySession("?expertId=expert-sam");await waitFor(() =>@@ -94,7 +103,7 @@ describe("EmptySession — recipient-aware intro", () => {);});- it("drops the role clause when the expert has none", async () => {+ it("supports an expert without a role", async () => {const { container } = renderEmptySession("?expertId=expert-max");await waitFor(() =>@@ -112,9 +121,232 @@ describe("EmptySession — recipient-aware intro", () => {await waitFor(() =>expect(normalizeWhitespace(container)).toContain(- "Tell me about your work — I'll find what to automate.",+ "Tell Otto about your work, and it will find what to automate.",),);expect(screen.getByPlaceholderText(/What's your role/)).toBeDefined();});});++beforeEach(() => {+ flags.experts = true;+ server.use(+ http.get(/\/api\/proxy\/api\/home(?:\?.*)?$/, () =>+ HttpResponse.json(makeDashboard([])),+ ),+ );+});++it("shows the task prompt above the home recap", async () => {+ renderEmptySession("");+ const prompt = screen.getByPlaceholderText(/What's your role/);+ const recap = await screen.findByRole("heading", { name: "Your recap" });+ expect(+ prompt.compareDocumentPosition(recap) & Node.DOCUMENT_POSITION_FOLLOWING,+ ).toBeTruthy();+ expect(screen.getByRole("heading", { name: "Recent work" })).toBeDefined();+ expect(screen.getByRole("heading", { name: "Your team" })).toBeDefined();+ expect(screen.getByRole("heading", { name: "Now & next" })).toBeDefined();+});++it("keeps the prompt usable when the recap fails to load", async () => {+ server.use(+ http.get(/\/api\/proxy\/api\/home(?:\?.*)?$/, () =>+ HttpResponse.json({ detail: "failed" }, { status: 500 }),+ ),+ );+ const onSend = vi.fn();+ const user = userEvent.setup();+ renderEmptySession("", onSend);+ await screen.findByText("Your Home briefing could not be loaded");+ await user.type(+ screen.getByPlaceholderText(/What's your role/),+ "Plan my day{Enter}",+ );+ await waitFor(() => expect(onSend).toHaveBeenCalled());+ expect(onSend.mock.calls[0][0]).toBe("Plan my day");+});++it("keeps new tasks available without requesting the recap when experts is off", async () => {+ flags.experts = false;+ const requestedPaths: string[] = [];+ function record({ request }: { request: Request }) {+ requestedPaths.push(new URL(request.url).pathname);+ }+ server.events.on("request:start", record);+ try {+ renderEmptySession("");+ expect(+ await screen.findByPlaceholderText(/What's your role/),+ ).toBeDefined();+ expect(screen.queryByRole("heading", { name: "Your recap" })).toBeNull();+ expect(requestedPaths).not.toContain("/api/proxy/api/home");+ } finally {+ server.events.removeListener("request:start", record);+ }+});++it("shows a named kickoff status and withholds the empty composer", () => {+ const Wrapper = withNuqsTestingAdapter({ searchParams: "" });+ render(+ <Wrapper>+ <EmptySession+ isCreatingSession={false}+ onCreateSession={() => {}}+ onSend={() => {}}+ isKickoffStarting+ expertName="Maria"+ />+ </Wrapper>,+ );+ expect(screen.getByRole("status").textContent).toContain(+ "Opening Maria's workspace",+ );+ expect(screen.queryByPlaceholderText(/What's your role/)).toBeNull();+});++it("switches recipients from the intro with no duplicate picker in the composer", async () => {+ const user = userEvent.setup();+ renderEmptySession("");+ const picker = await screen.findByRole("button", {+ name: "Sending to Otto — change recipient",+ });+ const prompt = screen.getByPlaceholderText(/What's your role/);+ expect(+ picker.compareDocumentPosition(prompt) & Node.DOCUMENT_POSITION_FOLLOWING,+ ).toBeTruthy();+ expect(+ screen.getAllByRole("button", { name: /change recipient/, hidden: true }),+ ).toHaveLength(1);+ await user.click(picker);+ await user.click(await screen.findByRole("menuitem", { name: /Maria/ }));+ expect(+ await screen.findByPlaceholderText("What should Maria work on?"),+ ).toBeDefined();+ expect(+ screen.getByRole("button", { name: "Sending to Maria — change recipient" }),+ ).toBeDefined();+});++const teamPlaceholder =+ "What should the team work on? e.g. 'Follow up with yesterday's leads'";++function mockDashboard(dashboard: HomeDashboardResponse) {+ server.use(+ http.get(/\/api\/proxy\/api\/home(?:\?.*)?$/, () =>+ HttpResponse.json(dashboard),+ ),+ );+}++it("keeps the discovery prompt without starter pills or suggestion requests for an empty account", async () => {+ const fetchSuggestions = vi.fn(() => HttpResponse.json({ themes: [] }));+ server.use(http.get("*/api/chat/suggested-prompts", fetchSuggestions));+ renderEmptySession("");+ await screen.findByRole("heading", { name: "Your recap" });+ expect(screen.getByPlaceholderText(/What's your role/)).toBeDefined();+ for (const name of ["Learn", "Create", "Automate", "Organize"]) {+ expect(screen.queryByRole("button", { name })).toBeNull();+ }+ expect(fetchSuggestions).not.toHaveBeenCalled();+});++it.each([+ [+ "an expert hired during onboarding",+ { team: { total: 1, ready: 1, working: 0, needs_attention: 0 } },+ ],+ [+ "running work",+ {+ active_tasks: [+ { id: "run-1", title: "Weekly report", status: "running" },+ ],+ },+ ],+ [+ "scheduled work",+ {+ upcoming_tasks: [+ {+ id: "schedule-1",+ title: "Weekly report",+ kind: "agent",+ next_run_time: new Date(),+ },+ ],+ },+ ],+ [+ "work awaiting attention",+ {+ attention: [+ {+ id: "attention-1",+ kind: "setup",+ priority: "normal",+ title: "Finish setup",+ description: "Connect an account",+ why_it_matters: "Setup is incomplete",+ primary_action: { label: "Open", href: "/team" },+ },+ ],+ },+ ],+ [+ "completed work",+ { week: { ...makeDashboard([]).week, run_count: 1, completed_count: 1 } },+ ],+ ["recent chat output", { recent_work: { total_count: 1, groups: [] } }],+] satisfies [string, Partial<HomeDashboardResponse>][])(+ "uses the team prompt without starter pills for users with %s",+ async (_label, activity) => {+ mockDashboard({ ...makeDashboard([]), ...activity });+ renderEmptySession("");+ expect(await screen.findByPlaceholderText(teamPlaceholder)).toBeDefined();+ for (const name of ["Learn", "Create", "Automate", "Organize"]) {+ expect(screen.queryByRole("button", { name })).toBeNull();+ }+ expect(+ screen.getByRole("button", {+ name: "Sending to Otto — change recipient",+ }),+ ).toBeDefined();+ },+);++it("keeps the chosen expert's prompt for an existing account", async () => {+ mockDashboard({+ ...makeDashboard([]),+ team: { total: 1, ready: 1, working: 0, needs_attention: 0 },+ });+ renderEmptySession("?expertId=expert-maria");+ await screen.findByRole("heading", { name: "Your recap" });+ expect(+ await screen.findByPlaceholderText("What should Maria work on?"),+ ).toBeDefined();+ expect(screen.queryByRole("button", { name: "Learn" })).toBeNull();+});++it("opens a fresh Home visit on Otto after choosing another recipient", async () => {+ const user = userEvent.setup();+ const firstVisit = renderEmptySession("");+ await user.click(+ await screen.findByRole("button", {+ name: "Sending to Otto — change recipient",+ }),+ );+ await user.click(await screen.findByRole("menuitem", { name: /Maria/ }));+ await screen.findByPlaceholderText("What should Maria work on?");+ firstVisit.unmount();++ renderEmptySession("");+ expect(+ await screen.findByRole("button", {+ name: "Sending to Otto — change recipient",+ }),+ ).toBeDefined();+ expect(+ screen.queryByPlaceholderText("What should Maria work on?"),+ ).toBeNull();+});diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/components/EmptyHero.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/components/EmptyHero.tsxindex 21f532b151..7be3b97beb 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/components/EmptyHero.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/components/EmptyHero.tsx@@ -1,7 +1,9 @@"use client";+import type { ReactNode } from "react";import { Text } from "@/components/atoms/Text/Text";import { TextGenerateEffect } from "@/components/ui/text-generate-effect";+import { getExpertIntroSuffix } from "../helpers";import { EditNameDialog } from "./EditNameDialog/EditNameDialog";interface Props {@@ -9,12 +11,21 @@ interface Props {/** Null holds the line back (recipient still resolving) without moving* the composer below it. */intro: string | null;+ recipientPicker?: ReactNode;+ isExpert?: boolean;+ expertRole?: string | null;}// The regular empty-session hero. While a greeting is being written// GreetingLoader renders in its place instead, and its orb travels into// the intro card's heading under a shared layout id.-export function EmptyHero({ name, intro }: Props) {+export function EmptyHero({+ name,+ intro,+ recipientPicker,+ isExpert,+ expertRole,+}: Props) {return (<><div className="mb-1 flex items-center justify-center gap-3">@@ -27,6 +38,16 @@ export function EmptyHero({ name, intro }: Props) {<div aria-hidden className="mb-8 text-[1.375rem] leading-normal"> </div>+ ) : recipientPicker ? (+ <div className="mb-8 text-[1.375rem] leading-relaxed tracking-normal text-zinc-900">+ {isExpert ? "I'm" : "Tell"}{" "}+ <span className="mr-1 inline-block align-middle [&_button]:ml-0 [&_button]:text-lg">+ {recipientPicker}+ </span>+ {isExpert+ ? getExpertIntroSuffix(expertRole ?? null)+ : " about your work, and it will find what to automate."}+ </div>) : (// Keyed on the text so switching recipient re-types the line.<TextGenerateEffectdiff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/components/SuggestionThemes/SuggestionThemes.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/components/SuggestionThemes/SuggestionThemes.tsxdeleted file mode 100644index 064f272950..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/components/SuggestionThemes/SuggestionThemes.tsx+++ /dev/null@@ -1,102 +0,0 @@-"use client";--import {- Popover,- PopoverContent,- PopoverTrigger,-} from "@/components/molecules/Popover/Popover";-import { Button } from "@/components/atoms/Button/Button";-import { useState } from "react";-import type { SuggestionTheme } from "../../helpers";-import {- BookOpen01Icon,- CheckListIcon,- FlashIcon,- Loading03Icon,- PaintBrush01Icon,-} from "@hugeicons/core-free-icons";-import type { IconSvgElement } from "@hugeicons/react";-import { Icon } from "@/components/atoms/Icon/Icon";--const THEME_ICONS: Record<string, IconSvgElement> = {- Learn: BookOpen01Icon,- Create: PaintBrush01Icon,- Automate: FlashIcon,- Organize: CheckListIcon,-};--interface Props {- themes: SuggestionTheme[];- onSend: (prompt: string) => void | Promise<void>;- disabled?: boolean;-}--export function SuggestionThemes({ themes, onSend, disabled }: Props) {- const [openTheme, setOpenTheme] = useState<string | null>(null);- const [loadingPrompt, setLoadingPrompt] = useState<string | null>(null);-- async function handlePromptClick(theme: string, prompt: string) {- if (disabled || loadingPrompt) return;- setLoadingPrompt(`${theme}:${prompt}`);- try {- await onSend(prompt);- } finally {- setLoadingPrompt(null);- setOpenTheme(null);- }- }-- return (- <div className="flex flex-wrap items-center justify-center gap-3">- {themes.map((theme) => {- const themeIcon = THEME_ICONS[theme.name];- return (- <Popover- key={theme.name}- open={openTheme === theme.name}- onOpenChange={(open) => setOpenTheme(open ? theme.name : null)}- >- <PopoverTrigger asChild>- <Button- type="button"- variant="secondary"- size="small"- disabled={disabled || loadingPrompt !== null}- className="shrink-0 gap-2 !border-neutral-200 !bg-white px-3 py-2 text-[.9rem]"- >- {themeIcon && <Icon icon={themeIcon} size={16} />}- {theme.name}- </Button>- </PopoverTrigger>- <PopoverContent align="center" className="w-80 p-2">- <ul className="grid gap-0.5">- {theme.prompts.map((prompt) => (- <li key={prompt}>- <button- type="button"- disabled={disabled || loadingPrompt !== null}- onClick={() => void handlePromptClick(theme.name, prompt)}- className="w-full rounded-md px-3 py-2 text-left text-sm text-zinc-700 transition-colors hover:bg-zinc-100 disabled:opacity-50"- >- {loadingPrompt === `${theme.name}:${prompt}` ? (- <span className="flex items-center gap-2">- <Icon- icon={Loading03Icon}- className="h-4 w-4 animate-spin"- />- {prompt}- </span>- ) : (- prompt- )}- </button>- </li>- ))}- </ul>- </PopoverContent>- </Popover>- );- })}- </div>- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/helpers.tsindex 0e643a482c..2158cc5ff7 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/helpers.ts+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/helpers.ts@@ -41,10 +41,14 @@ export function getIntroLine(expert: { name: string; role: string | null } | null,) {if (!expert) return AUTOPILOT_INTRO;- const role = expert.role?.trim();- return role- ? `I'm ${expert.name}, your ${getExpertRoleLabel(role)}. What should I take on?`- : `I'm ${expert.name}. What should I take on?`;+ return `I'm ${expert.name}${getExpertIntroSuffix(expert.role)}`;+}++export function getExpertIntroSuffix(role: string | null) {+ const trimmedRole = role?.trim();+ return trimmedRole+ ? `, your ${getExpertRoleLabel(trimmedRole)}. What should I take on?`+ : ". What should I take on?";}export function getExpertInputPlaceholder(expertName: string) {@@ -63,89 +67,6 @@ export function getInputPlaceholder(width?: number) {return "What's your role and what eats up most of your day? e.g. 'I'm a recruiter and I hate...'";}-export interface SuggestionTheme {- name: string;- prompts: string[];-}--export const DEFAULT_THEMES: SuggestionTheme[] = [- {- name: "Learn",- prompts: [- "What can AutoGPT do for me?",- "Show me how agents work",- "What integrations are available?",- "How do I schedule an agent?",- "What are the most popular agents?",- ],- },- {- name: "Create",- prompts: [- "Draft a weekly status report",- "Generate social media posts for my business",- "Create a competitive analysis summary",- "Write onboarding emails for new hires",- "Build a content calendar for next month",- ],- },- {- name: "Automate",- prompts: [- "Monitor relevant websites for changes",- "Send me a daily news digest on my industry",- "Auto-reply to common customer questions",- "Track price changes on products I sell",- "Summarize my emails every morning",- ],- },- {- name: "Organize",- prompts: [- "Summarize my unread emails",- "Create a project timeline from my notes",- "Prioritize my task list by urgency",- "Build a decision matrix for vendor selection",- "Organize my meeting notes into action items",- ],- },-];--export function getSuggestionThemes(- apiThemes?: SuggestionTheme[],-): SuggestionTheme[] {- if (!apiThemes?.length) {- return DEFAULT_THEMES;- }-- const promptsByTheme = new Map(- apiThemes.map((theme) => [theme.name, theme.prompts] as const),- );-- // Legacy users have prompts under "General" — distribute them across themes- const generalPrompts = (promptsByTheme.get("General") ?? []).filter(- (p) => p.trim().length > 0,- );-- return DEFAULT_THEMES.map((theme, idx) => {- const personalized = (promptsByTheme.get(theme.name) ?? []).filter(- (p) => p.trim().length > 0,- );-- // Spread legacy "General" prompts round-robin across themes- const legacySlice = generalPrompts.filter(- (_, i) => i % DEFAULT_THEMES.length === idx,- );-- return {- name: theme.name,- prompts: Array.from(- new Set([...personalized, ...legacySlice, ...theme.prompts]),- ).slice(0, theme.prompts.length),- };- });-}-export function getGreetingName(user?: User | null) {if (!user) return "there";const metadata = user.user_metadata as Record<string, unknown> | undefined;diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/useHomeComposer.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/useHomeComposer.tsnew file mode 100644index 0000000000..79c8461764--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/useHomeComposer.ts@@ -0,0 +1,49 @@+import { useLayoutEffect, useState } from "react";+import { useHomePage } from "@/app/(platform)/home/useHomePage";+import { getInputPlaceholder } from "./helpers";++interface Args {+ enabled: boolean;+}++const TEAM_PLACEHOLDER =+ "What should the team work on? e.g. 'Follow up with yesterday's leads'";++export function useHomeComposer({ enabled }: Args) {+ const { dashboard } = useHomePage({ enabled });+ const hasExistingWork = Boolean(+ enabled &&+ dashboard &&+ (dashboard.team.total > 0 ||+ dashboard.attention.length > 0 ||+ dashboard.active_tasks.length > 0 ||+ dashboard.upcoming_tasks.length > 0 ||+ dashboard.week.run_count > 0 ||+ (dashboard.recent_work?.total_count ?? 0) > 0 ||+ (dashboard.recent_work?.groups?.length ?? 0) > 0),+ );+ const [discoveryPlaceholder, setDiscoveryPlaceholder] = useState(+ getInputPlaceholder(),+ );++ useLayoutEffect(() => {+ function handleResize() {+ setDiscoveryPlaceholder(getInputPlaceholder(window.innerWidth));+ }+ handleResize();+ const queries = [+ window.matchMedia("(max-width: 500px)"),+ window.matchMedia("(max-width: 1080px)"),+ ];+ queries.forEach((query) => query.addEventListener("change", handleResize));+ return () => {+ queries.forEach((query) =>+ query.removeEventListener("change", handleResize),+ );+ };+ }, []);++ return {+ inputPlaceholder: hasExistingWork ? TEAM_PLACEHOLDER : discoveryPlaceholder,+ };+}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/useOnboardingIntroCard.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/useOnboardingIntroCard.test.tsxindex 883b16bf5d..b7ba5beca9 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/useOnboardingIntroCard.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/OnboardingIntroCard/__tests__/useOnboardingIntroCard.test.tsx@@ -113,7 +113,7 @@ describe("useOnboardingIntroCard — flag gating", () => {// The regression: with the flag off the intro query is disabled, so it// never answers — and "no answer yet" was read as "still generating".// isAwaitingGreeting stayed true forever and EmptySession hides the- // composer and SuggestionThemes behind it, so the default+ // composer behind it, so the default// flag-off copilot rendered a hero with no way to type.flags.current = {};diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/page.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/page.tsxindex e741e18f9e..fb059b85c2 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/page.tsx@@ -1,7 +1,16 @@-"use client";+import { redirect } from "next/navigation";-import { CopilotPage } from "./CopilotPage";+interface Props {+ searchParams: Promise<Record<string, string | string[] | undefined>>;+}-export default function Page() {- return <CopilotPage />;+export default async function Page({ searchParams }: Props) {+ const params = new URLSearchParams();+ for (const [key, value] of Object.entries(await searchParams)) {+ for (const entry of Array.isArray(value) ? value : [value]) {+ if (entry !== undefined) params.append(key, entry);+ }+ }+ const query = params.toString();+ redirect(query ? `/home?${query}` : "/home");}diff --git a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsxindex a0f0ebfe41..9de81443c1 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx@@ -13,7 +13,7 @@ import {waitFor,within,} from "@/tests/integrations/test-utils";-import HomePage from "../page";+import { HomeRecap } from "../components/HomeRecap/HomeRecap";const { capture } = vi.hoisted(() => ({ capture: vi.fn() }));vi.mock("posthog-js", () => ({ default: { capture } }));@@ -234,9 +234,9 @@ function mockDashboard(response: HomeDashboardResponse) {test("renders every Home tile from the aggregate API", async () => {mockDashboard(dashboard);- render(<HomePage />);+ render(<HomeRecap />);- expect(await screen.findByText(/Abhi/)).toBeDefined();+ expect(await screen.findByText("Your recap")).toBeDefined();expect(screen.getByRole("heading", { name: "Needs you" })).toBeDefined();expect(screen.getByLabelText("1 item needs your attention")).toBeDefined();expect(screen.getByText("Connect your calendar for Maria")).toBeDefined();@@ -270,7 +270,7 @@ test("says which workflow is running now and shows its picture", async () => {upcoming_tasks: [],});- render(<HomePage />);+ render(<HomeRecap />);const tile = await screen.findByRole("region", { name: "Now & next" });expect(within(tile).getByText("Tell me a fact!")).toBeDefined();@@ -298,7 +298,7 @@ test("shows weekly spend per agent and on the team line", async () => {],});- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByText(/\$9\.00 this week/)).toBeDefined();expect(@@ -327,7 +327,7 @@ test("falls back to an Unknown badge for an unrecognised agent status", async ()],});- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByText("Unknown")).toBeDefined();});@@ -343,7 +343,7 @@ test("approving an item one-tap sends the review decision", async () => {}),);- render(<HomePage />);+ render(<HomeRecap />);await user.click(await screen.findByRole("button", {@@ -380,7 +380,7 @@ test("declining an item records the confirmed decline", async () => {}),);- render(<HomePage />);+ render(<HomeRecap />);await user.click(await screen.findByRole("button", {@@ -426,7 +426,7 @@ test("does not count a failed attention decision as actioned", async () => {}),);- render(<HomePage />);+ render(<HomeRecap />);const approveButton = await screen.findByRole("button", {name: "Approve: Approve the camera shortlist",});@@ -442,7 +442,7 @@ test("does not count a failed attention decision as actioned", async () => {test("keeps a Review deep link alongside the approval shortcuts", async () => {mockDashboard({ ...dashboard, attention: [approvalItem] });- render(<HomePage />);+ render(<HomeRecap />);const reviewLink = await screen.findByRole("link", { name: "Review" });expect(reviewLink.getAttribute("href")).toBe("/library/runs/run-1");@@ -467,7 +467,7 @@ test("shows calm, useful empty states and drops the empty inbox", async () => {});server.use();- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByText("Nothing to show yet")).toBeDefined();// The header already says nothing needs you, so an empty "Needs you"@@ -485,7 +485,7 @@ test("tracks briefing outcomes and team members with useful dimensions", async (mockDashboard(dashboard);server.use();- render(<HomePage />);+ render(<HomeRecap />);await user.click(await screen.findByRole("link", { name: /Your camera research is ready/ }),@@ -516,7 +516,7 @@ test("shows a retryable page error when the aggregate cannot load", async () =>);const user = userEvent.setup();- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByText("Your Home briefing could not be loaded"),@@ -535,22 +535,17 @@ test("does not track home_viewed while feature state is loading", async () => {setFlagStatusMock.mockReturnValueOnce({ enabled: true, ready: false });server.use();- render(<HomePage />);+ render(<HomeRecap />);expect(screen.getByLabelText("Loading Home…")).toBeDefined();await new Promise((resolve) => setTimeout(resolve, 0));expect(funnelEventNames()).not.toContain("home_viewed");});-test("calls notFound when the experts feature is disabled", () => {- mockDashboard(dashboard);+test("hides the recap when the experts feature is disabled", () => {setFlagStatusMock.mockReturnValueOnce({ enabled: false, ready: true });- notFoundMock.mockClear();-- try {- render(<HomePage />);- } catch {}- expect(notFoundMock).toHaveBeenCalled();+ const { container } = render(<HomeRecap />);+ expect(container.textContent).toBe("");});test("opens the briefing with the AI-written narrative when there is one", async () => {@@ -563,7 +558,7 @@ test("opens the briefing with the AI-written narrative when there is one", async},});- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByText(@@ -582,7 +577,7 @@ test("bylines the briefing to Otto, not to the expert it reports on", async () =},});- render(<HomePage />);+ render(<HomeRecap />);const byline = within(await screen.findByTestId("briefing-byline"));expect(byline.getByText("Otto")).toBeDefined();@@ -595,7 +590,7 @@ test("bylines the briefing to Otto, not to the expert it reports on", async () =test("renders the briefing unchanged when no narrative was generated", async () => {mockDashboard({ ...dashboard, briefing: { ...dashboard.briefing } });- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByRole("heading", { name: "Recent work" }),@@ -607,7 +602,7 @@ test("emits the home_viewed funnel event once the dashboard mounts", async () =>server.use();mockDashboard(dashboard);- render(<HomePage />);+ render(<HomeRecap />);await screen.findByRole("heading", { name: "Needs you" });await waitFor(() => expect(funnelEventNames()).toContain("home_viewed"));@@ -626,7 +621,7 @@ test("view events fire exactly once under StrictMode effect replay", async () =>render(<StrictMode>- <HomePage />+ <HomeRecap /></StrictMode>,);diff --git a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/needs-you.test.tsx b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/needs-you.test.tsxindex dcc773b44f..0f4aa17a09 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/needs-you.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/needs-you.test.tsx@@ -9,7 +9,7 @@ import {heldRead,heldReview,} from "../../copilot/components/ApprovalQueue/__tests__/fixtures";-import HomePage from "../page";+import { HomeRecap } from "../components/HomeRecap/HomeRecap";vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {const actual =@@ -138,7 +138,7 @@ function mockDashboard(attention: HomeAttentionItem[]) {test("lists every attention item without collapsing", async () => {mockDashboard([1, 2, 3, 4].map(makeApproval));- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByText("Approve item 1")).toBeDefined();expect(screen.getByText("Approve item 4")).toBeDefined();@@ -148,7 +148,7 @@ test("filters the attention list by kind", async () => {const user = userEvent.setup();mockDashboard([makeApproval(1), setupItem]);- render(<HomePage />);+ render(<HomeRecap />);await user.click(await screen.findByRole("button", { name: "Filter interventions: All" }),@@ -170,7 +170,7 @@ test("requires a second press to confirm a decline", async () => {}),);- render(<HomePage />);+ render(<HomeRecap />);await user.click(await screen.findByRole("button", { name: "Decline: Approve item 1" }),@@ -206,7 +206,7 @@ test("keeps a rejected review actionable instead of dropping the row", async ()),);- render(<HomePage />);+ render(<HomeRecap />);const approve = await screen.findByRole("button", {name: "Approve: Approve item 1",@@ -220,7 +220,7 @@ test("keeps a rejected review actionable instead of dropping the row", async ()test("shows an unanswered copilot question and links back to the chat", async () => {mockDashboard([questionItem]);- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByText("Maria has a question")).toBeDefined();expect(screen.getByText("Monday morning or Friday evening?")).toBeDefined();@@ -232,7 +232,7 @@ test("shows an unanswered copilot question and links back to the chat", async ()test("offers no approve or decline on a question", async () => {mockDashboard([questionItem]);- render(<HomePage />);+ render(<HomeRecap />);await screen.findByText("Maria has a question");expect(@@ -253,7 +253,7 @@ test("a held call's row sets its object in semibold, as its card does", async ()makeApproval(10),]);- render(<HomePage />);+ render(<HomeRecap />);const object = await screen.findByText("Q3 reports");expect(object.tagName).toBe("B");@@ -293,7 +293,7 @@ test("a held read's row gives its reason in plain words and quotes the passage",heldReadItem("unjudged", false),]);- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByText(@@ -331,7 +331,7 @@ test.each([{ ...makeApproval(0), id: `approval-${kind}`, description, review },]);- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByText(description)).toBeDefined();},diff --git a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsxindex 1e8819fff4..19a116dd29 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx@@ -4,7 +4,7 @@ import type { HomeDashboardResponse } from "@/app/api/__generated__/models/homeDimport type { HomeRecentWork } from "@/app/api/__generated__/models/homeRecentWork";import { server } from "@/mocks/mock-server";import { render, screen, within } from "@/tests/integrations/test-utils";-import HomePage from "../page";+import { HomeRecap } from "../components/HomeRecap/HomeRecap";vi.mock("@/services/feature-flags/use-get-flag", async (importActual) => {const actual =@@ -206,7 +206,7 @@ function mockDashboard(response: HomeDashboardResponse) {test("groups the week's runs and deliverables by who did them", async () => {mockDashboard(dashboard);- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByRole("heading", { name: "Recent work" }),@@ -263,7 +263,7 @@ test("groups the week's runs and deliverables by who did them", async () => {test("puts the team first and the workflows that ran on their own after them", async () => {mockDashboard(dashboard);- render(<HomePage />);+ render(<HomeRecap />);const heading = await screen.findByRole("heading", { name: "Recent work" });const tile = heading.closest("section");@@ -281,7 +281,7 @@ test("puts the team first and the workflows that ran on their own after them", atest("marks a workflow group with its own picture and kind", async () => {mockDashboard(dashboard);- render(<HomePage />);+ render(<HomeRecap />);await screen.findByRole("heading", { name: "Recent work" });const workflowGroup = screen.getByRole("article", {@@ -299,7 +299,7 @@ test("marks a workflow group with its own picture and kind", async () => {test("links each actor to its home and thread work to its session", async () => {mockDashboard(dashboard);- render(<HomePage />);+ render(<HomeRecap />);await screen.findByRole("heading", { name: "Recent work" });const links = screen@@ -323,7 +323,7 @@ test("shows a calm empty state when agents produced nothing yet", async () => {recent_work: { groups: [], total_count: 0 },});- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByText("Nothing to show yet")).toBeDefined();expect(screen.getByText("0 completed")).toBeDefined();@@ -334,7 +334,7 @@ test("renders the rest of the page when recent_work is absent", async () => {void recent_work;mockDashboard(withoutRecentWork as HomeDashboardResponse);- render(<HomePage />);+ render(<HomeRecap />);expect(await screen.findByText("Nothing to show yet")).toBeDefined();expect(screen.getByRole("heading", { name: "Now & next" })).toBeDefined();diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/HomeHeader/HomeHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/HomeHeader/HomeHeader.tsxindex 21bae53884..8755e89a96 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/components/HomeHeader/HomeHeader.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/HomeHeader/HomeHeader.tsx@@ -3,12 +3,10 @@ import { Text } from "@/components/atoms/Text/Text";import { formatHeaderDate, getHomeStatusLine } from "../../helpers";interface Props {- greeting: string;- name: string;dashboard: HomeDashboardResponse;}-export function HomeHeader({ greeting, name, dashboard }: Props) {+export function HomeHeader({ dashboard }: Props) {const date = formatHeaderDate(dashboard.generated_at, dashboard.timezone);const status = getHomeStatusLine(dashboard);@@ -17,11 +15,11 @@ export function HomeHeader({ greeting, name, dashboard }: Props) {<div className="min-w-0"><Textvariant="lead-semibold"- as="h1"+ as="h2"tone="primary"className="text-pretty tracking-[-0.01em]">- {greeting}, {name}+ Your recap</Text><Text variant="body" tone="primary" className="mt-0.5 text-pretty">{status.split(/(\d+)/).map((part, index) =>diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/HomeRecap/HomeRecap.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/HomeRecap/HomeRecap.tsxnew file mode 100644index 0000000000..aa5f9f62f9--- /dev/null+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/HomeRecap/HomeRecap.tsx@@ -0,0 +1,112 @@+"use client";++import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";+import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";+import { useTrackFunnelViewOnce } from "@/services/experts/use-track-funnel-view-once";+import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";+import { AgentTeam } from "../AgentTeam/AgentTeam";+import { HomeHeader } from "../HomeHeader/HomeHeader";+import { NeedsYou } from "../NeedsYou/NeedsYou";+import { NowNext } from "../NowNext/NowNext";+import { RecentWork } from "../RecentWork/RecentWork";+import { useHomePage } from "../../useHomePage";++const SHELL_CLASS = "relative mt-10 px-4 pb-8 pt-6 text-left sm:px-6";+const CONTENT_CLASS = "relative mx-auto w-full max-w-[1120px]";+const GRID_CLASS = "grid grid-cols-1 items-start gap-4 xl:grid-cols-12";++export function HomeRecap() {+ const { enabled, ready } = useFlagStatus(Flag.HIRE_EXPERTS);+ const { dashboard, isLoading, isError, refetch } = useHomePage({+ enabled: Boolean(enabled) && ready,+ });++ useTrackFunnelViewOnce(+ "home_viewed",+ ready && !isLoading && !isError && Boolean(dashboard) && Boolean(enabled),+ );++ if (!ready || isLoading) {+ return <HomeSkeleton />;+ }+ if (!enabled) {+ return null;+ }+ if (isError || !dashboard) {+ return (+ <section className={SHELL_CLASS}>+ <div className={CONTENT_CLASS}>+ <ErrorCard+ context="home"+ httpError={{ message: "Your Home briefing could not be loaded" }}+ onRetry={() => refetch()}+ />+ </div>+ </section>+ );+ }++ return (+ <section className={SHELL_CLASS}>+ <div className={CONTENT_CLASS}>+ <HomeHeader dashboard={dashboard} />+ <div className={GRID_CLASS}>+ <div className="flex min-w-0 flex-col gap-4 xl:col-span-8">+ {dashboard.attention.length > 0 && (+ <NeedsYou dashboard={dashboard} />+ )}+ <RecentWork dashboard={dashboard} />+ </div>+ <div className="flex min-w-0 flex-col gap-4 xl:col-span-4">+ <AgentTeam dashboard={dashboard} />+ <NowNext dashboard={dashboard} />+ </div>+ </div>+ </div>+ </section>+ );+}++function HomeSkeleton() {+ return (+ <section className={SHELL_CLASS} aria-label="Loading Home…">+ <div className={CONTENT_CLASS}>+ <div className="flex items-end justify-between gap-6 px-1 pb-5 pt-1">+ <div className="space-y-2">+ <Skeleton className="h-7 w-64" />+ <Skeleton className="h-4 w-80 max-w-full" />+ </div>+ <div className="flex shrink-0 flex-col items-end gap-1.5">+ <Skeleton className="h-4 w-16" />+ <Skeleton className="h-3 w-24" />+ </div>+ </div>+ <div className={GRID_CLASS}>+ <div className="flex flex-col gap-4 xl:col-span-8">+ <HomeTileSkeleton cardClassName="h-64" />+ <HomeTileSkeleton cardClassName="h-56" />+ </div>+ <div className="flex flex-col gap-4 xl:col-span-4">+ <HomeTileSkeleton cardClassName="h-44" />+ <HomeTileSkeleton cardClassName="h-56" />+ </div>+ </div>+ </div>+ </section>+ );+}++interface Props {+ cardClassName: string;+}++function HomeTileSkeleton({ cardClassName }: Props) {+ return (+ <div className="overflow-hidden rounded-2xl bg-white smooth-shadow-ring-sm">+ <div className="flex h-10 items-center border-b border-zinc-100 px-4">+ <Skeleton className="h-3.5 w-28" />+ </div>+ <Skeleton className={`${cardClassName} rounded-none`} />+ </div>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/home/page.tsx b/autogpt_platform/frontend/src/app/(platform)/home/page.tsxindex d50ad8cba8..0f3b131063 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/page.tsx@@ -1,125 +1,7 @@"use client";-import { notFound } from "next/navigation";-import { getGreetingName } from "@/app/(platform)/copilot/components/EmptySession/helpers";-import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";-import { ErrorCard } from "@/components/molecules/ErrorCard/ErrorCard";-import { useAuth } from "@/lib/auth/hooks/useAuth";-import { useTrackFunnelViewOnce } from "@/services/experts/use-track-funnel-view-once";-import { Flag, useFlagStatus } from "@/services/feature-flags/use-get-flag";-import { AgentTeam } from "./components/AgentTeam/AgentTeam";-import { HomeHeader } from "./components/HomeHeader/HomeHeader";-import { NeedsYou } from "./components/NeedsYou/NeedsYou";-import { NowNext } from "./components/NowNext/NowNext";-import { RecentWork } from "./components/RecentWork/RecentWork";-import { getTimeOfDayGreeting } from "./helpers";-import { useHomePage } from "./useHomePage";--const SHELL_CLASS =- "relative min-h-screen bg-zinc-50 px-4 pb-16 pt-6 sm:px-6 lg:px-8";-const CONTENT_CLASS = "relative mx-auto w-full max-w-[1120px]";-const GRID_CLASS = "grid grid-cols-1 items-start gap-4 xl:grid-cols-12";+import { CopilotPage } from "../copilot/CopilotPage";export default function HomePage() {- const { enabled, ready } = useFlagStatus(Flag.HIRE_EXPERTS);- const { user } = useAuth();- const { dashboard, isLoading, isError, refetch } = useHomePage({- enabled: Boolean(enabled) && ready,- });-- useTrackFunnelViewOnce(- "home_viewed",- ready && !isLoading && !isError && Boolean(dashboard) && Boolean(enabled),- );-- if (!ready || isLoading) {- return <HomeSkeleton />;- }- if (!enabled) {- notFound();- }- if (isError || !dashboard) {- return (- <main className={SHELL_CLASS}>- <div className={CONTENT_CLASS}>- <ErrorCard- context="home"- httpError={{ message: "Your Home briefing could not be loaded" }}- onRetry={() => refetch()}- />- </div>- </main>- );- }-- return (- <main className={SHELL_CLASS}>- <div className={CONTENT_CLASS}>- <HomeHeader- greeting={getTimeOfDayGreeting()}- name={getGreetingName(user)}- dashboard={dashboard}- />- <div className={GRID_CLASS}>- <div className="flex min-w-0 flex-col gap-4 xl:col-span-8">- {/* An empty inbox is not news: the header already says nothing- needs you, so the tile only appears once there is something- to decide. */}- {dashboard.attention.length > 0 && (- <NeedsYou dashboard={dashboard} />- )}- <RecentWork dashboard={dashboard} />- </div>- <div className="flex min-w-0 flex-col gap-4 xl:col-span-4">- <AgentTeam dashboard={dashboard} />- <NowNext dashboard={dashboard} />- </div>- </div>- </div>- </main>- );-}--function HomeSkeleton() {- return (- <main className={SHELL_CLASS} aria-label="Loading Home…">- <div className={CONTENT_CLASS}>- <div className="flex items-end justify-between gap-6 px-1 pb-5 pt-1">- <div className="space-y-2">- <Skeleton className="h-7 w-64" />- <Skeleton className="h-4 w-80 max-w-full" />- </div>- <div className="flex shrink-0 flex-col items-end gap-1.5">- <Skeleton className="h-4 w-16" />- <Skeleton className="h-3 w-24" />- </div>- </div>- <div className={GRID_CLASS}>- <div className="flex flex-col gap-4 xl:col-span-8">- <HomeTileSkeleton cardClassName="h-64" />- <HomeTileSkeleton cardClassName="h-56" />- </div>- <div className="flex flex-col gap-4 xl:col-span-4">- <HomeTileSkeleton cardClassName="h-44" />- <HomeTileSkeleton cardClassName="h-56" />- </div>- </div>- </div>- </main>- );-}--interface Props {- cardClassName: string;-}--function HomeTileSkeleton({ cardClassName }: Props) {- return (- <div className="overflow-hidden rounded-2xl bg-white smooth-shadow-ring-sm">- <div className="flex h-10 items-center border-b border-zinc-100 px-4">- <Skeleton className="h-3.5 w-28" />- </div>- <Skeleton className={`${cardClassName} rounded-none`} />- </div>- );+ return <CopilotPage />;}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx b/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsxindex f3d502c723..7fd74c74f6 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryAgentCard/LibraryAgentCard.tsx@@ -152,7 +152,7 @@ export function LibraryAgentCard({const prompt = encodeURIComponent(`Tell me about my agent "${name}" (library agent ID: ${id}). Use find_library_agent with this exact agent_id to look it up, then summarize its current status, recent runs, and how I can get the most out of it.`,);- router.push(`/copilot?autosubmit=true#prompt=${prompt}`);+ router.push(`/home?autosubmit=true#prompt=${prompt}`);}}className="inline-flex items-center gap-1 whitespace-nowrap rounded-md px-2 py-1.5 text-[13px] font-medium text-zinc-600 transition-colors hover:bg-zinc-50 hover:text-zinc-800">diff --git a/autogpt_platform/frontend/src/app/(platform)/library/components/SitrepItem/SitrepItem.tsx b/autogpt_platform/frontend/src/app/(platform)/library/components/SitrepItem/SitrepItem.tsxindex 3c20a19c40..a0d7bff4ea 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/components/SitrepItem/SitrepItem.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/components/SitrepItem/SitrepItem.tsx@@ -81,7 +81,7 @@ export function SitrepItem({ item }: Props) {function handleAskAutoPilot() {const prompt = buildAutoPilotPrompt(item);const encoded = encodeURIComponent(prompt);- router.push(`/copilot?autosubmit=true#prompt=${encoded}`);+ router.push(`/home?autosubmit=true#prompt=${encoded}`);}return (diff --git a/autogpt_platform/frontend/src/app/(platform)/library/followups/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/library/followups/__tests__/main.test.tsxindex 8455cb910c..b21fe5beea 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/followups/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/followups/__tests__/main.test.tsx@@ -395,7 +395,7 @@ describe("FollowupsPage", () => {await vi.waitFor(() => {expect(pushMock).toHaveBeenCalledWith(- expect.stringContaining("/copilot#prompt="),+ expect.stringContaining("/home#prompt="),);});const url = pushMock.mock.calls[0][0] as string;diff --git a/autogpt_platform/frontend/src/app/(platform)/library/followups/page.tsx b/autogpt_platform/frontend/src/app/(platform)/library/followups/page.tsxindex 4a4cd7717e..d620241541 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/followups/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/followups/page.tsx@@ -15,7 +15,7 @@ export default function FollowupsPage() {}, []);function handleGuidedPrompt(prompt: string) {- router.push(`/copilot#prompt=${encodeURIComponent(prompt)}`);+ router.push(`/home#prompt=${encodeURIComponent(prompt)}`);}return (diff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/library/skills/__tests__/main.test.tsxindex 436b137546..56a9caeac9 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/skills/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/skills/__tests__/main.test.tsx@@ -484,7 +484,7 @@ describe("SkillsPage", () => {await vi.waitFor(() => {expect(pushMock).toHaveBeenCalledWith(- expect.stringContaining("/copilot#prompt="),+ expect.stringContaining("/home#prompt="),);});const url = pushMock.mock.calls[0][0] as string;diff --git a/autogpt_platform/frontend/src/app/(platform)/library/skills/page.tsx b/autogpt_platform/frontend/src/app/(platform)/library/skills/page.tsxindex c8458e4741..405bdc280b 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/skills/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/skills/page.tsx@@ -15,7 +15,7 @@ export default function SkillsPage() {}, []);function handleGuidedPrompt(prompt: string) {- router.push(`/copilot#prompt=${encodeURIComponent(prompt)}`);+ router.push(`/home#prompt=${encodeURIComponent(prompt)}`);}return (diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPageHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPageHeader.tsxindex 227a4e820d..02b925dfd0 100644--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPageHeader.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/marketplace/experts/[expertId]/components/ExpertPageHeader.tsx@@ -16,7 +16,7 @@ export function ExpertPageHeader({ expert, actions }: Props) {return (<header>- <div className="flex flex-wrap items-center gap-4 sm:gap-5">+ <div className="grid grid-cols-[96px_minmax(0,1fr)] items-center gap-4 sm:gap-x-5"><ExpertAvatarname={expert.name}avatarUrl={expert.avatar_url}@@ -27,10 +27,9 @@ export function ExpertPageHeader({ expert, actions }: Props) {role: expert.role,})}size={96}+ className="border border-black/5"/><div className="min-w-0 flex-1">- {/* The job title trails the name, as it does on the shelf's cards;- the chip below belongs to the area the expert works in. */}<ExpertIdentityDetailsname={expert.name}role={expert.role}@@ -42,7 +41,9 @@ export function ExpertPageHeader({ expert, actions }: Props) {<CategoryTag category={area} size="default" className="mt-2" />) : null}</div>- <div className="w-full sm:w-auto">{actions}</div>+ <div className="col-span-2 min-w-0 sm:col-span-1 sm:col-start-2">+ {actions}+ </div></div><ExpertTagline tagline={expert.tagline} /></header>diff --git a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/useExpertWorkflowCard.ts b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/useExpertWorkflowCard.tsindex 7d08b1b82a..330544ca89 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/useExpertWorkflowCard.ts+++ b/autogpt_platform/frontend/src/app/(platform)/team/[expertId]/components/useExpertWorkflowCard.ts@@ -97,7 +97,7 @@ export function useExpertWorkflowCard({ workflow, expertId }: Args) {? `/build?flowID=${workflow.graph_id}`: null,chatPrompt,- chatHref: `/copilot?${expertId ? `expertId=${expertId}&` : ""}autosubmit=true#prompt=${encodeURIComponent(chatPrompt)}`,+ chatHref: `/home?${expertId ? `expertId=${expertId}&` : ""}autosubmit=true#prompt=${encodeURIComponent(chatPrompt)}`,openRun,openTriggers,};diff --git a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/main.test.tsxindex b75b00e935..ae73c54bf8 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/autopilot/__tests__/main.test.tsx@@ -264,7 +264,7 @@ describe("AutopilotPage", () => {within(rows[0]).getByRole("link", { name: "Ask about this workflow" }).getAttribute("href"),- ).toContain("/copilot?autosubmit=true");+ ).toContain("/home?autosubmit=true");});test("keeps loading library pages so a second-page workflow still counts as Otto's", async () => {diff --git a/autogpt_platform/frontend/src/app/page.tsx b/autogpt_platform/frontend/src/app/page.tsxindex ce67760eda..2c8e0967ac 100644--- a/autogpt_platform/frontend/src/app/page.tsx+++ b/autogpt_platform/frontend/src/app/page.tsx@@ -8,7 +8,7 @@ export default function Page() {const router = useRouter();useEffect(() => {- router.replace("/copilot");+ router.replace("/home");}, [router]);return <LoadingSpinner size="large" cover />;diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsxindex 5a2fbddeb5..bcc1c115cd 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/AppSidebar.tsx@@ -35,7 +35,6 @@ import {Folder01Icon,GridViewIcon,Home10Icon,- NoteEditIcon,Store01Icon,AddTeamIcon,} from "@hugeicons/core-free-icons";@@ -54,10 +53,6 @@ const MAIN_LINKS: NavLink[] = [{ name: "Build", href: "/build", icon: FlowIcon },];-// /home 404s without the experts flag, so the entry only exists for the-// cohort that has a home to go to.-const HOME_LINK: NavLink = { name: "Home", href: "/home", icon: Home10Icon };-const WORKSPACE_LINKS: NavLink[] = [{ name: "Files", href: "/artifacts", icon: Folder01Icon },];@@ -82,9 +77,7 @@ function NavLinkLoader() {);}-// Rendered inside the New Task <Link> — swap the sparkle for a spinner while-// navigation to /copilot is pending, then back to the sparkle once it lands.-function NewTaskIcon() {+function HomeIcon() {const { pending } = useLinkStatus();if (pending) {@@ -98,7 +91,7 @@ function NewTaskIcon() {return (<Icon- icon={NoteEditIcon}+ icon={Home10Icon}className="size-4 text-sidebar-foreground/90 group-data-[collapsible=icon]:size-4.5"/>);@@ -115,9 +108,7 @@ function useNavItemClassName() {);}-// New Task shares the nav-item styling with the main links so it sits in the-// same section with a uniform gap, instead of being a standalone CTA button.-function NewTaskItem() {+function HomeItem() {const pathname = usePathname();const navItemClassName = useNavItemClassName();@@ -125,13 +116,13 @@ function NewTaskItem() {<SidebarMenuItem><SidebarMenuButtonasChild- tooltip="New Task"- isActive={isLinkActive(pathname, "/copilot")}+ tooltip="Home"+ isActive={isLinkActive(pathname, "/home")}className={navItemClassName}>- <Link href="/copilot">- <NewTaskIcon />- <span className="truncate">New Task</span>+ <Link href="/home">+ <HomeIcon />+ <span className="truncate">Home</span><ShortcutHint letter="O" /></Link></SidebarMenuButton>@@ -255,7 +246,6 @@ export function AppSidebar(props: Props) {: WORKSPACE_LINKS).filter((link) => link.href !== "/artifacts" || filesEnabled);- // New Task shortcut: Cmd/Ctrl+Shift+O opens a fresh chat on /copilot.useEffect(() => {function handleNewTaskShortcut(event: KeyboardEvent) {if (event.repeat) return;@@ -264,7 +254,7 @@ export function AppSidebar(props: Props) {if (!event.shiftKey) return;if (isEditableElement(document.activeElement)) return;event.preventDefault();- router.push("/copilot");+ router.push("/home");}document.addEventListener("keydown", handleNewTaskShortcut);@@ -289,15 +279,7 @@ export function AppSidebar(props: Props) {<motion.div variants={itemVariants}><SidebarGroup className="mt-0 py-1"><SidebarGroupContent>- <NavMenu- links={mainLinks}- leading={- <>- {isHireExpertsEnabled && <NavItem link={HOME_LINK} />}- <NewTaskItem />- </>- }- />+ <NavMenu links={mainLinks} leading={<HomeItem />} /></SidebarGroupContent></SidebarGroup></motion.div>diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/__tests__/AppSidebar.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/__tests__/AppSidebar.test.tsxindex 1ef311e4e9..33f6e72d8a 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/__tests__/AppSidebar.test.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/__tests__/AppSidebar.test.tsx@@ -107,7 +107,7 @@ describe("AppSidebar", () => {expect(event.defaultPrevented).toBe(false);fireEvent.keyDown(document, { key: "O", ctrlKey: true, shiftKey: true });- expect(routerPush).toHaveBeenCalledWith("/copilot");+ expect(routerPush).toHaveBeenCalledWith("/home");});it("renders the primary navigation links", () => {@@ -116,8 +116,7 @@ describe("AppSidebar", () => {expect(screen.getByText("Marketplace")).toBeDefined();expect(screen.getByText("Build")).toBeDefined();expect(screen.queryByText("Files")).toBeNull();- // /home 404s without the experts flag, so it must not be offered here.- expect(screen.queryByText("Home")).toBeNull();+ expect(screen.getByText("Home")).toBeDefined();});it("shows Team instead of Agents when the hire-experts flag is on", () => {@@ -128,17 +127,18 @@ describe("AppSidebar", () => {expect(screen.queryByText("Agents")).toBeNull();});- it("adds a Home link when the hire-experts flag is on", () => {+ it("keeps a Home link when the hire-experts flag is on", () => {useGetFlagMock.mockReturnValue(true);renderSidebar();const homeLink = screen.getByRole("link", { name: /home/i });expect(homeLink.getAttribute("href")).toBe("/home");});- it("renders the New Task call-to-action pointing at /copilot", () => {+ it("combines Home and New Task into one navigation entry", () => {renderSidebar();- const newTask = screen.getByRole("link", { name: /new task/i });- expect(newTask.getAttribute("href")).toBe("/copilot");+ expect(screen.queryByRole("link", { name: /new task/i })).toBeNull();+ const home = screen.getByRole("link", { name: /^home/i });+ expect(home.getAttribute("href")).toBe("/home");});it("renders the workspace and recent chats group headers", () => {diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/AppSidebarHeader/AppSidebarHeader.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/AppSidebarHeader/AppSidebarHeader.tsxindex 687d61c78f..d3e0236da2 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/AppSidebarHeader/AppSidebarHeader.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/AppSidebarHeader/AppSidebarHeader.tsx@@ -52,7 +52,7 @@ export function AppSidebarHeader() {)}><Link- href="/copilot"+ href="/home"aria-label="AutoGPT"className={cn("flex items-center",diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/AppSidebarHeader/__tests__/AppSidebarHeader.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/AppSidebarHeader/__tests__/AppSidebarHeader.test.tsxindex 1028684c07..0db939433a 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/AppSidebarHeader/__tests__/AppSidebarHeader.test.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/AppSidebarHeader/__tests__/AppSidebarHeader.test.tsx@@ -14,10 +14,10 @@ function renderHeader() {}describe("AppSidebarHeader", () => {- it("renders the AutoGPT home link pointing at /copilot", () => {+ it("renders the AutoGPT home link pointing at /home", () => {renderHeader();const homeLink = screen.getByRole("link", { name: "AutoGPT" });- expect(homeLink.getAttribute("href")).toBe("/copilot");+ expect(homeLink.getAttribute("href")).toBe("/home");});it("shows the 'Collapse sidebar' control while expanded", () => {diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/expert-groups.test.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/expert-groups.test.tsxindex 667ee01722..59359b0e6d 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/expert-groups.test.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/__tests__/expert-groups.test.tsx@@ -292,14 +292,12 @@ describe("RecentChats — expert groups", () => {const mariaLink = await screen.findByRole("link", {name: "New chat with Maria",});- expect(mariaLink.getAttribute("href")).toBe(- "/copilot?expertId=expert-maria",- );+ expect(mariaLink.getAttribute("href")).toBe("/home?expertId=expert-maria");expect(screen.getByRole("link", { name: "New chat with Otto" }).getAttribute("href"),- ).toBe("/copilot");+ ).toBe("/home");expect(groupHeader("Max")).toBeDefined();expect(screen.queryByRole("link", { name: "New chat with Max" }),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 e8002f267b..de3c992045 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@@ -138,7 +138,7 @@ export function RecentChatItem({tooltip={title}className="font-normal data-[active=true]:!bg-zinc-100 data-[active=true]:font-normal hover:!bg-zinc-100">- <Link href={`/copilot?sessionId=${session.id}`}>+ <Link href={`/home?sessionId=${session.id}`}>{session.is_processing ? (<LoadingSpinnersize="small"diff --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 fdcebf58c2..39a9024a99 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@@ -60,7 +60,7 @@ describe("RecentChatItem — display", () => {it("links to the session and shows its title", () => {renderItem(makeProps());const link = screen.getByRole("link", { name: /my chat/i });- expect(link.getAttribute("href")).toBe("/copilot?sessionId=s1");+ expect(link.getAttribute("href")).toBe("/home?sessionId=s1");});it("falls back to 'Untitled chat' when the title is empty", () => {diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/helpers.ts b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/helpers.tsindex 2210829bd8..2fbcb85f1e 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/helpers.ts+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/RecentChats/helpers.ts@@ -64,7 +64,7 @@ export function getNewChatHref(expertId: string | null,activeExpertIds: ReadonlySet<string>,) {- if (!expertId) return "/copilot";+ if (!expertId) return "/home";if (!activeExpertIds.has(expertId)) return null;- return `/copilot?expertId=${encodeURIComponent(expertId)}`;+ return `/home?expertId=${encodeURIComponent(expertId)}`;}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 bc2afacc09..f365cc4ac1 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@@ -22,7 +22,7 @@ export function useRecentChats() {const pathname = usePathname();const searchParams = useSearchParams();const activeSessionId =- pathname === "/copilot" ? searchParams.get("sessionId") : null;+ pathname === "/home" ? searchParams.get("sessionId") : null;const [editingSessionId, setEditingSessionId] = useState<string | null>(null);const [editingTitle, setEditingTitle] = useState("");diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/Navbar.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/Navbar.tsxindex fc1e8bd22f..7dc583a707 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/Navbar.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/Navbar.tsx@@ -24,7 +24,7 @@ import { getAccountMenuItems, loggedInLinks, loggedOutLinks } from "./helpers";const MOBILE_NAV_ICONS: Readonly<Record<string, IconType>> = {"/marketplace": IconType.Marketplace,"/build": IconType.Builder,- "/copilot": IconType.Chat,+ "/home": IconType.Chat,"/library": IconType.Library,"/monitor": IconType.Library,};@@ -59,7 +59,7 @@ export function Navbar() {// Files is reached via the icon in the CoPilot sidebar (gated by// ARTIFACTS_PAGE), not the top nav — it's an entry point, not a product.const actualLoggedInLinks = [- { name: "Home", href: "/copilot" },+ { name: "Home", href: "/home" },{ name: "Agents", href: "/library" },...loggedInLinks,];diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/NavbarLink.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/NavbarLink.tsxindex c1ff494507..7a8c6e354e 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/NavbarLink.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/NavbarLink.tsx@@ -24,8 +24,8 @@ export function NavbarLink({ name, href }: Props) {const pathname = usePathname();const isActive =- href === "/copilot"- ? pathname === "/" || pathname.startsWith("/copilot")+ href === "/home"+ ? pathname === "/" || pathname.startsWith("/home"): pathname.includes(href);return (@@ -66,7 +66,7 @@ export function NavbarLink({ name, href }: Props) {)}/>)}- {href === "/copilot" && (+ {href === "/home" && (<divclassName={cn(iconNudgedClass,diff --git a/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/ExpertIdentityDetails.tsx b/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/ExpertIdentityDetails.tsxindex 6c179abe4d..da2e7d24f6 100644--- a/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/ExpertIdentityDetails.tsx+++ b/autogpt_platform/frontend/src/components/molecules/ExpertIdentityDetails/ExpertIdentityDetails.tsx@@ -45,6 +45,7 @@ export function ExpertIdentityDetails({<ContainerclassName={cn("flex min-w-0 gap-2",+ size === "page" && "flex-wrap gap-y-0",nameAlign === "baseline" ? "items-baseline" : "items-center",)}>@@ -54,7 +55,8 @@ export function ExpertIdentityDetails({tone="primary"unmask={false}className={cn(- "min-w-0 truncate",+ "min-w-0",+ size === "page" ? "max-w-full break-words" : "truncate",compact && "leading-[1.125rem]",size === "page" && "text-2xl leading-8",)}@@ -68,7 +70,8 @@ export function ExpertIdentityDetails({tone="secondary"unmask={false}className={cn(- "min-w-0 truncate",+ "min-w-0",+ size === "page" ? "max-w-full break-words" : "truncate",size === "card" && "text-[13px]",areaClassName,)}diff --git a/autogpt_platform/frontend/src/playwright/auth-happy-path.spec.ts b/autogpt_platform/frontend/src/playwright/auth-happy-path.spec.tsindex 3677ee006e..749a30330a 100644--- a/autogpt_platform/frontend/src/playwright/auth-happy-path.spec.ts+++ b/autogpt_platform/frontend/src/playwright/auth-happy-path.spec.ts@@ -90,7 +90,7 @@ test("auth happy path: user can complete onboarding and land in the app", asyncpainPoints: ["Research", "Reports & data"],});- await expect(page).toHaveURL(/\/copilot/);+ await expect(page).toHaveURL(/\/home/);await expect(page.getByTestId("profile-popout-menu-trigger")).toBeVisible();});diff --git a/autogpt_platform/frontend/src/playwright/pages/copilot.page.ts b/autogpt_platform/frontend/src/playwright/pages/copilot.page.tsindex b22a25cffe..72d3f2f04a 100644--- a/autogpt_platform/frontend/src/playwright/pages/copilot.page.ts+++ b/autogpt_platform/frontend/src/playwright/pages/copilot.page.ts@@ -7,9 +7,9 @@ export class CopilotPage extends BasePage {}async open(sessionId?: string): Promise<void> {- const url = sessionId ? `/copilot?sessionId=${sessionId}` : "/copilot";+ const url = sessionId ? `/home?sessionId=${sessionId}` : "/home";await this.page.goto(url);- await expect(this.page).toHaveURL(/\/copilot/);+ await expect(this.page).toHaveURL(/\/home/);await this.dismissNotificationPrompt();}diff --git a/autogpt_platform/frontend/src/playwright/pages/login.page.ts b/autogpt_platform/frontend/src/playwright/pages/login.page.tsindex 8149c6b75e..21d556233b 100644--- a/autogpt_platform/frontend/src/playwright/pages/login.page.ts+++ b/autogpt_platform/frontend/src/playwright/pages/login.page.ts@@ -53,7 +53,7 @@ export class LoginPage {this.page.waitForFunction(() => {const pathname = window.location.pathname;- return /^\/(marketplace|onboarding(\/.*)?|library|copilot)$/.test(+ return /^\/(marketplace|onboarding(\/.*)?|library|copilot|home)$/.test(pathname,);},diff --git a/autogpt_platform/frontend/src/playwright/utils/auth.ts b/autogpt_platform/frontend/src/playwright/utils/auth.tsindex e59070daef..873c2cbebd 100644--- a/autogpt_platform/frontend/src/playwright/utils/auth.ts+++ b/autogpt_platform/frontend/src/playwright/utils/auth.ts@@ -269,7 +269,7 @@ async function attemptCreateAuthState(await loginPage.login(email, password);await page.waitForURL((url: URL) =>- /\/(onboarding|marketplace|copilot|library)/.test(url.pathname),+ /\/(onboarding|marketplace|copilot|home|library)/.test(url.pathname),{ timeout: 20000 },);await skipOnboardingIfPresent(page, "/marketplace");diff --git a/autogpt_platform/frontend/src/playwright/utils/onboarding.ts b/autogpt_platform/frontend/src/playwright/utils/onboarding.tsindex 0b7a6625e6..9444bfc589 100644--- a/autogpt_platform/frontend/src/playwright/utils/onboarding.ts+++ b/autogpt_platform/frontend/src/playwright/utils/onboarding.ts@@ -113,7 +113,7 @@ export async function completeOnboardingWizard(}await expect(preparing).toBeVisible({ timeout: 10000 });- await page.waitForURL(/\/copilot/, { timeout: 30000 });+ await page.waitForURL(/\/home/, { timeout: 30000 });await expect(page.getByTestId("profile-popout-menu-trigger")).toBeVisible({timeout: 15000,});diff --git a/autogpt_platform/frontend/src/playwright/utils/signin.ts b/autogpt_platform/frontend/src/playwright/utils/signin.tsindex b8bce93e02..8a14711a4e 100644--- a/autogpt_platform/frontend/src/playwright/utils/signin.ts+++ b/autogpt_platform/frontend/src/playwright/utils/signin.ts@@ -29,7 +29,7 @@ export class SigninUtils {// Wait for redirect — could land on /onboarding, /marketplace, or /copilotawait this.page.waitForURL((url: URL) =>- /\/(onboarding|marketplace|copilot|library)/.test(url.pathname),+ /\/(onboarding|marketplace|copilot|home|library)/.test(url.pathname),{ timeout: 15000 },);diff --git a/autogpt_platform/frontend/src/playwright/utils/signup.test.ts b/autogpt_platform/frontend/src/playwright/utils/signup.test.tsnew file mode 100644index 0000000000..db8d8967de--- /dev/null+++ b/autogpt_platform/frontend/src/playwright/utils/signup.test.ts@@ -0,0 +1,24 @@+import { describe, expect, it } from "vitest";++import { isAuthenticatedAppURL } from "./signup";++describe("isAuthenticatedAppURL", () => {+ it.each(["/home", "/copilot", "/library"])(+ "accepts %s as an authenticated app route",+ (path) => {+ expect(isAuthenticatedAppURL(`http://localhost${path}`)).toBe(true);+ },+ );++ it("leaves marketplace verification on its own path", () => {+ expect(isAuthenticatedAppURL("http://localhost/marketplace")).toBe(false);+ });++ it("accepts nested authenticated app routes", () => {+ expect(isAuthenticatedAppURL("/home/session/123")).toBe(true);+ });++ it("does not match authenticated routes in query parameters", () => {+ expect(isAuthenticatedAppURL("/marketplace?returnTo=/home")).toBe(false);+ });+});diff --git a/autogpt_platform/frontend/src/playwright/utils/signup.ts b/autogpt_platform/frontend/src/playwright/utils/signup.tsindex 0b6ddf8df4..c316c05c49 100644--- a/autogpt_platform/frontend/src/playwright/utils/signup.ts+++ b/autogpt_platform/frontend/src/playwright/utils/signup.ts@@ -5,6 +5,13 @@ import { BuildPage } from "../pages/build.page";import { skipOnboardingIfPresent } from "./onboarding";import { expect } from "@playwright/test";+export function isAuthenticatedAppURL(currentURL: string) {+ const { pathname } = new URL(currentURL, "http://localhost");+ return ["/home", "/copilot", "/library"].some(+ (path) => pathname === path || pathname.startsWith(`${path}/`),+ );+}+export async function signupTestUser(page: any,email?: string,@@ -48,7 +55,7 @@ export async function signupTestUser(// Use a single waitForURL with a callback to avoid Promise.race race conditionsawait page.waitForURL((url: URL) =>- /\/(onboarding|marketplace|copilot|library)/.test(url.pathname),+ /\/(onboarding|marketplace|copilot|home|library)/.test(url.pathname),{ timeout: 15000 },);} catch (error) {@@ -67,7 +74,7 @@ export async function signupTestUser(}// Verify we're on an expected final page and user is authenticated- if (currentUrl.includes("/copilot") || currentUrl.includes("/library")) {+ if (isAuthenticatedAppURL(currentUrl)) {await page.getByTestId("profile-popout-menu-trigger").waitFor({ state: "visible", timeout: 10000 });