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.
fix(frontend): keep the expert setup card off the Home hero (#15063)
Ubbe0c64dc11de1b
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatContainer/__tests__/new-chat-onboarding.test.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatContainer/__tests__/new-chat-onboarding.test.tsxindex a22bd74ee0..73c26fe6e1 100644--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatContainer/__tests__/new-chat-onboarding.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatContainer/__tests__/new-chat-onboarding.test.tsx@@ -23,7 +23,7 @@ const props: ChatContainerProps = {messages: [],status: "ready",error: undefined,- sessionId: null,+ sessionId: "empty-session",isLoadingSession: false,isCreatingSession: false,onCreateSession: vi.fn(),@@ -83,23 +83,26 @@ describe("new full-page expert chats", () => {).toBe("true");});- test.each([null, "empty-session"])(- "shows pending onboarding in chat %s",- async (sessionId) => {- mockOnboarding();- const onSend = vi.fn();- render(- <ChatContainer {...props} sessionId={sessionId} onSend={onSend} />,- );- expect(await screen.findByText("What topic?")).toBeDefined();- fireEvent.click(screen.getByRole("button", { name: "Skip" }));- await waitFor(() =>- expect(onSend).toHaveBeenCalledWith(- "Let's skip the setup questions for now.",- ),- );- },- );+ test("shows pending onboarding in an empty chat", async () => {+ mockOnboarding();+ const onSend = vi.fn();+ render(<ChatContainer {...props} onSend={onSend} />);+ expect(await screen.findByText("What topic?")).toBeDefined();+ fireEvent.click(screen.getByRole("button", { name: "Skip" }));+ await waitFor(() =>+ expect(onSend).toHaveBeenCalledWith(+ "Let's skip the setup questions for now.",+ ),+ );+ });++ test("keeps the home hero when an expert is picked before a chat exists", async () => {+ const request = mockOnboarding();+ render(<ChatContainer {...props} sessionId={null} />);+ expect(await screen.findByRole("textbox")).toBeDefined();+ expect(request).not.toHaveBeenCalled();+ expect(screen.queryByText("What topic?")).toBeNull();+ });test("sends completed answers through the new chat's send handler", async () => {mockOnboarding();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 ea4360372b..2f22242a7a 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@@ -23,7 +23,6 @@ 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 {isCreatingSession: boolean;@@ -139,18 +138,13 @@ export function EmptySession({// moves it there rather than replacing it.<GreetingLoader />) : (- <NewChatOnboarding- expertId={expertId}- enabled={!isInteractionLocked}- >- <EmptyHero- name={greetingName}- intro={introLine}- recipientPicker={recipientPicker}- isExpert={Boolean(selectedExpert)}- expertRole={selectedExpert?.role}- />- </NewChatOnboarding>+ <EmptyHero+ name={greetingName}+ intro={introLine}+ recipientPicker={recipientPicker}+ isExpert={Boolean(selectedExpert)}+ expertRole={selectedExpert?.role}+ />)}{/* Held back while the greeting is on its way — it enters with