Skip to content

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): add a Cookie settings link to signed-out pages (#15023)

Krzysztof Czerwinskic79e7fa4927f
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/link/[token]/page.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/link/[token]/page.tsx
index cdde7dc002..d281b479bf 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/link/[token]/page.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/link/[token]/page.tsx
@@ -1,5 +1,6 @@
"use client";
+import { CookieSettingsLink } from "@/components/molecules/CookieSettingsLink/CookieSettingsLink";
import { ErrorView } from "./components/ErrorView";
import { LoadingView } from "./components/LoadingView";
import { NotAuthenticatedView } from "./components/NotAuthenticatedView";
@@ -62,6 +63,7 @@ export default function PlatformLinkPage() {
<div className="mt-8 text-center text-xs text-muted-foreground">
<p>Powered by AutoGPT Platform</p>
</div>
+ <CookieSettingsLink className="mt-2" />
</div>
);
}
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/login/__tests__/cookie-settings.test.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/login/__tests__/cookie-settings.test.tsx
new file mode 100644
index 0000000000..5dc67263a6
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/login/__tests__/cookie-settings.test.tsx
@@ -0,0 +1,79 @@
+import type { ReactNode } from "react";
+import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
+import {
+ configureCookiebot,
+ installCookiebot,
+ removeCookiebot,
+} from "@/tests/integrations/cookiebot";
+import { fireEvent, render, screen } from "@/tests/integrations/test-utils";
+import LoginPage from "../page";
+
+const mockUseAuth = vi.hoisted(() => vi.fn());
+
+vi.mock("@/providers/onboarding/onboarding-provider", () => ({
+ default: ({ children }: { children: ReactNode }) => <>{children}</>,
+}));
+
+vi.mock("@/lib/auth/hooks/useAuth", () => ({
+ useAuth: mockUseAuth,
+}));
+
+vi.mock("../actions", () => ({
+ login: vi.fn(),
+}));
+
+describe("LoginPage cookie settings", () => {
+ beforeEach(() => {
+ mockUseAuth.mockReturnValue({
+ user: null,
+ isUserLoading: false,
+ isLoggedIn: false,
+ });
+ });
+
+ afterEach(() => {
+ removeCookiebot();
+ vi.unstubAllEnvs();
+ vi.restoreAllMocks();
+ });
+
+ test("opens the Cookiebot dialog from the Cookie settings link", async () => {
+ configureCookiebot();
+ const { renew } = installCookiebot({ statistics: true });
+
+ render(<LoginPage />);
+
+ fireEvent.click(
+ await screen.findByRole("button", { name: "Cookie settings" }),
+ );
+
+ expect(renew).toHaveBeenCalledOnce();
+ });
+
+ test("hides the link when no consent banner is configured", async () => {
+ vi.stubEnv("NEXT_PUBLIC_COOKIEBOT_CBID", "");
+
+ render(<LoginPage />);
+
+ expect(
+ await screen.findByText("Log in to your account to continue"),
+ ).toBeDefined();
+ expect(
+ screen.queryByRole("button", { name: "Cookie settings" }),
+ ).toBeNull();
+ });
+
+ test("hides the link when Cookiebot could not load", async () => {
+ configureCookiebot();
+ vi.spyOn(document, "readyState", "get").mockReturnValue("complete");
+
+ render(<LoginPage />);
+
+ expect(
+ await screen.findByText("Log in to your account to continue"),
+ ).toBeDefined();
+ expect(
+ screen.queryByRole("button", { name: "Cookie settings" }),
+ ).toBeNull();
+ });
+});
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/share/[token]/__tests__/page.test.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/share/[token]/__tests__/page.test.tsx
index 3703b3e1c6..80ca5f4ce3 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/share/[token]/__tests__/page.test.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/share/[token]/__tests__/page.test.tsx
@@ -1,10 +1,15 @@
-import { beforeEach, describe, expect, test, vi } from "vitest";
+import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { http, HttpResponse } from "msw";
import { getGetV1GetSharedExecutionMockHandler200 } from "@/app/api/__generated__/endpoints/default/default.msw";
import type { SharedExecutionResponse } from "@/app/api/__generated__/models/sharedExecutionResponse";
import { server } from "@/mocks/mock-server";
-import { render, screen } from "@/tests/integrations/test-utils";
+import {
+ configureCookiebot,
+ installCookiebot,
+ removeCookiebot,
+} from "@/tests/integrations/cookiebot";
+import { fireEvent, render, screen } from "@/tests/integrations/test-utils";
import SharePage from "../page";
const TOKEN = "550e8400-e29b-41d4-a716-446655440000";
@@ -88,4 +93,47 @@ describe("SharePage (execution share viewer)", () => {
// Try again button is the only retry affordance on this view.
expect(screen.getByRole("button", { name: /try again/i })).toBeDefined();
});
+
+ describe("Cookie settings", () => {
+ afterEach(() => {
+ removeCookiebot();
+ vi.unstubAllEnvs();
+ });
+
+ test("opens the Cookiebot dialog from the page footer", async () => {
+ configureCookiebot();
+ const { renew } = installCookiebot();
+ server.use(
+ http.get(
+ "*/api/public/shared/:token",
+ () => new HttpResponse(null, { status: 404 }),
+ ),
+ );
+
+ render(<SharePage />);
+
+ fireEvent.click(
+ await screen.findByRole("button", { name: "Cookie settings" }),
+ );
+
+ expect(renew).toHaveBeenCalledOnce();
+ });
+
+ test("hides the link when no consent banner is configured", async () => {
+ vi.stubEnv("NEXT_PUBLIC_COOKIEBOT_CBID", "");
+ server.use(
+ http.get(
+ "*/api/public/shared/:token",
+ () => new HttpResponse(null, { status: 404 }),
+ ),
+ );
+
+ render(<SharePage />);
+
+ expect(await screen.findByText(/share link not found/i)).toBeDefined();
+ expect(
+ screen.queryByRole("button", { name: "Cookie settings" }),
+ ).toBeNull();
+ });
+ });
});
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/share/[token]/page.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/share/[token]/page.tsx
index 8b9317bfef..591f27a221 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/share/[token]/page.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/share/[token]/page.tsx
@@ -10,6 +10,7 @@ import {
CardTitle,
} from "@/components/__legacy__/ui/card";
import { Alert, AlertDescription } from "@/components/molecules/Alert/Alert";
+import { CookieSettingsLink } from "@/components/molecules/CookieSettingsLink/CookieSettingsLink";
import { InfoIcon } from "lucide-react";
import { useParams } from "next/navigation";
import { ShareActions } from "../components/ShareHeader/ShareActions";
@@ -31,6 +32,7 @@ function ExecutionShareChrome({
<div className="min-h-0 flex-1 overflow-y-auto">
<div className="container mx-auto px-4 py-8">{children}</div>
</div>
+ <CookieSettingsLink className="mb-1 shrink-0 self-center" />
</div>
);
}
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/share/chat/[token]/__tests__/page.test.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/share/chat/[token]/__tests__/page.test.tsx
index 8585144d8e..0c34f2ccc2 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/share/chat/[token]/__tests__/page.test.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/share/chat/[token]/__tests__/page.test.tsx
@@ -1,4 +1,4 @@
-import { beforeEach, describe, expect, test, vi } from "vitest";
+import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import { waitFor } from "@testing-library/react";
import { http, HttpResponse } from "msw";
@@ -10,7 +10,12 @@ import type { SharedChatMessagesPage } from "@/app/api/__generated__/models/shar
import type { SharedChatSession } from "@/app/api/__generated__/models/sharedChatSession";
import { useCopilotUIStore } from "@/app/(platform)/copilot/store";
import { server } from "@/mocks/mock-server";
-import { render, screen } from "@/tests/integrations/test-utils";
+import {
+ configureCookiebot,
+ installCookiebot,
+ removeCookiebot,
+} from "@/tests/integrations/cookiebot";
+import { fireEvent, render, screen } from "@/tests/integrations/test-utils";
import SharedChatPage from "../page";
const mockUseParams = vi.hoisted(() => vi.fn());
@@ -366,4 +371,30 @@ describe("SharedChatPage", () => {
await screen.findByRole("heading", { level: 1 });
expect(screen.queryByText(/older history is not visible/i)).toBeNull();
});
+
+ describe("Cookie settings", () => {
+ afterEach(() => {
+ removeCookiebot();
+ vi.unstubAllEnvs();
+ });
+
+ test("opens the Cookiebot dialog from the page footer", async () => {
+ configureCookiebot();
+ const { renew } = installCookiebot();
+ server.use(
+ http.get(
+ "*/api/public/shared/chats/:token",
+ () => new HttpResponse(null, { status: 404 }),
+ ),
+ );
+
+ render(<SharedChatPage />);
+
+ fireEvent.click(
+ await screen.findByRole("button", { name: "Cookie settings" }),
+ );
+
+ expect(renew).toHaveBeenCalledOnce();
+ });
+ });
});
diff --git a/autogpt_platform/frontend/src/app/(no-navbar)/share/chat/[token]/page.tsx b/autogpt_platform/frontend/src/app/(no-navbar)/share/chat/[token]/page.tsx
index b5d988f33d..8602a3b79e 100644
--- a/autogpt_platform/frontend/src/app/(no-navbar)/share/chat/[token]/page.tsx
+++ b/autogpt_platform/frontend/src/app/(no-navbar)/share/chat/[token]/page.tsx
@@ -6,6 +6,7 @@ import { useParams } from "next/navigation";
import { ChatMessagesContainer } from "@/app/(platform)/copilot/components/ChatMessagesContainer/ChatMessagesContainer";
import { CopilotChatActionsProvider } from "@/app/(platform)/copilot/components/CopilotChatActionsProvider/CopilotChatActionsProvider";
import { useIsMobile } from "@/app/(platform)/copilot/useIsMobile";
+import { CookieSettingsLink } from "@/components/molecules/CookieSettingsLink/CookieSettingsLink";
import { sharedChatFilePattern, sharedChatFileUrl } from "@/lib/share/routes";
import { cn } from "@/lib/utils";
import { ShareActions } from "../../components/ShareHeader/ShareActions";
@@ -44,6 +45,7 @@ function SharedChatChrome({
<div className="flex min-h-0 w-full flex-1 flex-row overflow-hidden bg-background">
{children}
</div>
+ <CookieSettingsLink className="mb-1 shrink-0 self-center" />
</div>
);
}
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.tsx
index 99ce0a5221..679e263206 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
@@ -1,8 +1,18 @@
-import { render, screen, waitFor } from "@/tests/integrations/test-utils";
+import {
+ fireEvent,
+ render,
+ screen,
+ waitFor,
+} from "@/tests/integrations/test-utils";
import type { ReactNode } from "react";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { useTourStore } from "@/app/(public)/tour/chat/tourStore";
+import {
+ configureCookiebot,
+ installCookiebot,
+ removeCookiebot,
+} from "@/tests/integrations/cookiebot";
import { PlatformChrome } from "../PlatformChrome";
const showNewLayoutMock = vi.fn<() => boolean>(() => false);
@@ -37,6 +47,7 @@ vi.mock("../../components/GlobalSearchModal/GlobalSearchOverlay", () => ({
afterEach(() => {
vi.clearAllMocks();
+ removeCookiebot();
vi.unstubAllEnvs();
});
@@ -123,4 +134,21 @@ describe("PlatformChrome", () => {
.getAttribute("href"),
).toBe("/signup");
});
+
+ it("offers cookie settings to signed-out visitors in the tour sidebar shell", async () => {
+ configureCookiebot();
+ const { renew } = installCookiebot();
+ showTourSidebarMock.mockReturnValue(true);
+ render(
+ <PlatformChrome>
+ <div data-testid="child">content</div>
+ </PlatformChrome>,
+ );
+
+ fireEvent.click(
+ await screen.findByRole("button", { name: "Cookie settings" }),
+ );
+
+ expect(renew).toHaveBeenCalledOnce();
+ });
});
diff --git a/autogpt_platform/frontend/src/app/(platform)/reset-password/page.tsx b/autogpt_platform/frontend/src/app/(platform)/reset-password/page.tsx
index 130bc9c857..3598ecb4d4 100644
--- a/autogpt_platform/frontend/src/app/(platform)/reset-password/page.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/reset-password/page.tsx
@@ -2,6 +2,7 @@
import { Button } from "@/components/atoms/Button/Button";
import { Input } from "@/components/atoms/Input/Input";
import { AuthCard } from "@/components/auth/AuthCard";
+import { CookieSettingsLink } from "@/components/molecules/CookieSettingsLink/CookieSettingsLink";
import { ExpiredLinkMessage } from "@/components/auth/ExpiredLinkMessage";
import { Form, FormField } from "@/components/__legacy__/ui/form";
import LoadingBox from "@/components/__legacy__/ui/loading";
@@ -160,6 +161,7 @@ function ResetPasswordContent() {
<AuthCard title="Reset Password">
<ExpiredLinkMessage onRequestNewLink={handleShowEmailForm} />
</AuthCard>
+ <CookieSettingsLink className="mt-6" />
</div>
);
}
@@ -251,6 +253,7 @@ function ResetPasswordContent() {
</form>
)}
</AuthCard>
+ <CookieSettingsLink className="mt-6" />
</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.tsx
index c8b62dfee6..f81f42fa41 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
@@ -20,6 +20,7 @@ import {
SidebarMenuButton,
SidebarMenuItem,
SidebarRail,
+ useSidebar,
} from "@/components/ui/sidebar";
import { motion, useReducedMotion } from "framer-motion";
import Link from "next/link";
@@ -37,6 +38,7 @@ import {
} from "@hugeicons/core-free-icons";
import type { IconSvgElement } from "@hugeicons/react";
import { Icon } from "@/components/atoms/Icon/Icon";
+import { CookieSettingsLink } from "@/components/molecules/CookieSettingsLink/CookieSettingsLink";
function DisabledMenuItem({
icon,
@@ -63,12 +65,24 @@ interface Props {
variant?: "tour" | "marketplace";
}
+// Matches the sheet's closing animation (`data-[state=closed]:duration-300`).
+const SHEET_CLOSE_MS = 300;
+
export function TourSidebar({ variant = "tour" }: Props) {
const reduceMotion = useReducedMotion();
const itemVariants = getSidebarItemVariants(!!reduceMotion);
// In the tour, the end card replaces the sidebar upsell after completion.
// The marketplace always shows the sidebar card.
const isDemoComplete = useTourStore((s) => s.isDemoComplete);
+ const { isMobile, openMobile, setOpenMobile } = useSidebar();
+
+ // On phones the sidebar is a modal sheet, which blocks clicks and focus
+ // outside itself, Cookiebot's dialog included: close it first.
+ const isSheetOpen = isMobile && openMobile;
+ async function closeMobileSheet() {
+ setOpenMobile(false);
+ await new Promise((resolve) => setTimeout(resolve, SHEET_CLOSE_MS));
+ }
return (
<Sidebar
@@ -152,11 +166,15 @@ export function TourSidebar({ variant = "tour" }: Props) {
</motion.div>
</SidebarContent>
- {(variant === "marketplace" || !isDemoComplete) && (
- <SidebarFooter className="p-3 group-data-[collapsible=icon]:hidden">
+ <SidebarFooter className="p-3 group-data-[collapsible=icon]:hidden">
+ {(variant === "marketplace" || !isDemoComplete) && (
<TourUpsellCard surface={variant} />
- </SidebarFooter>
- )}
+ )}
+ <CookieSettingsLink
+ className="self-center"
+ beforeOpen={isSheetOpen ? closeMobileSheet : undefined}
+ />
+ </SidebarFooter>
<SidebarRail />
</Sidebar>
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/__tests__/cookie-settings.test.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/__tests__/cookie-settings.test.tsx
new file mode 100644
index 0000000000..1bde7d370d
--- /dev/null
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourSidebar/__tests__/cookie-settings.test.tsx
@@ -0,0 +1,51 @@
+import { afterEach, describe, expect, test, vi } from "vitest";
+import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar";
+import {
+ configureCookiebot,
+ installCookiebot,
+ removeCookiebot,
+} from "@/tests/integrations/cookiebot";
+import {
+ act,
+ fireEvent,
+ render,
+ screen,
+} from "@/tests/integrations/test-utils";
+import { TourSidebar } from "../TourSidebar";
+
+vi.mock("@/hooks/use-mobile", () => ({ useIsMobile: () => true }));
+
+describe("TourSidebar cookie settings on a phone", () => {
+ afterEach(() => {
+ removeCookiebot();
+ vi.unstubAllEnvs();
+ vi.useRealTimers();
+ });
+
+ test("closes the sidebar sheet before opening the Cookiebot dialog", async () => {
+ configureCookiebot();
+ const { renew } = installCookiebot({ statistics: true });
+ vi.useFakeTimers({ shouldAdvanceTime: true });
+
+ render(
+ <SidebarProvider>
+ <SidebarTrigger />
+ <TourSidebar />
+ </SidebarProvider>,
+ );
+
+ fireEvent.click(screen.getByRole("button", { name: "Toggle Sidebar" }));
+ fireEvent.click(
+ await screen.findByRole("button", { name: "Cookie settings" }),
+ );
+
+ // The sheet blocks clicks outside itself, so the dialog must wait for it.
+ expect(renew).not.toHaveBeenCalled();
+ await act(async () => {
+ await vi.advanceTimersByTimeAsync(400);
+ });
+
+ expect(screen.queryByRole("dialog", { name: "Sidebar" })).toBeNull();
+ expect(renew).toHaveBeenCalledOnce();
+ });
+});
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/components/TourHero/TourHero.tsx b/autogpt_platform/frontend/src/app/(public)/tour/components/TourHero/TourHero.tsx
index 01fedf44a8..caab9e41fb 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/components/TourHero/TourHero.tsx
+++ b/autogpt_platform/frontend/src/app/(public)/tour/components/TourHero/TourHero.tsx
@@ -1,69 +1,77 @@
import { AutoGPTLogo } from "@/components/atoms/AutoGPTLogo/AutoGPTLogo";
import { Button } from "@/components/atoms/Button/Button";
import { Text } from "@/components/atoms/Text/Text";
+import { CookieSettingsLink } from "@/components/molecules/CookieSettingsLink/CookieSettingsLink";
import { TourBackground } from "./TourBackground";
import { ArrowRight02Icon, SparklesIcon } from "@hugeicons/core-free-icons";
import { Icon } from "@/components/atoms/Icon/Icon";
export function TourHero() {
return (
- <section className="relative flex flex-1 flex-col items-center justify-center overflow-hidden border-b border-neutral-100 px-6 py-16">
+ <section className="relative flex flex-1 flex-col overflow-hidden border-b border-neutral-100">
<TourBackground />
- <div className="relative z-10 flex w-full max-w-2xl flex-col items-center text-center">
- <AutoGPTLogo hideText viewBox="46 0 43 40" className="mb-6 h-20 w-20" />
+ <div className="relative z-10 flex flex-1 flex-col items-center overflow-y-auto px-6 pb-4 pt-16">
+ <div className="flex w-full max-w-2xl flex-1 flex-col items-center justify-center text-center">
+ <AutoGPTLogo
+ hideText
+ viewBox="46 0 43 40"
+ className="mb-6 h-20 w-20"
+ />
- <span className="relative mb-6 inline-flex overflow-hidden rounded-full bg-[linear-gradient(135deg,rgba(99,102,241,0.6),rgba(59,130,246,0.35),rgba(165,180,252,0.6))] p-px shadow-[0_6px_20px_-6px_rgba(59,130,246,0.35)]">
- <span className="relative inline-flex items-center gap-2 rounded-full bg-white/50 px-4 py-1.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.75)] backdrop-blur-xl">
- <Icon icon={SparklesIcon} className="h-4 w-4 text-violet-600" />
- <Text variant="small-medium" className="text-sm text-zinc-700">
- Live demo, no signup required
- </Text>
+ <span className="relative mb-6 inline-flex overflow-hidden rounded-full bg-[linear-gradient(135deg,rgba(99,102,241,0.6),rgba(59,130,246,0.35),rgba(165,180,252,0.6))] p-px shadow-[0_6px_20px_-6px_rgba(59,130,246,0.35)]">
+ <span className="relative inline-flex items-center gap-2 rounded-full bg-white/50 px-4 py-1.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.75)] backdrop-blur-xl">
+ <Icon icon={SparklesIcon} className="h-4 w-4 text-violet-600" />
+ <Text variant="small-medium" className="text-sm text-zinc-700">
+ Live demo, no signup required
+ </Text>
+ </span>
</span>
- </span>
- <Text
- as="h1"
- variant="h1"
- className="text-balance text-[4rem] font-[600] leading-[1]"
- >
- Build AI agents by just chatting
- </Text>
-
- <Text
- variant="lead"
- className="mt-5 max-w-xl text-balance text-zinc-600"
- >
- Describe a goal in plain English and watch Otto build and run a
- working AutoGPT workflow for you, in seconds, right in your browser.
- </Text>
-
- <div className="mt-10 flex w-full flex-col items-center justify-center gap-3 sm:w-auto sm:flex-row">
- <Button
- as="NextLink"
- href="/tour/chat"
- size="large"
- rightIcon={
- <Icon
- icon={ArrowRight02Icon}
- className="h-4 w-4 transition-transform duration-200 ease-out group-hover:translate-x-1"
- />
- }
- className="group w-full sm:w-auto sm:px-8"
+ <Text
+ as="h1"
+ variant="h1"
+ className="text-balance text-[4rem] font-[600] leading-[1]"
>
- Try the demo
- </Button>
- <Button
- as="NextLink"
- href="https://agpt.co/pricing"
- target="_blank"
- rel="noopener noreferrer"
- variant="ghost"
- size="large"
- className="w-full sm:w-auto"
+ Build AI agents by just chatting
+ </Text>
+
+ <Text
+ variant="lead"
+ className="mt-5 max-w-xl text-balance text-zinc-600"
>
- See pricing
- </Button>
+ Describe a goal in plain English and watch Otto build and run a
+ working AutoGPT workflow for you, in seconds, right in your browser.
+ </Text>
+
+ <div className="mt-10 flex w-full flex-col items-center justify-center gap-3 sm:w-auto sm:flex-row">
+ <Button
+ as="NextLink"
+ href="/tour/chat"
+ size="large"
+ rightIcon={
+ <Icon
+ icon={ArrowRight02Icon}
+ className="h-4 w-4 transition-transform duration-200 ease-out group-hover:translate-x-1"
+ />
+ }
+ className="group w-full sm:w-auto sm:px-8"
+ >
+ Try the demo
+ </Button>
+ <Button
+ as="NextLink"
+ href="https://agpt.co/pricing"
+ target="_blank"
+ rel="noopener noreferrer"
+ variant="ghost"
+ size="large"
+ className="w-full sm:w-auto"
+ >
+ See pricing
+ </Button>
+ </div>
</div>
+ <CookieSettingsLink className="mt-6" />
</div>
</section>
);
diff --git a/autogpt_platform/frontend/src/components/auth/AuthSplitLayout/AuthSplitLayout.tsx b/autogpt_platform/frontend/src/components/auth/AuthSplitLayout/AuthSplitLayout.tsx
index a86870f107..694c101061 100644
--- a/autogpt_platform/frontend/src/components/auth/AuthSplitLayout/AuthSplitLayout.tsx
+++ b/autogpt_platform/frontend/src/components/auth/AuthSplitLayout/AuthSplitLayout.tsx
@@ -1,5 +1,6 @@
import { ReactNode } from "react";
import { AutoGPTLogo } from "@/components/atoms/AutoGPTLogo/AutoGPTLogo";
+import { CookieSettingsLink } from "@/components/molecules/CookieSettingsLink/CookieSettingsLink";
import { AuroraBackground } from "@/components/ui/aurora-background";
import { cn } from "@/lib/utils";
@@ -15,16 +16,17 @@ export function AuthSplitLayout({ marketing, children, className }: Props) {
<aside className="relative hidden flex-1 overflow-hidden bg-slate-950 text-white lg:flex">
{marketing}
</aside>
- <section className="relative flex flex-1 flex-col items-center justify-center bg-white px-6 py-12 sm:px-10">
+ <section className="relative flex flex-1 flex-col items-center bg-white px-6 pb-4 pt-12 sm:px-10">
<AuroraBackground
aria-hidden
showRadialGradient={false}
className="absolute inset-0 h-full w-full lg:hidden"
/>
- <div className="relative z-10 flex w-full max-w-[26rem] flex-col">
+ <div className="relative z-10 flex w-full max-w-[26rem] flex-1 flex-col justify-center">
<AutoGPTLogo className="mx-auto mb-10 h-auto w-32 sm:w-40 lg:hidden" />
{children}
</div>
+ <CookieSettingsLink className="relative z-10 mt-6" />
</section>
</div>
);
diff --git a/autogpt_platform/frontend/src/components/molecules/CookieSettingsLink/CookieSettingsLink.tsx b/autogpt_platform/frontend/src/components/molecules/CookieSettingsLink/CookieSettingsLink.tsx
new file mode 100644
index 0000000000..c0dd8ed90c
--- /dev/null
+++ b/autogpt_platform/frontend/src/components/molecules/CookieSettingsLink/CookieSettingsLink.tsx
@@ -0,0 +1,48 @@
+"use client";
+
+import { Text } from "@/components/atoms/Text/Text";
+import { cn } from "@/lib/utils";
+import {
+ isConsentManagerConfigured,
+ openConsentSettings,
+} from "@/services/consent/consent";
+import { useConsentManagerStatus } from "@/services/consent/useConsent";
+
+interface Props {
+ className?: string;
+ // Runs before the dialog opens, e.g. to close a modal sheet that would
+ // otherwise block clicks on Cookiebot's dialog.
+ beforeOpen?: () => void | Promise<void>;
+}
+
+export function CookieSettingsLink({ className, beforeOpen }: Props) {
+ const status = useConsentManagerStatus();
+
+ if (!isConsentManagerConfigured() || status === "unavailable") return null;
+
+ function handleClick() {
+ if (!beforeOpen) return openConsentSettings();
+ void Promise.resolve(beforeOpen()).then(openConsentSettings);
+ }
+
+ return (
+ <button
+ type="button"
+ disabled={status !== "ready"}
+ onClick={handleClick}
+ className={cn(
+ "group inline-flex items-center rounded-md px-2 py-1.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 disabled:cursor-default disabled:opacity-60 sm:py-1",
+ className,
+ )}
+ >
+ <Text
+ variant="small"
+ as="span"
+ tone="secondary"
+ className="underline-offset-2 group-hover:text-zinc-900 group-hover:underline group-disabled:no-underline"
+ >
+ Cookie settings
+ </Text>
+ </button>
+ );
+}