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): improve product tour (#13585)
Ubbe69d934691783
diff --git a/autogpt_platform/frontend/public/images/tour-og.png b/autogpt_platform/frontend/public/images/tour-og.pngnew file mode 100644index 0000000000..f75c5357b2Binary files /dev/null and b/autogpt_platform/frontend/public/images/tour-og.png differdiff --git a/autogpt_platform/frontend/src/app/(no-navbar)/signup/page.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/signup/page.tsxindex 040ea5a506..cfc2d62114 100644--- a/autogpt_platform/frontend/src/app/(no-navbar)/signup/page.tsx+++ b/autogpt_platform/frontend/src/app/(no-navbar)/signup/page.tsx@@ -19,7 +19,11 @@ import { AuthDivider } from "@/components/auth/AuthSplitLayout/AuthDivider";import { AuthSplitLayout } from "@/components/auth/AuthSplitLayout/AuthSplitLayout";import { MobileWarningBanner } from "@/components/auth/MobileWarningBanner";import { environment } from "@/services/environment";-import { WarningOctagonIcon } from "@phosphor-icons/react/dist/ssr";+import {+ PlayCircleIcon,+ WarningOctagonIcon,+} from "@phosphor-icons/react/dist/ssr";+import NextLink from "next/link";import { useSearchParams } from "next/navigation";import { LoadingSignup } from "./components/LoadingSignup";import { SignupMarketingPanel } from "./components/SignupMarketingPanel";@@ -205,6 +209,24 @@ export default function SignupPage() {/></Form>+ <div className="mt-6 flex w-full justify-center">+ <NextLink+ href="/tour/chat?utm_source=platform_signup"+ className="inline-flex items-center gap-2 rounded-full border border-violet-200 bg-violet-50/60 px-4 py-1.5 text-sm text-zinc-700 transition-colors hover:bg-violet-100/60"+ >+ <PlayCircleIcon+ className="size-5 shrink-0 text-violet-600"+ weight="fill"+ />+ <span>+ Want to see it first?{" "}+ <span className="font-semibold text-violet-700">+ Watch the demo+ </span>+ </span>+ </NextLink>+ </div>+<div className="mt-6 inline-flex w-full items-center justify-center gap-1"><Text variant="body-medium" className="!text-slate-500">Already a member?diff --git a/autogpt_platform/frontend/src/app/(platform)/PaywallGate/PaywallModal.tsx b/autogpt_platform/frontend/src/app/(platform)/PaywallGate/PaywallModal.tsxindex a5d9ae3fa1..fd7f2358d4 100644--- a/autogpt_platform/frontend/src/app/(platform)/PaywallGate/PaywallModal.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/PaywallGate/PaywallModal.tsx@@ -6,7 +6,8 @@ import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";import { Text } from "@/components/atoms/Text/Text";import { PlanCard } from "@/components/molecules/PlanCard/PlanCard";import { cn } from "@/lib/utils";-import { SignOutIcon } from "@phosphor-icons/react";+import { PlayCircleIcon, SignOutIcon } from "@phosphor-icons/react";+import Link from "next/link";import { SwitchTierDialog } from "../settings/billing/components/SubscriptionTab/YourPlanCard/SwitchTierDialog";import { usePaywallModal } from "./usePaywallModal";@@ -65,6 +66,21 @@ export function PaywallModal() {<Text variant="body" className="!text-zinc-500">Pick a plan to unlock AutoPilot and start running agents.</Text>+ <Link+ href="/tour/chat?utm_source=platform_paywall"+ target="_blank"+ className="mt-2 inline-flex items-center gap-2 rounded-full border border-violet-200 bg-violet-50/60 px-4 py-1.5 text-sm text-zinc-700 transition-colors hover:bg-violet-100/60"+ >+ <PlayCircleIcon+ className="size-5 shrink-0 text-violet-600"+ weight="fill"+ />+ <span>+ Not sure yet?{" "}+ <span className="font-semibold text-violet-700">Try it</span> —+ Instant demo — No signup+ </span>+ </Link></div>{plans.length > 0 && (diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/PlatformChrome.test.tsx b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/PlatformChrome.test.tsxindex 815e72828e..db7ca846ac 100644--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/PlatformChrome.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/__tests__/PlatformChrome.test.tsx@@ -115,6 +115,8 @@ describe("PlatformChrome", () => {// Clicking a demo session stores the scenario and navigates to the tour.fireEvent.click(screen.getByRole("button", { name: "Daily brief" }));expect(useTourStore.getState().activeScenarioId).toBe("daily-brief");- expect(pushMock).toHaveBeenCalledWith("/tour/chat");+ expect(pushMock).toHaveBeenCalledWith(+ "/tour/chat?utm_source=platform_marketplace",+ );});});diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/TourCopilot.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/TourCopilot.tsxindex ec638dce20..1b99fd9c6f 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/TourCopilot.tsx+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/TourCopilot.tsx@@ -5,14 +5,15 @@ import { useIsMobile } from "@/app/(platform)/copilot/useIsMobile";import { DotDistortionShader } from "@/components/ui/dot-distortion-shader";import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar";import { useMountEffect } from "@/hooks/useMountEffect";-import { cn } from "@/lib/utils";import dynamic from "next/dynamic";import { CSSProperties } from "react";import { TourChatHost } from "./TourChatHost";+import { TourChatHeader } from "./components/TourChatHeader/TourChatHeader";import { TourSidebar } from "./components/TourSidebar/TourSidebar";import { buildTourArtifactRef } from "./helpers";import { getTourScenario } from "./script/tourScenarios";import { useTourStore } from "./tourStore";+import { trackTourScenarioComplete, trackTourStart } from "./tracking";const ArtifactPanel = dynamic(() =>@@ -42,26 +43,26 @@ export function TourCopilot() {const isMobile = useIsMobile();const openArtifact = useCopilotUIStore((s) => s.openArtifact);const closeArtifactPanel = useCopilotUIStore((s) => s.closeArtifactPanel);- const isArtifactOpen = useCopilotUIStore((s) => s.artifactPanel.isOpen);// The tour shares the copilot UI store but must never leak panel state// into the real /copilot: opens skip the localStorage write// (persist: false) and unmount closes the panel in memory the same way.useMountEffect(() => {+ trackTourStart();return () => closeArtifactPanel({ persist: false });});const chatColumn = (- // The chat fades back once the artifact panel opens so the visitor's- // attention lands on the payoff.- <div- className={cn(- "relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden transition-opacity duration-700",- isArtifactOpen && "opacity-50",- )}- >+ // The chat used to fade back when the artifact panel opened, but the end+ // card (the demo's follow-up CTA) now appears at that exact moment — it+ // must stay fully legible, so the column keeps full opacity.+ <div className="relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden"><TourBackdrop /><div className="relative z-10 flex min-h-0 flex-1 flex-col">+ <TourChatHeader+ scenarioLabel={scenario.label}+ scenarioIcon={scenario.icon}+ /><div className="h-4 shrink-0" /><TourChatHostkey={`${scenario.id}-${runId}`}@@ -69,6 +70,7 @@ export function TourCopilot() {script={scenario.script}completionNotice={`Your **"${scenario.completionArtifact.filename}"** will appear in a moment on the right side.`}onComplete={() => {+ trackTourScenarioComplete(scenario.id);setDemoComplete();openArtifact(buildTourArtifactRef(scenario), { persist: false });}}diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/app-shell.test.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/app-shell.test.tsxindex 1b373a8403..323d17bfc1 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/app-shell.test.tsx+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/app-shell.test.tsx@@ -69,7 +69,10 @@ describe("Tour chat app shell", () => {// Both stores are module-level state — reset between tests.useTourStore.setState({activeScenarioId: DEFAULT_SCENARIO_ID,+ runId: 0,isDemoComplete: false,+ watchedScenarioIds: [],+ isNudgeVisible: false,});useCopilotUIStore.getState().clearArtifactPreview();});diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/end-card.test.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/end-card.test.tsxnew file mode 100644index 0000000000..d9d070f2c7--- /dev/null+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/end-card.test.tsx@@ -0,0 +1,128 @@+import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";++import {+ act,+ fireEvent,+ render,+ screen,+} from "@/tests/integrations/test-utils";++// DotDistortionShader paints a canvas/WebGL frame that happy-dom cannot run and+// that is purely decorative — stub it so the real chat tree can render.+vi.mock("@/components/ui/dot-distortion-shader", () => ({+ DotDistortionShader: () => null,+}));++import TourChatPage from "../page";+import { DEFAULT_SCENARIO_ID } from "../script/tourScenarios";+import { useTourStore } from "../tourStore";++const ADVANCE_STEP_MS = 200;+// Longest turn is ~7.7s of parts — including the 5s fake run — plus the 3s+// hold before the demo completes (see main.test.tsx for the chunking rationale).+const ADVANCE_TOTAL_MS = 16000;++async function advanceThroughTurn() {+ for (+ let elapsed = 0;+ elapsed < ADVANCE_TOTAL_MS;+ elapsed += ADVANCE_STEP_MS+ ) {+ await act(async () => {+ await vi.advanceTimersByTimeAsync(ADVANCE_STEP_MS);+ });+ }+}++async function playDemoThrough() {+ await advanceThroughTurn();+ fireEvent.keyDown(screen.getByRole("button", { name: /^Send:/i }), {+ key: "Enter",+ });+ await advanceThroughTurn();+}++describe("Tour demo end state", () => {+ beforeEach(() => {+ vi.useFakeTimers();+ useTourStore.setState({+ activeScenarioId: DEFAULT_SCENARIO_ID,+ runId: 0,+ isDemoComplete: false,+ watchedScenarioIds: [],+ isNudgeVisible: false,+ });+ });++ afterEach(() => {+ vi.runOnlyPendingTimers();+ vi.useRealTimers();+ });++ test("shows the end card with pricing + another-scenario CTAs after the demo", async () => {+ render(<TourChatPage />);++ expect(screen.queryByText(/Yours will too/i)).toBeNull();++ await playDemoThrough();++ // The heading breaks "Yours will too." onto its own line with a <br/>,+ // so the two halves are separate text nodes.+ expect(screen.getByText(/That took \d+ seconds\./i)).toBeDefined();+ expect(screen.getByText(/Yours will too\./i)).toBeDefined();+ expect(+ screen.getByText(/Start with Pro · \$42\.50\/mo · cancel anytime/i),+ ).toBeDefined();+ expect(screen.queryByRole("button", { name: /^Send:/i })).toBeNull();+ expect(screen.queryByText(/Simulated demo/i)).toBeNull();++ const pricingCta = screen+ .getByText("Make this agent yours")+ .closest("a") as HTMLAnchorElement;+ expect(pricingCta.href).toContain(+ "agpt.co/pricing?utm_source=tour&utm_medium=end_card",+ );+ expect(+ screen.getByRole("button", { name: /Watch another scenario/i }),+ ).toBeDefined();+ });++ test("marks the finished scenario as watched in the sidebar", async () => {+ render(<TourChatPage />);+ await playDemoThrough();++ expect(useTourStore.getState().watchedScenarioIds).toEqual([+ DEFAULT_SCENARIO_ID,+ ]);+ expect(screen.getByText("watched")).toBeDefined();+ });++ test("idling after the demo keeps the finished chat controls hidden", async () => {+ render(<TourChatPage />);+ await playDemoThrough();++ expect(screen.queryByText(/^Next:/)).toBeNull();++ await act(async () => {+ await vi.advanceTimersByTimeAsync(4100);+ });++ expect(screen.queryByText(/^Next:/)).toBeNull();+ expect(screen.queryByRole("button", { name: /^Send:/i })).toBeNull();+ expect(screen.queryByText(/Simulated demo/i)).toBeNull();+ });++ test("watch another scenario starts the next unwatched demo", async () => {+ render(<TourChatPage />);+ await playDemoThrough();++ fireEvent.click(+ screen.getByRole("button", { name: /Watch another scenario/i }),+ );+ await act(async () => {+ await vi.advanceTimersByTimeAsync(0);+ });++ expect(useTourStore.getState().activeScenarioId).toBe("support-queue");+ });+});diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/main.test.tsxindex f6287a33b2..e56acc8a5e 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/main.test.tsx@@ -58,7 +58,10 @@ describe("Tour chat scripted demo", () => {// The scenario store is module-level state — reset between tests.useTourStore.setState({activeScenarioId: DEFAULT_SCENARIO_ID,+ runId: 0,isDemoComplete: false,+ watchedScenarioIds: [],+ isNudgeVisible: false,});// The artifact panel lives in the shared copilot UI store (also// module-level) — a completed demo leaves it open across tests.@@ -152,37 +155,35 @@ describe("Tour chat scripted demo", () => {screen.getByText(/will appear in a moment on the right side/i),).toBeDefined();- // The sidebar upsell card stays visible; no bottom banner takes over.- expect(screen.getByText(/Ready to build your own/i)).toBeDefined();- expect(screen.getByText(/Start with Pro for \$42\.50\/mo/i)).toBeDefined();- expect(screen.getByText(/Self-host free/i)).toBeDefined();+ // The end card carries the upsell now — the sidebar card hides.+ expect(screen.queryByText(/Ready to build your own/i)).toBeNull();+ expect(screen.queryByText(/Start with Pro for \$42\.50\/mo/i)).toBeNull();+ expect(screen.queryByText("Self-host free")).toBeNull();expect(screen.queryByText(/Replay demo/i)).toBeNull();- // Completion flips the store flag that turns on the card's animations.+ // Completion flips the store flag that hides the sidebar card.expect(useTourStore.getState().isDemoComplete).toBe(true);});- test("switching scenario after a completed demo un-dims the chat column", async () => {+ test("switching scenario after a completed demo closes the artifact panel", async () => {render(<TourChatPage />);// Play the default demo through both turns so it completes and opens- // the payoff artifact panel — which dims the chat column behind it.+ // the payoff artifact panel. (The chat column no longer dims behind it —+ // the end card has to stay legible.)await advanceThroughTurn();await pressEnterToSend();expect(useTourStore.getState().isDemoComplete).toBe(true);- expect(document.querySelector(".transition-opacity.opacity-50")).not.toBe(- null,- );+ expect(useCopilotUIStore.getState().artifactPanel.isOpen).toBe(true);- // Picking another chat example from the sidebar must reset the dim —- // the artifact panel belongs to the finished demo, not the new one.+ // Picking another chat example from the sidebar must close the panel —+ // it belongs to the finished demo, not the new one.fireEvent.click(screen.getByRole("button", { name: "Daily brief" }));await act(async () => {await vi.advanceTimersByTimeAsync(0);});- expect(document.querySelector(".transition-opacity.opacity-50")).toBe(null);expect(useCopilotUIStore.getState().artifactPanel.isOpen).toBe(false);});diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/share.test.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/share.test.tsxnew file mode 100644index 0000000000..25cf1b8c8b--- /dev/null+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/share.test.tsx@@ -0,0 +1,73 @@+import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";++import {+ act,+ fireEvent,+ render,+ screen,+} from "@/tests/integrations/test-utils";++// DotDistortionShader paints a canvas/WebGL frame that happy-dom cannot run and+// that is purely decorative — stub it so the real chat tree can render.+vi.mock("@/components/ui/dot-distortion-shader", () => ({+ DotDistortionShader: () => null,+}));++import TourChatPage from "../page";+import { DEFAULT_SCENARIO_ID } from "../script/tourScenarios";+import { useTourStore } from "../tourStore";++const clipboardWrite = vi.fn(async (_text: string) => {});+const datafast = vi.fn();++describe("Tour share button", () => {+ beforeEach(() => {+ vi.useFakeTimers();+ Object.defineProperty(navigator, "clipboard", {+ configurable: true,+ value: { writeText: clipboardWrite },+ });+ clipboardWrite.mockClear();+ clipboardWrite.mockImplementation(async () => {});+ window.datafast = datafast;+ datafast.mockClear();+ sessionStorage.clear();+ useTourStore.setState({+ activeScenarioId: DEFAULT_SCENARIO_ID,+ runId: 0,+ isDemoComplete: false,+ watchedScenarioIds: [],+ isNudgeVisible: false,+ });+ });++ afterEach(() => {+ vi.runOnlyPendingTimers();+ vi.useRealTimers();+ });++ test("copies the tour URL with share attribution and flips to 'Link copied'", async () => {+ render(<TourChatPage />);++ fireEvent.click(screen.getByRole("button", { name: /Share this demo/i }));+ await act(async () => {});++ expect(clipboardWrite).toHaveBeenCalledTimes(1);+ expect(clipboardWrite.mock.calls[0][0]).toBe(+ `${window.location.origin}/tour/chat?utm_source=share`,+ );+ expect(+ datafast.mock.calls.filter(([name]) => name === "tour_cta_click"),+ ).toEqual([["tour_cta_click", { label: "share" }]]);++ expect(screen.getByRole("button", { name: /Link copied/i })).toBeDefined();++ // The button returns to its resting label after the copied beat.+ await act(async () => {+ await vi.advanceTimersByTimeAsync(2100);+ });+ expect(+ screen.getByRole("button", { name: /Share this demo/i }),+ ).toBeDefined();+ });+});diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/tracking.test.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/tracking.test.tsxnew file mode 100644index 0000000000..7c6220941b--- /dev/null+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/tracking.test.tsx@@ -0,0 +1,124 @@+import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";++import {+ act,+ fireEvent,+ render,+ screen,+} from "@/tests/integrations/test-utils";++// DotDistortionShader paints a canvas/WebGL frame that happy-dom cannot run and+// that is purely decorative — stub it so the real chat tree can render.+vi.mock("@/components/ui/dot-distortion-shader", () => ({+ DotDistortionShader: () => null,+}));++import TourChatPage from "../page";+import { DEFAULT_SCENARIO_ID } from "../script/tourScenarios";+import { useTourStore } from "../tourStore";++const datafast = vi.fn();++function eventsNamed(name: string) {+ return datafast.mock.calls.filter(([eventName]) => eventName === name);+}++const ADVANCE_STEP_MS = 200;+// Longest turn is ~7.7s of parts — including the 5s fake run — plus the 3s+// hold before the demo completes (see main.test.tsx for the chunking rationale).+const ADVANCE_TOTAL_MS = 16000;++async function advanceThroughTurn() {+ for (+ let elapsed = 0;+ elapsed < ADVANCE_TOTAL_MS;+ elapsed += ADVANCE_STEP_MS+ ) {+ await act(async () => {+ await vi.advanceTimersByTimeAsync(ADVANCE_STEP_MS);+ });+ }+}++async function pressEnterToSend() {+ fireEvent.keyDown(screen.getByRole("button", { name: /^Send:/i }), {+ key: "Enter",+ });+ await advanceThroughTurn();+}++describe("Tour DataFast tracking", () => {+ beforeEach(() => {+ vi.useFakeTimers();+ window.datafast = datafast;+ datafast.mockClear();+ sessionStorage.clear();+ useTourStore.setState({+ activeScenarioId: DEFAULT_SCENARIO_ID,+ runId: 0,+ isDemoComplete: false,+ watchedScenarioIds: [],+ isNudgeVisible: false,+ });+ });++ afterEach(() => {+ vi.runOnlyPendingTimers();+ vi.useRealTimers();+ });++ test("fires tour_start once per session and tour_scenario_start per scenario run", async () => {+ render(<TourChatPage />);++ expect(eventsNamed("tour_start")).toHaveLength(1);+ expect(eventsNamed("tour_scenario_start")).toEqual([+ ["tour_scenario_start", { scenario: DEFAULT_SCENARIO_ID }],+ ]);++ // Switching scenario starts a new run but must not re-fire tour_start.+ fireEvent.click(screen.getByRole("button", { name: "Daily brief" }));+ await act(async () => {+ await vi.advanceTimersByTimeAsync(0);+ });++ expect(eventsNamed("tour_start")).toHaveLength(1);+ expect(eventsNamed("tour_scenario_start")).toHaveLength(2);+ expect(eventsNamed("tour_scenario_start")[1][1]).toEqual({+ scenario: "daily-brief",+ });+ });++ test("fires tour_scenario_complete when the demo plays through", async () => {+ render(<TourChatPage />);++ await advanceThroughTurn();+ expect(eventsNamed("tour_scenario_complete")).toHaveLength(0);++ await pressEnterToSend();++ expect(eventsNamed("tour_scenario_complete")).toEqual([+ ["tour_scenario_complete", { scenario: DEFAULT_SCENARIO_ID }],+ ]);+ });++ test("end card CTAs fire tour_cta_click with their labels", async () => {+ render(<TourChatPage />);+ await advanceThroughTurn();+ await pressEnterToSend();++ fireEvent.click(screen.getByText("Make this agent yours"));+ fireEvent.click(screen.getByText("or self-host free"));+ fireEvent.click(+ screen.getByRole("button", { name: /Watch another scenario/i }),+ );++ const labels = eventsNamed("tour_cta_click").map(+ ([, metadata]) => metadata,+ );+ expect(labels).toEqual([+ { label: "pricing", placement: "end-card" },+ { label: "self-host", placement: "end-card" },+ { label: "another-scenario", placement: "end-card" },+ ]);+ });+});diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatContainer/TourChatContainer.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatContainer/TourChatContainer.tsxindex 1835948b07..994e5c0485 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatContainer/TourChatContainer.tsx+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatContainer/TourChatContainer.tsx@@ -1,7 +1,9 @@"use client";import { LightningIcon } from "@phosphor-icons/react";+import { useTourStore } from "../../tourStore";import type { useTourCopilot } from "../../useTourCopilot";+import { TourEndCard } from "../TourEndCard/TourEndCard";import { TourMessageList } from "../TourMessageList/TourMessageList";import { TourPromptBar } from "../TourPromptBar/TourPromptBar";@@ -10,6 +12,8 @@ interface Props {}export function TourChatContainer({ chat }: Props) {+ const isDemoComplete = useTourStore((s) => s.isDemoComplete);+return (<div className="flex h-full min-h-0 w-full flex-col px-2 lg:px-0">{/* Tour-only card styling. These descendant selectors target the shared@@ -20,22 +24,25 @@ export function TourChatContainer({ chat }: Props) {<TourMessageListmessages={chat.messages}isStreaming={chat.isStreaming}+ footer={isDemoComplete ? <TourEndCard /> : null}/>- <div className="relative px-3 pb-2 pt-2">- <TourPromptBar- key={`${chat.turnIndex}:${chat.currentUserPrompt ?? ""}`}- prompt={chat.currentUserPrompt}- isStreaming={chat.isStreaming}- onSend={() =>- chat.currentUserPrompt && chat.onSend(chat.currentUserPrompt)- }- />- <p className="mt-2 flex items-center justify-center gap-1 text-sm text-zinc-400">- <LightningIcon className="size-3.5 shrink-0" weight="fill" />- Simulated demo — pick a scenario above to watch Autopilot build a- different agent- </p>- </div>+ {!isDemoComplete && (+ <div className="relative px-3 pb-2 pt-2">+ <TourPromptBar+ key={`${chat.turnIndex}:${chat.currentUserPrompt ?? ""}`}+ prompt={chat.currentUserPrompt}+ isStreaming={chat.isStreaming}+ onSend={() =>+ chat.currentUserPrompt && chat.onSend(chat.currentUserPrompt)+ }+ />+ <p className="mt-2 flex items-center justify-center gap-1 text-sm text-zinc-400">+ <LightningIcon className="size-3.5 shrink-0" weight="fill" />+ Simulated demo — pick a scenario above to watch Autopilot build a+ different agent+ </p>+ </div>+ )}</div></div>);diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/TourChatHeader.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/TourChatHeader.tsxnew file mode 100644index 0000000000..7332a7b2ad--- /dev/null+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/TourChatHeader.tsx@@ -0,0 +1,54 @@+"use client";++import { Button } from "@/components/atoms/Button/Button";+import { Text } from "@/components/atoms/Text/Text";+import { SidebarTrigger } from "@/components/ui/sidebar";+import type { Icon } from "@phosphor-icons/react";+import { CheckIcon, LinkSimpleIcon } from "@phosphor-icons/react";+import { useTourChatHeader } from "./useTourChatHeader";++interface Props {+ scenarioLabel: string;+ scenarioIcon: Icon;+}++export function TourChatHeader({+ scenarioLabel,+ scenarioIcon: ScenarioIcon,+}: Props) {+ const { isCopied, handleShare } = useTourChatHeader();++ return (+ <header className="flex shrink-0 items-center justify-between gap-2 border-b border-zinc-200/70 bg-white/70 px-3 py-2 backdrop-blur-sm md:px-4">+ <div className="flex min-w-0 items-center gap-1.5">+ {/* SidebarTrigger drops className, so the responsive hiding lives on+ a wrapper — on mobile this is the only way to reach the sidebar. */}+ <div className="md:hidden">+ <SidebarTrigger />+ </div>+ <ScenarioIcon className="size-4 shrink-0 text-violet-600" />+ <Text+ variant="body-medium"+ className="truncate bg-gradient-to-r from-violet-600 to-indigo-500 bg-clip-text text-transparent"+ >+ {scenarioLabel}+ </Text>+ </div>+ <Button+ variant="secondary"+ size="small"+ onClick={handleShare}+ leftIcon={+ isCopied ? (+ <CheckIcon className="size-4 text-emerald-600" weight="bold" />+ ) : (+ <LinkSimpleIcon className="size-4" />+ )+ }+ className="shrink-0"+ >+ {isCopied ? "Link copied" : "Share this demo"}+ </Button>+ </header>+ );+}diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/helpers.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/helpers.tsnew file mode 100644index 0000000000..9c3701d744--- /dev/null+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/helpers.ts@@ -0,0 +1,31 @@+export function buildTourShareUrl() {+ return `${window.location.origin}/tour/chat?utm_source=share`;+}++export async function copyTextToClipboard(text: string): Promise<boolean> {+ try {+ await navigator.clipboard.writeText(text);+ return true;+ } catch {+ // In-app browsers (Instagram, Google app) often block the async+ // clipboard API — fall back to the legacy execCommand path.+ return copyViaHiddenTextarea(text);+ }+}++function copyViaHiddenTextarea(text: string): boolean {+ const textarea = document.createElement("textarea");+ textarea.value = text;+ textarea.setAttribute("readonly", "");+ textarea.style.position = "fixed";+ textarea.style.opacity = "0";+ document.body.appendChild(textarea);+ textarea.select();+ try {+ return document.execCommand("copy");+ } catch {+ return false;+ } finally {+ textarea.remove();+ }+}diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/useTourChatHeader.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/useTourChatHeader.tsnew file mode 100644index 0000000000..dffb191f93--- /dev/null+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourChatHeader/useTourChatHeader.ts@@ -0,0 +1,32 @@+"use client";++import { useToast } from "@/components/molecules/Toast/use-toast";+import { useRef, useState } from "react";+import { trackTourCtaClick } from "../../tracking";+import { buildTourShareUrl, copyTextToClipboard } from "./helpers";++const COPIED_RESET_MS = 2000;++export function useTourChatHeader() {+ const [isCopied, setIsCopied] = useState(false);+ const resetTimer = useRef<ReturnType<typeof setTimeout> | null>(null);+ const { toast } = useToast();++ async function handleShare() {+ trackTourCtaClick("share");+ const copied = await copyTextToClipboard(buildTourShareUrl());+ if (!copied) {+ toast({+ title: "Couldn't copy the link",+ description: buildTourShareUrl(),+ variant: "destructive",+ });+ return;+ }+ setIsCopied(true);+ if (resetTimer.current) clearTimeout(resetTimer.current);+ resetTimer.current = setTimeout(() => setIsCopied(false), COPIED_RESET_MS);+ }++ return { isCopied, handleShare };+}diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourEndCard/TourEndCard.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourEndCard/TourEndCard.tsxnew file mode 100644index 0000000000..60583906ca--- /dev/null+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourEndCard/TourEndCard.tsx@@ -0,0 +1,72 @@+"use client";++import { Button } from "@/components/atoms/Button/Button";+import { Text } from "@/components/atoms/Text/Text";+import { CheckIcon, PlayIcon } from "@phosphor-icons/react";+import {+ buildTourPricingUrl,+ TOUR_DEMO_CLAIM_SECONDS,+ TOUR_GITHUB_URL,+} from "../../constants";+import { useTourEndCard } from "./useTourEndCard";++export function TourEndCard() {+ const { handlePricingClick, handleSelfHostClick, handleWatchAnother } =+ useTourEndCard();++ return (+ <div className="mx-auto w-full max-w-md rounded-2xl border border-zinc-200/70 bg-white p-5 shadow-sm duration-500 animate-in fade-in slide-in-from-bottom-2 sm:p-6">+ <div className="flex flex-col items-center gap-2 text-center">+ <span className="inline-flex items-center gap-1.5 rounded-full bg-emerald-50 px-3 py-1">+ <CheckIcon className="size-3.5 text-emerald-700" weight="bold" />+ <Text variant="small-medium" className="!text-emerald-700">+ Agent built & first run complete — {TOUR_DEMO_CLAIM_SECONDS}{" "}+ seconds+ </Text>+ </span>+ <Text variant="h4" as="h3" className="mt-1 text-zinc-900">+ That took {TOUR_DEMO_CLAIM_SECONDS} seconds.+ <br />+ Yours will too.+ </Text>+ <Text variant="body" className="text-zinc-500">+ Same chat, your real tasks — hosted and running for you.+ </Text>+ </div>++ <div className="mt-5 flex flex-col gap-3">+ <Button+ as="NextLink"+ href={buildTourPricingUrl("end_card")}+ target="_blank"+ rel="noopener noreferrer"+ variant="primary"+ onClick={handlePricingClick}+ className="h-auto w-full flex-col gap-0 py-2.5 shadow-[0_0_20px_-6px_rgba(124,58,237,0.6)]"+ >+ <span className="font-medium">Make this agent yours</span>+ <span className="text-xs font-normal opacity-80">+ Start with Pro · $42.50/mo · cancel anytime+ </span>+ </Button>+ <Button+ variant="secondary"+ onClick={handleWatchAnother}+ leftIcon={<PlayIcon className="size-4" weight="fill" />}+ className="w-full"+ >+ Watch another scenario+ </Button>+ <a+ href={TOUR_GITHUB_URL}+ target="_blank"+ rel="noopener noreferrer"+ onClick={handleSelfHostClick}+ className="mt-1 text-center text-sm text-zinc-500 underline underline-offset-2 hover:text-zinc-700"+ >+ or self-host free+ </a>+ </div>+ </div>+ );+}diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourEndCard/useTourEndCard.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourEndCard/useTourEndCard.tsnew file mode 100644index 0000000000..e335ee5f28--- /dev/null+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourEndCard/useTourEndCard.ts@@ -0,0 +1,48 @@+"use client";++import { useMountEffect } from "@/hooks/useMountEffect";+import { getNextTourScenario } from "../../script/tourScenarios";+import { useTourStore } from "../../tourStore";+import { trackTourCtaClick } from "../../tracking";+import { useTourScenarioSelection } from "../../useTourScenarioSelection";++/** How long the visitor can sit on the finished demo before the "Next: …"+ * chip appears and the next sidebar scenario starts pulsing. */+const IDLE_NUDGE_DELAY_MS = 4000;++export function useTourEndCard() {+ const activeScenarioId = useTourStore((s) => s.activeScenarioId);+ const watchedScenarioIds = useTourStore((s) => s.watchedScenarioIds);+ const showNudge = useTourStore((s) => s.showNudge);+ const selectScenario = useTourScenarioSelection();++ const nextScenario = getNextTourScenario(+ activeScenarioId,+ watchedScenarioIds,+ );++ // The card only mounts once the demo completes, so idle time starts here.+ useMountEffect(() => {+ const timer = setTimeout(showNudge, IDLE_NUDGE_DELAY_MS);+ return () => clearTimeout(timer);+ });++ function handlePricingClick() {+ trackTourCtaClick("pricing", { placement: "end-card" });+ }++ function handleSelfHostClick() {+ trackTourCtaClick("self-host", { placement: "end-card" });+ }++ function handleWatchAnother() {+ trackTourCtaClick("another-scenario", { placement: "end-card" });+ selectScenario(nextScenario.id);+ }++ return {+ handlePricingClick,+ handleSelfHostClick,+ handleWatchAnother,+ };+}diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourMessageList/TourMessageList.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourMessageList/TourMessageList.tsxindex b06d29d8a0..c2155d3f0b 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourMessageList/TourMessageList.tsx+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourMessageList/TourMessageList.tsx@@ -26,9 +26,12 @@ const CARD_ANIMATION_CLASSES =interface Props {messages: TourMessage[];isStreaming: boolean;+ /** Rendered inside the conversation scroll area after the transcript —+ * the demo end card lives here so it reads as part of the chat flow. */+ footer?: React.ReactNode;}-export function TourMessageList({ messages, isStreaming }: Props) {+export function TourMessageList({ messages, isStreaming, footer }: Props) {const last = messages[messages.length - 1];const showThinking =isStreaming && last?.role === "assistant" && last.parts.length === 0;@@ -58,6 +61,7 @@ export function TourMessageList({ messages, isStreaming }: Props) {</Message>))}{showThinking && <ThinkingIndicator active elapsedSeconds={0} />}+ {footer}</ConversationContent><ConversationScrollButton /></Conversation>diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourNextScenarioChip/TourNextScenarioChip.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourNextScenarioChip/TourNextScenarioChip.tsxnew file mode 100644index 0000000000..e07bd7c0bd--- /dev/null+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourNextScenarioChip/TourNextScenarioChip.tsx@@ -0,0 +1,39 @@+"use client";++import { PlayIcon } from "@phosphor-icons/react";+import { TOUR_NEXT_SCENARIO_SECONDS } from "../../constants";+import { getNextTourScenario } from "../../script/tourScenarios";+import { useTourStore } from "../../tourStore";+import { trackTourCtaClick } from "../../tracking";+import { useTourScenarioSelection } from "../../useTourScenarioSelection";++export function TourNextScenarioChip() {+ const activeScenarioId = useTourStore((s) => s.activeScenarioId);+ const watchedScenarioIds = useTourStore((s) => s.watchedScenarioIds);+ const selectScenario = useTourScenarioSelection();++ const nextScenario = getNextTourScenario(+ activeScenarioId,+ watchedScenarioIds,+ );++ function handleClick() {+ trackTourCtaClick("another-scenario", { placement: "nudge-chip" });+ selectScenario(nextScenario.id);+ }++ return (+ <div className="flex justify-center pb-2">+ <button+ type="button"+ onClick={handleClick}+ className="inline-flex items-center gap-1.5 rounded-full border border-dashed border-violet-400 bg-violet-50/80 px-3.5 py-1.5 text-sm font-medium text-violet-700 transition-colors duration-300 animate-in fade-in slide-in-from-bottom-1 hover:bg-violet-100"+ >+ <PlayIcon className="size-3.5 shrink-0" weight="fill" />+ <span className="truncate">+ Next: {nextScenario.label} — watch it in {TOUR_NEXT_SCENARIO_SECONDS}s+ </span>+ </button>+ </div>+ );+}diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/TourSidebar.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/TourSidebar.tsxindex dd1104118c..30366088ed 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/TourSidebar.tsx+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/TourSidebar.tsx@@ -1,6 +1,5 @@"use client";-import { useCopilotUIStore } from "@/app/(platform)/copilot/store";import {getSidebarItemVariants,sidebarContainerVariants,@@ -22,8 +21,10 @@ import {SidebarMenuItem,SidebarRail,} from "@/components/ui/sidebar";+import { cn } from "@/lib/utils";import {CaretDownIcon,+ CheckIcon,FlowArrowIcon,FolderIcon,type Icon,@@ -35,8 +36,9 @@ import {import { motion, useReducedMotion } from "framer-motion";import Link from "next/link";import { useRouter } from "next/navigation";-import { tourScenarios } from "../../script/tourScenarios";+import { getNextTourScenario, tourScenarios } from "../../script/tourScenarios";import { useTourStore } from "../../tourStore";+import { useTourScenarioSelection } from "../../useTourScenarioSelection";import { TourSidebarHeader } from "./components/TourSidebarHeader";import { TourUpsellCard } from "./components/TourUpsellCard";@@ -69,17 +71,22 @@ function DisabledMenuItem({function TourSessionsMenu({ variant }: { variant: TourSidebarVariant }) {const router = useRouter();const activeScenarioId = useTourStore((s) => s.activeScenarioId);- const setActiveScenario = useTourStore((s) => s.setActiveScenario);- const closeArtifactPanel = useCopilotUIStore((s) => s.closeArtifactPanel);+ const watchedScenarioIds = useTourStore((s) => s.watchedScenarioIds);+ const isDemoComplete = useTourStore((s) => s.isDemoComplete);+ const isNudgeVisible = useTourStore((s) => s.isNudgeVisible);+ const selectTourScenario = useTourScenarioSelection();++ // While the visitor idles on a finished demo, the scenario the nudge chip+ // points at pulses in the sidebar too.+ const nudgeScenarioId =+ variant === "tour" && isDemoComplete && isNudgeVisible+ ? getNextTourScenario(activeScenarioId, watchedScenarioIds).id+ : null;function selectScenario(id: string) {- // Close (not just clear) the panel: a completed demo leaves- // artifactPanel.isOpen=true, which keeps the chat column dimmed at- // opacity-50 behind it. persist:false keeps the tour from leaking- // panel state into the real /copilot, same as TourCopilot's cleanup.- closeArtifactPanel({ persist: false });- setActiveScenario(id);- if (variant === "marketplace") router.push("/tour/chat");+ selectTourScenario(id);+ if (variant === "marketplace")+ router.push("/tour/chat?utm_source=platform_marketplace");}return (@@ -90,10 +97,20 @@ function TourSessionsMenu({ variant }: { variant: TourSidebarVariant }) {isActive={variant === "tour" && scenario.id === activeScenarioId}tooltip={scenario.label}onClick={() => selectScenario(scenario.id)}- className="font-normal data-[active=true]:!bg-zinc-200 data-[active=true]:font-normal hover:!bg-zinc-200"+ className={cn(+ "font-normal data-[active=true]:!bg-zinc-200 data-[active=true]:font-normal hover:!bg-zinc-200",+ scenario.id === nudgeScenarioId &&+ "animate-pulse bg-violet-50 outline-dashed outline-1 outline-violet-400",+ )}><scenario.icon className="size-4 shrink-0" /><span className="truncate">{scenario.label}</span>+ {variant === "tour" && watchedScenarioIds.includes(scenario.id) && (+ <span className="ml-auto flex shrink-0 items-center gap-0.5 text-xs text-emerald-600">+ <CheckIcon className="size-3" weight="bold" />+ watched+ </span>+ )}</SidebarMenuButton></SidebarMenuItem>))}@@ -113,6 +130,9 @@ interface Props {export function TourSidebar({ variant = "tour" }: Props) {const reduceMotion = useReducedMotion();const itemVariants = getSidebarItemVariants(!!reduceMotion);+ // Once the demo finishes, the end card in the chat carries the upsell —+ // the sidebar card hides until a new scenario resets the demo.+ const isDemoComplete = useTourStore((s) => s.isDemoComplete);return (<Sidebar@@ -210,9 +230,11 @@ export function TourSidebar({ variant = "tour" }: Props) {</motion.div></SidebarContent>- <SidebarFooter className="p-3 group-data-[collapsible=icon]:hidden">- <TourUpsellCard />- </SidebarFooter>+ {!isDemoComplete && (+ <SidebarFooter className="p-3 group-data-[collapsible=icon]:hidden">+ <TourUpsellCard />+ </SidebarFooter>+ )}<SidebarRail /></Sidebar>diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/components/TourUpsellCard.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/components/TourUpsellCard.tsxindex dd576cf0e4..13a2b685a7 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/components/TourUpsellCard.tsx+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/components/TourUpsellCard.tsx@@ -2,93 +2,58 @@import { Button } from "@/components/atoms/Button/Button";import { Text } from "@/components/atoms/Text/Text";-import { cn } from "@/lib/utils";import { GithubLogoIcon, SparkleIcon } from "@phosphor-icons/react";-import { useTourStore } from "../../../tourStore";--const PRICING_URL = "https://agpt.co/pricing";-const GITHUB_URL = "https://github.com/Significant-Gravitas/AutoGPT";+import { buildTourPricingUrl, TOUR_GITHUB_URL } from "../../../constants";+import { trackTourCtaClick } from "../../../tracking";+// Only rendered while the demo is still playing — once it completes the+// sidebar hides this card and the end card in the chat carries the upsell.export function TourUpsellCard() {- // The glow and moving effects (spinning border, shine sweep, pulsing- // sparkle) would fight the streaming transcript for attention, so the card- // sits quiet and only lights up once the demo has played through.- const isDemoComplete = useTourStore((s) => s.isDemoComplete);-return (- // Border: a p-px shell whose backdrop is a plain hairline while the demo- // runs and an oversized spinning conic gradient once it completes (same- // trick as PlanCard's badge).- <div- className={cn(- "relative rounded-xl p-px",- isDemoComplete- ? "shadow-[0_0_20px_-4px_rgba(139,92,246,0.45),0_0_44px_-8px_rgba(139,92,246,0.4)]"- : "shadow-sm",- )}- >- <span- aria-hidden="true"- className="absolute inset-0 overflow-hidden rounded-xl"- >- <span- className={cn(- "absolute -inset-[150%]",- isDemoComplete- ? "animate-[spin_6s_linear_infinite] bg-[conic-gradient(from_0deg,#ede9fe,#c4b5fd,#8b5cf6,#ede9fe,#ddd6fe,#a78bfa,#ede9fe)]"- : "bg-zinc-200/80",- )}+ <div className="relative flex flex-col rounded-xl border border-zinc-200/80 bg-white p-4 shadow-sm">+ <div className="flex items-center gap-1.5">+ <SparkleIcon+ size={14}+ weight="fill"+ className="shrink-0 text-violet-600"/>- </span>-- <div className="relative flex flex-col rounded-[11px] bg-white p-4">- <div className="flex items-center gap-1.5">- <SparkleIcon- size={14}- weight="fill"- className={cn(- "shrink-0 text-violet-600",- isDemoComplete && "animate-pulse",- )}- />- <Text variant="body-medium" className="text-zinc-900">- Ready to build your own?- </Text>- </div>- <Text variant="small" className="mt-1 text-zinc-500">- Spin up agents like this in minutes, hosted for you or on your own- infrastructure.+ <Text variant="body-medium" className="text-zinc-900">+ Ready to build your own?</Text>- <Button- as="NextLink"- href={PRICING_URL}- target="_blank"- rel="noopener noreferrer"- variant="primary"- size="small"- className="relative mt-3 w-full overflow-hidden shadow-[0_0_20px_-6px_rgba(124,58,237,0.6)] transition-shadow hover:shadow-[0_0_28px_-4px_rgba(124,58,237,0.75)]"- >- {isDemoComplete && (- <span- aria-hidden="true"- className="pointer-events-none absolute inset-y-0 left-0 w-1/3 -skew-x-12 animate-[progress-bar_2.6s_ease-in-out_infinite] bg-gradient-to-r from-transparent via-white/40 to-transparent"- />- )}- Start with Pro for $42.50/mo- </Button>- <Button- as="NextLink"- href={GITHUB_URL}- target="_blank"- rel="noopener noreferrer"- variant="ghost"- size="small"- className="mt-1.5 w-full text-zinc-600"- leftIcon={<GithubLogoIcon className="h-4 w-4" />}- >- Self-host free- </Button></div>+ <Text variant="small" className="mt-1 text-zinc-500">+ Spin up agents like this in minutes, hosted for you or on your own+ infrastructure.+ </Text>+ <Button+ as="NextLink"+ href={buildTourPricingUrl("sidebar_card")}+ target="_blank"+ rel="noopener noreferrer"+ variant="primary"+ size="small"+ onClick={() =>+ trackTourCtaClick("pricing", { placement: "sidebar-card" })+ }+ className="mt-3 w-full shadow-[0_0_20px_-6px_rgba(124,58,237,0.6)] transition-shadow hover:shadow-[0_0_28px_-4px_rgba(124,58,237,0.75)]"+ >+ Start with Pro for $42.50/mo+ </Button>+ <Button+ as="NextLink"+ href={TOUR_GITHUB_URL}+ target="_blank"+ rel="noopener noreferrer"+ variant="ghost"+ size="small"+ onClick={() =>+ trackTourCtaClick("self-host", { placement: "sidebar-card" })+ }+ className="mt-1.5 w-full text-zinc-600"+ leftIcon={<GithubLogoIcon className="h-4 w-4" />}+ >+ Self-host free+ </Button></div>);}diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/constants.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/constants.tsnew file mode 100644index 0000000000..8983ac573e--- /dev/null+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/constants.ts@@ -0,0 +1,15 @@+export const TOUR_GITHUB_URL =+ "https://github.com/Significant-Gravitas/AutoGPT";++/** The tour's marketing claim, matched to the page title ("…in 60 seconds").+ * The scripted animation runs shorter, but with reading and Enter presses a+ * real watch-through lands around here. */+export const TOUR_DEMO_CLAIM_SECONDS = 60;+/** Watch-time pitch for the next scenario on the idle nudge chip. */+export const TOUR_NEXT_SCENARIO_SECONDS = 45;++/** Outbound pricing links carry UTM params so DataFast can attribute+ * upgrades back to the exact tour placement that drove them. */+export function buildTourPricingUrl(placement: "end_card" | "sidebar_card") {+ return `https://agpt.co/pricing?utm_source=tour&utm_medium=${placement}`;+}diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/page.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/page.tsxindex 324098ff89..b3a284e1c1 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/page.tsx+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/page.tsx@@ -1,7 +1,36 @@-"use client";-+import type { Metadata } from "next";import { TourCopilot } from "./TourCopilot";+const TITLE = "Watch AutoGPT build a working agent in 60 seconds";+const DESCRIPTION =+ "See AutoGPT build and run a real AI agent from start to finish in about 60 seconds. No signup required. Watch how AI agents automate real work before you try it yourself.";+const OG_IMAGE = "https://platform.agpt.co/images/tour-og.png";++export const metadata: Metadata = {+ title: TITLE,+ description: DESCRIPTION,+ openGraph: {+ title: TITLE,+ description: DESCRIPTION,+ siteName: "AutoGPT",+ type: "website",+ images: [+ {+ url: OG_IMAGE,+ width: 1200,+ height: 630,+ alt: "AutoGPT tour — an agent built, run and delivering its first result",+ },+ ],+ },+ twitter: {+ card: "summary_large_image",+ title: TITLE,+ description: DESCRIPTION,+ images: [OG_IMAGE],+ },+};+export default function TourChatPage() {return <TourCopilot />;}diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/tourScenarios.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/tourScenarios.tsindex 3c94bfc2fd..3d0a2737d3 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/script/tourScenarios.ts+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/script/tourScenarios.ts@@ -49,6 +49,27 @@ export const tourScenarios: TourScenario[] = [export const DEFAULT_SCENARIO_ID = "competitor-watch";+/** The scenario the end-of-demo nudge points at: the next unwatched one in+ * sidebar order (wrapping around), or simply the next one once all are+ * watched — "Watch another scenario" should always lead somewhere. */+export function getNextTourScenario(+ activeScenarioId: string,+ watchedScenarioIds: string[],+): TourScenario {+ const activeIndex = tourScenarios.findIndex(+ (scenario) => scenario.id === activeScenarioId,+ );+ const others = [+ ...tourScenarios.slice(activeIndex + 1),+ ...tourScenarios.slice(0, Math.max(activeIndex, 0)),+ ];+ return (+ others.find((scenario) => !watchedScenarioIds.includes(scenario.id)) ??+ others[0] ??+ tourScenarios[0]+ );+}+export function getTourScenario(id: string): TourScenario {return (tourScenarios.find((scenario) => scenario.id === id) ??diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/tourStore.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/tourStore.tsindex 6257dd7dc2..61b0f7f0fd 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/tourStore.ts+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/tourStore.ts@@ -6,22 +6,41 @@ interface TourState {/** Bumped on every sidebar selection — re-keys the demo so clicking a* scenario (even the already-active one) always restarts it fresh. */runId: number;- /** True once the active demo has played through — the sidebar upsell card- * saves its attention-grabbing animations for this moment. */+ /** True once the active demo has played through — the end card takes over+ * the upsell and the sidebar card hides until a new scenario starts. */isDemoComplete: boolean;+ /** Scenarios the visitor has watched to completion — the sidebar marks+ * them with a check and the "next scenario" nudge skips them. */+ watchedScenarioIds: string[];+ /** True once the visitor has idled past the end card — shows the+ * "Next: …" chip and pulses the next scenario in the sidebar. */+ isNudgeVisible: boolean;setActiveScenario: (id: string) => void;setDemoComplete: () => void;+ showNudge: () => void;}export const useTourStore = create<TourState>((set) => ({activeScenarioId: DEFAULT_SCENARIO_ID,runId: 0,isDemoComplete: false,+ watchedScenarioIds: [],+ isNudgeVisible: false,setActiveScenario: (id) =>set((state) => ({activeScenarioId: id,runId: state.runId + 1,isDemoComplete: false,+ isNudgeVisible: false,})),- setDemoComplete: () => set({ isDemoComplete: true }),+ setDemoComplete: () =>+ set((state) => ({+ isDemoComplete: true,+ watchedScenarioIds: state.watchedScenarioIds.includes(+ state.activeScenarioId,+ )+ ? state.watchedScenarioIds+ : [...state.watchedScenarioIds, state.activeScenarioId],+ })),+ showNudge: () => set({ isNudgeVisible: true }),}));diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/tracking.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/tracking.tsnew file mode 100644index 0000000000..c492bbe457--- /dev/null+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/tracking.ts@@ -0,0 +1,37 @@+import { analytics } from "@/services/analytics";++export type TourCtaLabel =+ | "pricing"+ | "another-scenario"+ | "self-host"+ | "share";++const TOUR_START_SESSION_KEY = "tour_start_tracked";++export function trackTourStart() {+ try {+ if (sessionStorage.getItem(TOUR_START_SESSION_KEY)) return;+ sessionStorage.setItem(TOUR_START_SESSION_KEY, "1");+ } catch {+ // In-app browsers may block sessionStorage — double-counting a visit+ // beats dropping it.+ }+ analytics.sendDatafastEvent("tour_start", {});+}++export function trackTourScenarioStart(scenarioId: string) {+ analytics.sendDatafastEvent("tour_scenario_start", { scenario: scenarioId });+}++export function trackTourScenarioComplete(scenarioId: string) {+ analytics.sendDatafastEvent("tour_scenario_complete", {+ scenario: scenarioId,+ });+}++export function trackTourCtaClick(+ label: TourCtaLabel,+ metadata: Record<string, unknown> = {},+) {+ analytics.sendDatafastEvent("tour_cta_click", { label, ...metadata });+}diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourCopilot.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourCopilot.tsindex eeb46f19a9..4a3557e76e 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourCopilot.ts+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourCopilot.ts@@ -4,6 +4,7 @@ import { useMountEffect } from "@/hooks/useMountEffect";import { useRef, useState } from "react";import { appendPartToLastMessage, textRevealDurationMs } from "./helpers";import type { TourMessage, TourScript } from "./script/types";+import { trackTourScenarioStart } from "./tracking";type TourStatus = "ready" | "streaming";@@ -144,6 +145,7 @@ export function useTourCopilot({// hook — each fresh mount auto-plays its first turn (pressing Enter still// works and just skips the wait).useMountEffect(() => {+ trackTourScenarioStart(sessionId);scheduleAutoStart();return clearTimers;});diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourScenarioSelection.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourScenarioSelection.tsnew file mode 100644index 0000000000..77da437cb0--- /dev/null+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/useTourScenarioSelection.ts@@ -0,0 +1,20 @@+"use client";++import { useCopilotUIStore } from "@/app/(platform)/copilot/store";+import { useTourStore } from "./tourStore";++/** Switching scenarios always closes the previous run's artifact panel —+ * shared by the sidebar sessions, the end card and the nudge chip. */+export function useTourScenarioSelection() {+ const setActiveScenario = useTourStore((s) => s.setActiveScenario);+ const closeArtifactPanel = useCopilotUIStore((s) => s.closeArtifactPanel);++ return function selectScenario(id: string) {+ // Close (not just clear) the panel: a completed demo leaves+ // artifactPanel.isOpen=true, which keeps the chat column dimmed at+ // opacity-50 behind it. persist:false keeps the tour from leaking+ // panel state into the real /copilot, same as TourCopilot's cleanup.+ closeArtifactPanel({ persist: false });+ setActiveScenario(id);+ };+}diff --git a/autogpt_platform/frontend/src/app/(public)/tour/page.tsx b/autogpt_platform/frontend/src/app/(public)/tour/page.tsxindex bc055cd46c..170fe57446 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/page.tsx+++ b/autogpt_platform/frontend/src/app/(public)/tour/page.tsx@@ -1,5 +1,36 @@+import type { Metadata } from "next";import { TourHero } from "./components/TourHero/TourHero";+const TITLE = "Watch AutoGPT build a working agent in 60 seconds";+const DESCRIPTION =+ "See AutoGPT build and run a real AI agent from start to finish in about 60 seconds. No signup required. Watch how AI agents automate real work before you try it yourself.";+const OG_IMAGE = "https://platform.agpt.co/images/tour-og.png";++export const metadata: Metadata = {+ title: TITLE,+ description: DESCRIPTION,+ openGraph: {+ title: TITLE,+ description: DESCRIPTION,+ siteName: "AutoGPT",+ type: "website",+ images: [+ {+ url: OG_IMAGE,+ width: 1200,+ height: 630,+ alt: "AutoGPT tour — an agent built, run and delivering its first result",+ },+ ],+ },+ twitter: {+ card: "summary_large_image",+ title: TITLE,+ description: DESCRIPTION,+ images: [OG_IMAGE],+ },+};+export default function Page() {return <TourHero />;}diff --git a/autogpt_platform/frontend/src/components/molecules/CookieConsentBanner/__tests__/CookieConsentBanner.test.tsx b/autogpt_platform/frontend/src/components/molecules/CookieConsentBanner/__tests__/CookieConsentBanner.test.tsxnew file mode 100644index 0000000000..7c35feedab--- /dev/null+++ b/autogpt_platform/frontend/src/components/molecules/CookieConsentBanner/__tests__/CookieConsentBanner.test.tsx@@ -0,0 +1,41 @@+import { render, screen } from "@/tests/integrations/test-utils";+import { beforeEach, describe, expect, test, vi } from "vitest";++let pathname = "/marketplace";++vi.mock("next/navigation", () => ({+ useRouter: () => ({+ push: vi.fn(),+ replace: vi.fn(),+ prefetch: vi.fn(),+ back: vi.fn(),+ forward: vi.fn(),+ refresh: vi.fn(),+ }),+ usePathname: () => pathname,+ useSearchParams: () => new URLSearchParams(),+ useParams: () => ({}),+}));++import { CookieConsentBanner } from "../CookieConsentBanner";++describe("CookieConsentBanner", () => {+ beforeEach(() => {+ localStorage.clear();+ });++ test("shows for a visitor without consent", async () => {+ pathname = "/marketplace";+ render(<CookieConsentBanner />);+ expect(await screen.findByText("We use cookies")).toBeDefined();+ });++ test("stays hidden on the public tour pages", async () => {+ pathname = "/tour/chat";+ render(<CookieConsentBanner />);+ // The banner renders after a consent-load effect; give it the same beat+ // the positive case needs before asserting absence.+ await Promise.resolve();+ expect(screen.queryByText("We use cookies")).toBeNull();+ });+});diff --git a/autogpt_platform/frontend/src/components/molecules/CookieConsentBanner/useCookieConsentBanner.ts b/autogpt_platform/frontend/src/components/molecules/CookieConsentBanner/useCookieConsentBanner.tsindex 98b4a299b1..c1f900a1db 100644--- a/autogpt_platform/frontend/src/components/molecules/CookieConsentBanner/useCookieConsentBanner.ts+++ b/autogpt_platform/frontend/src/components/molecules/CookieConsentBanner/useCookieConsentBanner.ts@@ -1,5 +1,6 @@"use client";+import { usePathname } from "next/navigation";import { useState } from "react";import { useCookieConsent } from "./useCookieConsent";@@ -7,8 +8,14 @@ export function useCookieConsentBanner() {const { consent, isLoaded, handleAcceptAll, handleRejectAll } =useCookieConsent();const [showSettings, setShowSettings] = useState(false);+ const pathname = usePathname();- const shouldShowBanner = isLoaded && !consent.hasConsented;+ // The public tour demo keeps the banner out of the way — DataFast loads+ // there without the consent gate instead (see SetupAnalytics).+ const isPublicTourPage = pathname?.startsWith("/tour") ?? false;++ const shouldShowBanner =+ isLoaded && !consent.hasConsented && !isPublicTourPage;function handleAcceptAllClick() {handleAcceptAll();diff --git a/autogpt_platform/frontend/src/services/analytics/index.tsx b/autogpt_platform/frontend/src/services/analytics/index.tsxindex 58ce1cb925..b98afe2def 100644--- a/autogpt_platform/frontend/src/services/analytics/index.tsx+++ b/autogpt_platform/frontend/src/services/analytics/index.tsx@@ -7,6 +7,7 @@import type { GAParams } from "@/types/google";import { consent } from "@/services/consent/cookies";+import { usePathname } from "next/navigation";import Script from "next/script";import { useEffect, useState } from "react";import { environment } from "../environment";@@ -38,8 +39,15 @@ export function SetupAnalytics(props: SetupProps) {setHasAnalyticsConsent(consent.hasConsentFor("analytics"));}, []);+ // The public tour hides the cookie banner, so DataFast loads there without+ // the consent gate — otherwise tour funnel events would never fire for+ // first-touch visitors.+ const pathname = usePathname();+ const isPublicTourPage = pathname?.startsWith("/tour") ?? false;+// Datafa.st journey analytics only on production AND with consent- const dataFastEnabled = isProductionDomain && hasAnalyticsConsent;+ const dataFastEnabled =+ isProductionDomain && (hasAnalyticsConsent || isPublicTourPage);// We collect analytics too for open source developers running the platform locally// BUT only with consentconst googleAnalyticsEnabled =