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): show a changelog notification for new releases (#12652)
Nicholas Tindle3fb14ca6d6b4
diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsxindex 4031bdde73..c10ab114ad 100644--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/PlatformChrome.tsx@@ -7,6 +7,7 @@ import { AppSidebar } from "@/components/layout/AppSidebar/AppSidebar";import { AppSidebarToggleProvider } from "@/components/layout/AppSidebar/components/AppSidebarTrigger/AppSidebarTrigger";import { cn } from "@/lib/utils";import { TopUpPromptProvider } from "@/components/layout/TopUpPrompt/TopUpPromptProvider";+import { ChangelogPopup } from "@/components/molecules/ChangelogPopup/ChangelogPopup";import {getPersistedSidebarOpen,SidebarInset,@@ -34,6 +35,7 @@ interface Props {export function PlatformChrome({ children, persistedSidebarOpen }: Props) {const {showAppSidebar,+ showChangelog,showTourSidebar,overlayInsetHeader,hasInsetHeaderTitle,@@ -76,6 +78,7 @@ export function PlatformChrome({ children, persistedSidebarOpen }: Props) {<BuilderSidebarAutoClose openOutsideBuilder={openOutsideBuilder} /><ArtifactsPanelNavCollapse /><AppSidebar />+ {showChangelog ? <ChangelogPopup /> : null}<SidebarInset className="bg-[#f9f9f9]"><headerclassName={cn(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 e443d3e127..ade4e96895 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@@ -12,16 +12,21 @@ import { PlatformChrome } from "../PlatformChrome";const showAppSidebarMock = vi.fn<() => boolean>(() => true);const showTourSidebarMock = vi.fn<() => boolean>(() => false);+const showChangelogMock = vi.fn<() => boolean>(() => true);vi.mock("../usePlatformChrome", () => ({usePlatformChrome: () => ({showAppSidebar: showAppSidebarMock(),showTourSidebar: showTourSidebarMock(),+ showChangelog: showChangelogMock(),}),}));vi.mock("@/components/layout/AppSidebar/AppSidebar", () => ({AppSidebar: () => <div data-testid="app-sidebar" />,}));+vi.mock("@/components/molecules/ChangelogPopup/ChangelogPopup", () => ({+ ChangelogPopup: () => <div data-testid="changelog-popup" />,+}));vi.mock("@/components/layout/TopUpPrompt/TopUpPromptProvider", () => ({TopUpPromptProvider: ({ children }: { children: ReactNode }) => (<div>{children}</div>@@ -48,6 +53,7 @@ describe("PlatformChrome", () => {vi.stubEnv("NEXT_PUBLIC_BEHAVE_AS", "CLOUD");showAppSidebarMock.mockReturnValue(true);showTourSidebarMock.mockReturnValue(false);+ showChangelogMock.mockReturnValue(true);useTourStore.setState({ isDemoComplete: false });});@@ -59,6 +65,7 @@ describe("PlatformChrome", () => {);expect(screen.getByTestId("app-sidebar")).toBeDefined();+ expect(screen.getByTestId("changelog-popup")).toBeDefined();expect(screen.getByTestId("global-search")).toBeDefined();expect(screen.getByTestId("child")).toBeDefined();});@@ -72,6 +79,7 @@ describe("PlatformChrome", () => {);expect(screen.queryByTestId("app-sidebar")).toBeNull();+ expect(screen.queryByTestId("changelog-popup")).toBeNull();expect(screen.queryByRole("navigation")).toBeNull();expect(screen.getByTestId("global-search")).toBeDefined();expect(screen.getByTestId("child")).toBeDefined();@@ -106,9 +114,18 @@ describe("PlatformChrome", () => {expect(screen.queryByText(/Start with Pro/i)).toBeNull();expect(screen.queryByText(/\$42\.50/)).toBeNull();expect(screen.queryByTestId("app-sidebar")).toBeNull();+ expect(screen.queryByTestId("changelog-popup")).toBeNull();expect(screen.getByTestId("child")).toBeDefined();});+ it("waits for the signed-in session before showing the changelog", () => {+ showChangelogMock.mockReturnValue(false);+ render(<PlatformChrome>content</PlatformChrome>);++ expect(screen.getByTestId("app-sidebar")).toBeDefined();+ expect(screen.queryByTestId("changelog-popup")).toBeNull();+ });+it("keeps the marketplace free-trial card after a previous tour completes", () => {showTourSidebarMock.mockReturnValue(true);useTourStore.setState({ isDemoComplete: true });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 763dd94dbf..5b82fffa69 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@@ -37,6 +37,23 @@ describe("usePlatformChrome", () => {expect(result.current.showAppSidebar).toBe(true);});+ it("shows the changelog after the signed-in session is ready", () => {+ const { result } = renderHook(() => usePlatformChrome());++ expect(result.current.showChangelog).toBe(true);+ });++ it.each([+ { isLoggedIn: false, isUserLoading: false },+ { isLoggedIn: false, isUserLoading: true },+ { isLoggedIn: true, isUserLoading: true },+ ])("keeps the changelog hidden for session state %j", (auth) => {+ setAuth(auth);+ const { result } = renderHook(() => usePlatformChrome());++ expect(result.current.showChangelog).toBe(false);+ });+it.each(["/settings", "/settings/billing", "/admin/marketplace"])("keeps the app sidebar off %s, which brings its own shell",async (route) => {diff --git a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.ts b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.tsindex ea1a6bc8c9..a84ec27ffe 100644--- a/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.ts+++ b/autogpt_platform/frontend/src/app/(platform)/PlatformChrome/usePlatformChrome.ts@@ -54,6 +54,7 @@ export function usePlatformChrome() {return {showAppSidebar: !isExcludedRoute && !showTourSidebar,+ showChangelog: isMounted && isLoggedIn && !isUserLoading,// On copilot the inset header floats over the chat instead of stacking// above it, so messages scroll to the viewport top. Kept separate from// `isCopilotRoute` so a future overlay-header route doesn't inheritdiff --git a/autogpt_platform/frontend/src/app/api/changelog/__tests__/route.test.ts b/autogpt_platform/frontend/src/app/api/changelog/__tests__/route.test.tsnew file mode 100644index 0000000000..f346fb422c--- /dev/null+++ b/autogpt_platform/frontend/src/app/api/changelog/__tests__/route.test.ts@@ -0,0 +1,38 @@+import { afterEach, describe, expect, it, vi } from "vitest";++import { GET } from "../route";++afterEach(() => {+ vi.restoreAllMocks();+});++describe("GET /api/changelog", () => {+ it("proxies the published site's changelog index", async () => {+ const fetchSpy = vi+ .spyOn(global, "fetch")+ .mockResolvedValue(new Response("| index |", { status: 200 }));++ const res = await GET();++ expect(res.status).toBe(200);+ expect(await res.text()).toContain("| index |");+ expect(fetchSpy).toHaveBeenCalledWith(+ "https://agpt.co/docs/platform/changelog/changelog.md",+ expect.objectContaining({ next: { revalidate: 3600 } }),+ );+ });++ it("returns 502 when the source is unavailable", async () => {+ vi.spyOn(global, "fetch").mockResolvedValue(+ new Response("nope", { status: 404 }),+ );++ expect((await GET()).status).toBe(502);+ });++ it("returns 502 when the fetch throws", async () => {+ vi.spyOn(global, "fetch").mockRejectedValue(new Error("network"));++ expect((await GET()).status).toBe(502);+ });+});diff --git a/autogpt_platform/frontend/src/app/api/changelog/route.ts b/autogpt_platform/frontend/src/app/api/changelog/route.tsnew file mode 100644index 0000000000..d2e53013c9--- /dev/null+++ b/autogpt_platform/frontend/src/app/api/changelog/route.ts@@ -0,0 +1,34 @@+import { NextResponse } from "next/server";++const PUBLISHED_CHANGELOG_INDEX =+ "https://agpt.co/docs/platform/changelog/changelog.md";++export async function GET() {+ try {+ const upstream = await fetch(PUBLISHED_CHANGELOG_INDEX, {+ headers: { Accept: "text/plain, text/markdown, */*" },+ next: { revalidate: 3600 },+ });++ if (!upstream.ok) {+ return NextResponse.json(+ { error: "Upstream changelog fetch failed" },+ { status: 502 },+ );+ }++ const markdown = await upstream.text();+ return new NextResponse(markdown, {+ status: 200,+ headers: {+ "Content-Type": "text/markdown; charset=utf-8",+ "Cache-Control": "public, max-age=300, s-maxage=3600",+ },+ });+ } catch {+ return NextResponse.json(+ { error: "Upstream changelog fetch failed" },+ { status: 502 },+ );+ }+}diff --git a/autogpt_platform/frontend/src/components/atoms/Link/Link.tsx b/autogpt_platform/frontend/src/components/atoms/Link/Link.tsxindex a5989067ff..8eb53a6175 100644--- a/autogpt_platform/frontend/src/components/atoms/Link/Link.tsx+++ b/autogpt_platform/frontend/src/components/atoms/Link/Link.tsx@@ -7,6 +7,7 @@ interface LinkProps {children: React.ReactNode;className?: string;isExternal?: boolean;+ onClick?: React.MouseEventHandler<HTMLAnchorElement>;variant?: "primary" | "secondary";}diff --git a/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/ChangelogPopup.stories.tsx b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/ChangelogPopup.stories.tsxnew file mode 100644index 0000000000..2d4cd2cc59--- /dev/null+++ b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/ChangelogPopup.stories.tsx@@ -0,0 +1,54 @@+import { Text } from "@/components/atoms/Text/Text";+import type { Meta, StoryObj } from "@storybook/nextjs";+import { http, HttpResponse } from "msw";+import { userEvent, within } from "storybook/test";+import { ChangelogPopup } from "./ChangelogPopup";+import { STORAGE_KEY } from "./changelog-constants";++const INDEX_MD = `+| Date | Highlights |+| ---- | ---------- |+| [June 18 – July 9](/docs/platform/changelog/changelog/june-18-july-9-2026.md) | File folders, shareable chats, Discord bot |+`;++const meta = {+ title: "Molecules/ChangelogPopup",+ component: ChangelogPopup,+ parameters: {+ layout: "fullscreen",+ msw: {+ handlers: [+ http.get("*/api/changelog", () => HttpResponse.text(INDEX_MD)),+ ],+ },+ },+ beforeEach() {+ localStorage.removeItem(STORAGE_KEY);+ },+} satisfies Meta<typeof ChangelogPopup>;++export default meta;+type Story = StoryObj<typeof meta>;++export const LatestRelease: Story = {+ render: function Render() {+ return (+ <div className="min-h-[calc(100vh-4rem)] bg-background">+ <Text variant="h3">Latest release</Text>+ <Text variant="body" className="mt-2 text-muted-foreground">+ The notification appears in the bottom corner. Hover or focus to+ pause.+ </Text>+ <ChangelogPopup />+ </div>+ );+ },+ play: async ({ canvasElement }) => {+ const popup = await within(canvasElement).findByRole(+ "dialog",+ { name: "What's new" },+ { timeout: 5000 },+ );+ await userEvent.hover(popup);+ },+};diff --git a/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/ChangelogPopup.tsx b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/ChangelogPopup.tsxnew file mode 100644index 0000000000..d4c2b2ad20--- /dev/null+++ b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/ChangelogPopup.tsx@@ -0,0 +1,112 @@+"use client";++import { Button } from "@/components/atoms/Button/Button";+import { Icon } from "@/components/atoms/Icon/Icon";+import { Link } from "@/components/atoms/Link/Link";+import { Text } from "@/components/atoms/Text/Text";+import {+ ArrowUpRight01Icon,+ Cancel01Icon,+ NewsIcon,+} from "@hugeicons/core-free-icons";+import { useChangelog } from "./useChangelog";++export function ChangelogPopup() {+ const {+ isVisible,+ isFading,+ latestEntry,+ dismiss,+ pauseAutoDismiss,+ resumeAutoDismiss,+ } = useChangelog();++ if (!isVisible || !latestEntry) return null;++ const highlights = latestEntry.highlights+ .split(",")+ .map((item) => item.trim())+ .filter(Boolean)+ .slice(0, 3)+ .map((item) => item.charAt(0).toUpperCase() + item.slice(1));++ return (+ <div+ className={`fixed bottom-4 right-4 z-50 w-[360px] max-w-[calc(100vw-2rem)] transition-all duration-500 ease-out sm:bottom-6 sm:right-6 ${+ isFading+ ? "pointer-events-none translate-y-2 opacity-0"+ : "translate-y-0 opacity-100"+ }`}+ onPointerEnter={(event) => {+ if (event.pointerType !== "touch") pauseAutoDismiss("hover");+ }}+ onPointerLeave={(event) => {+ if (event.pointerType !== "touch") resumeAutoDismiss("hover");+ }}+ onPointerCancel={(event) => {+ if (event.pointerType !== "touch") resumeAutoDismiss("hover");+ }}+ onFocus={() => pauseAutoDismiss("focus")}+ onBlur={(event) => {+ if (!event.currentTarget.contains(event.relatedTarget)) {+ resumeAutoDismiss("focus");+ }+ }}+ role="dialog"+ aria-label="What's new"+ >+ <div className="rounded-2xl border border-border bg-background p-5 shadow-lg">+ <div className="flex items-start gap-3">+ <div className="flex size-9 shrink-0 items-center justify-center rounded-xl bg-secondary text-foreground">+ <Icon icon={NewsIcon} size={18} />+ </div>+ <div className="min-w-0 flex-1">+ <Text variant="body-medium" className="text-foreground">+ What's new+ </Text>+ <Text variant="small" className="text-muted-foreground">+ {latestEntry.dateRange}+ </Text>+ </div>+ <Button+ type="button"+ variant="ghost"+ size="icon-sm"+ withTooltip={false}+ onClick={dismiss}+ className="-mr-1 -mt-1 text-muted-foreground hover:text-foreground"+ aria-label="Dismiss changelog"+ >+ <Icon icon={Cancel01Icon} size={16} />+ </Button>+ </div>++ <ul className="my-4 space-y-1.5">+ {highlights.map((item) => (+ <li key={item} className="flex items-start gap-2.5">+ <span+ aria-hidden="true"+ className="mt-2.5 size-1 shrink-0 rounded-full bg-muted-foreground"+ />+ <Text variant="body" className="text-foreground">+ {item}+ </Text>+ </li>+ ))}+ </ul>++ <div className="border-t border-border pt-3">+ <Link+ href={latestEntry.url}+ isExternal+ onClick={dismiss}+ className="inline-flex items-center gap-1.5 text-foreground"+ >+ View changelog+ <Icon icon={ArrowUpRight01Icon} size={16} />+ </Link>+ </div>+ </div>+ </div>+ );+}diff --git a/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/__tests__/ChangelogPopup.test.tsx b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/__tests__/ChangelogPopup.test.tsxnew file mode 100644index 0000000000..429ceca89f--- /dev/null+++ b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/__tests__/ChangelogPopup.test.tsx@@ -0,0 +1,185 @@+import { server } from "@/mocks/mock-server";+import {+ act,+ fireEvent,+ render,+ screen,+ waitFor,+} from "@/tests/integrations/test-utils";+import userEvent from "@testing-library/user-event";+import { http, HttpResponse } from "msw";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";++import { CHANGELOG_INDEX_MD_URL, STORAGE_KEY } from "../changelog-constants";+import { ChangelogPopup } from "../ChangelogPopup";++const LATEST = "june-18-july-9-2026";+const INDEX_MD = `+| Date | Highlights |+| ---- | ---------- |+| [June 18 – July 9](/docs/platform/changelog/changelog/${LATEST}.md) | File folders, shareable chats, Discord bot |+`;++beforeEach(() => {+ window.localStorage.clear();+ server.use(+ http.get(CHANGELOG_INDEX_MD_URL, () => HttpResponse.text(INDEX_MD)),+ );+});++afterEach(() => {+ server.resetHandlers();+ vi.useRealTimers();+});++describe("ChangelogPopup", () => {+ it("slides in for an unseen release with highlights and a View changelog link", async () => {+ render(<ChangelogPopup />);++ expect(+ await screen.findByText("File folders", {}, { timeout: 3000 }),+ ).toBeDefined();+ expect(screen.getByText("Shareable chats")).toBeDefined();+ expect(screen.getByText("Discord bot")).toBeDefined();++ const link = screen.getByRole("link", { name: /view changelog/i });+ expect(link.getAttribute("href")).toContain(`/changelog/${LATEST}`);+ expect(link.getAttribute("target")).toBe("_blank");+ });++ it("can be dismissed", async () => {+ render(<ChangelogPopup />);++ const dismiss = await screen.findByLabelText(+ "Dismiss changelog",+ {},+ { timeout: 3000 },+ );+ await userEvent.click(dismiss);++ await waitFor(() => expect(screen.queryByText("File folders")).toBeNull());+ });++ it("stays hidden for a release the user has already seen", async () => {+ window.localStorage.setItem(STORAGE_KEY, LATEST);+ render(<ChangelogPopup />);++ await new Promise((resolve) => setTimeout(resolve, 1800));+ expect(screen.queryByText("File folders")).toBeNull();+ });++ it("dismisses when the release link is activated while hovered and focused", async () => {+ vi.useFakeTimers();+ render(<ChangelogPopup />);+ await vi.waitFor(() => expect(screen.getByRole("dialog")).toBeDefined(), {+ timeout: 3000,+ });+ const popup = screen.getByRole("dialog");+ const link = screen.getByRole("link", { name: /view changelog/i });+ fireEvent.pointerEnter(popup, { pointerType: "mouse" });+ fireEvent.mouseEnter(popup);+ fireEvent.focus(link);+ link.addEventListener("click", (event) => event.preventDefault(), {+ once: true,+ });+ fireEvent.click(link);++ await act(() => vi.advanceTimersByTimeAsync(500));+ expect(screen.queryByRole("dialog")).toBeNull();+ expect(window.localStorage.getItem(STORAGE_KEY)).toBe(LATEST);+ });++ it("keeps the countdown after a touch tap synthesizes mouse events", async () => {+ vi.useFakeTimers();+ render(<ChangelogPopup />);+ await vi.waitFor(() => expect(screen.getByRole("dialog")).toBeDefined(), {+ timeout: 3000,+ });+ await act(() => vi.advanceTimersByTimeAsync(4000));+ const popup = screen.getByRole("dialog");+ fireEvent.pointerEnter(popup, { pointerType: "touch" });+ fireEvent.pointerDown(popup, { pointerType: "touch" });+ fireEvent.pointerUp(popup, { pointerType: "touch" });+ fireEvent.pointerLeave(popup, { pointerType: "touch" });+ fireEvent.mouseEnter(popup);+ fireEvent.click(popup);++ await act(() => vi.advanceTimersByTimeAsync(4500));+ expect(screen.queryByRole("dialog")).toBeNull();+ });++ it("resumes the remaining countdown when the hovering pointer is cancelled", async () => {+ vi.useFakeTimers();+ render(<ChangelogPopup />);+ await vi.waitFor(() => expect(screen.getByRole("dialog")).toBeDefined(), {+ timeout: 3000,+ });+ await act(() => vi.advanceTimersByTimeAsync(6000));+ const popup = screen.getByRole("dialog");+ fireEvent.pointerEnter(popup, { pointerType: "mouse" });+ fireEvent.mouseEnter(popup);+ await act(() => vi.advanceTimersByTimeAsync(9000));+ expect(screen.getByRole("dialog")).toBeDefined();++ fireEvent.pointerCancel(popup, { pointerType: "mouse" });+ await act(() => vi.advanceTimersByTimeAsync(1000));+ expect(screen.getByRole("dialog")).toBeDefined();+ await act(() => vi.advanceTimersByTimeAsync(1500));+ expect(screen.queryByRole("dialog")).toBeNull();+ });++ it.each(["hover", "focus"])(+ "stays paused until both hover and focus end (%s ends first)",+ async (firstToEnd) => {+ vi.useFakeTimers();+ render(<ChangelogPopup />);+ await vi.waitFor(() => expect(screen.getByRole("dialog")).toBeDefined(), {+ timeout: 3000,+ });+ const popup = screen.getByRole("dialog");+ const link = screen.getByRole("link", { name: /view changelog/i });+ fireEvent.pointerEnter(popup, { pointerType: "mouse" });+ fireEvent.focus(link);++ if (firstToEnd === "hover") {+ fireEvent.pointerLeave(popup, { pointerType: "mouse" });+ } else fireEvent.blur(link, { relatedTarget: document.body });++ await act(() => vi.advanceTimersByTimeAsync(9000));+ expect(screen.getByRole("dialog")).toBeDefined();++ if (firstToEnd === "hover") {+ fireEvent.blur(link, { relatedTarget: document.body });+ } else {+ fireEvent.pointerLeave(popup, { pointerType: "mouse" });+ }++ await act(() => vi.advanceTimersByTimeAsync(8500));+ expect(screen.queryByRole("dialog")).toBeNull();+ expect(window.localStorage.getItem(STORAGE_KEY)).toBe(LATEST);+ },+ );++ it("keeps the remaining time while focus moves between popup controls", async () => {+ vi.useFakeTimers();+ render(<ChangelogPopup />);+ await vi.waitFor(() => expect(screen.getByRole("dialog")).toBeDefined(), {+ timeout: 3000,+ });+ await act(() => vi.advanceTimersByTimeAsync(6000));++ const dismiss = screen.getByRole("button", { name: "Dismiss changelog" });+ const link = screen.getByRole("link", { name: /view changelog/i });+ fireEvent.focus(dismiss);+ fireEvent.blur(dismiss, { relatedTarget: link });+ fireEvent.focus(link, { relatedTarget: dismiss });+ await act(() => vi.advanceTimersByTimeAsync(9000));+ expect(screen.getByRole("dialog")).toBeDefined();++ fireEvent.blur(link, { relatedTarget: document.body });+ await act(() => vi.advanceTimersByTimeAsync(1000));+ expect(screen.getByRole("dialog")).toBeDefined();+ await act(() => vi.advanceTimersByTimeAsync(1500));+ expect(screen.queryByRole("dialog")).toBeNull();+ });+});diff --git a/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/__tests__/helpers.test.ts b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/__tests__/helpers.test.tsnew file mode 100644index 0000000000..257d4a47c7--- /dev/null+++ b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/__tests__/helpers.test.ts@@ -0,0 +1,33 @@+import { describe, expect, it } from "vitest";++import { parseChangelogIndex } from "../helpers";++const INDEX_MD = `+# What's New++| Date | Highlights |+| ---- | ---------- |+| [June 18 – July 9](/docs/platform/changelog/changelog/june-18-july-9-2026.md) | File folders, shareable chats, Discord bot |+| [May 7 – June 10](/docs/platform/changelog/changelog/may-7-june-10-2026.md) | AutoPilot upgrades, redesigned login, live subscriptions, rebuilt settings |+`;++describe("parseChangelogIndex", () => {+ it("parses published release rows with site-relative links", () => {+ const entries = parseChangelogIndex(INDEX_MD);++ expect(entries).toHaveLength(2);+ expect(entries[0]).toEqual({+ slug: "june-18-july-9-2026",+ dateRange: "June 18 – July 9",+ highlights: "File folders, shareable chats, Discord bot",+ url: "https://agpt.co/docs/platform/changelog/changelog/june-18-july-9-2026",+ });+ expect(entries[1].slug).toBe("may-7-june-10-2026");+ });++ it("ignores the header/divider rows", () => {+ expect(+ parseChangelogIndex("| Date | Highlights |\n| ---- | ---------- |"),+ ).toEqual([]);+ });+});diff --git a/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/__tests__/useChangelog.test.tsx b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/__tests__/useChangelog.test.tsxnew file mode 100644index 0000000000..149b60efae--- /dev/null+++ b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/__tests__/useChangelog.test.tsx@@ -0,0 +1,92 @@+import { server } from "@/mocks/mock-server";+import { act, renderHook, waitFor } from "@testing-library/react";+import { http, HttpResponse } from "msw";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";++import { CHANGELOG_INDEX_MD_URL, STORAGE_KEY } from "../changelog-constants";+import { useChangelog } from "../useChangelog";++const LATEST = "v0-6-63";+const INDEX_MD = `+| Date | Highlights |+| ---- | ---------- |+| [May 7 – June 10](/docs/platform/changelog/changelog/${LATEST}.md) | Copilot upgrades, new blocks |+| [Apr 1 – May 6](/docs/platform/changelog/changelog/v0-6-58.md) | Marketplace redesign |+`;++beforeEach(() => {+ window.localStorage.clear();+ server.use(+ http.get(CHANGELOG_INDEX_MD_URL, () => HttpResponse.text(INDEX_MD)),+ );+});++afterEach(() => {+ server.resetHandlers();+ vi.useRealTimers();+});++describe("useChangelog", () => {+ it("loads the latest release from the index", async () => {+ const { result } = renderHook(() => useChangelog());++ await waitFor(() => expect(result.current.latestEntry?.slug).toBe(LATEST));+ expect(result.current.latestEntry?.url).toContain(`/changelog/${LATEST}`);+ });++ it("does not surface a release the user has already seen", async () => {+ window.localStorage.setItem(STORAGE_KEY, LATEST);+ const { result } = renderHook(() => useChangelog());++ await waitFor(() => expect(result.current.latestEntry?.slug).toBe(LATEST));+ // Give the reveal delay a chance to elapse — it must stay hidden.+ await new Promise((resolve) => setTimeout(resolve, 1800));+ expect(result.current.isVisible).toBe(false);+ });++ it("does not mark a release seen if unmounted before it appears", async () => {+ const { result, unmount } = renderHook(() => useChangelog());+ await waitFor(() => expect(result.current.latestEntry?.slug).toBe(LATEST));++ expect(result.current.isVisible).toBe(false);+ unmount();+ expect(window.localStorage.getItem(STORAGE_KEY)).toBeNull();+ });++ it.each(["visible", "fading"])(+ "does not repeat a release after unmounting while %s",+ async (phase) => {+ vi.useFakeTimers();+ const { result, unmount } = renderHook(() => useChangelog());+ await vi.waitFor(() => expect(result.current.isVisible).toBe(true), {+ timeout: 3000,+ });++ if (phase === "fading") act(() => result.current.dismiss());+ unmount();++ expect(window.localStorage.getItem(STORAGE_KEY)).toBe(LATEST);+ const revisit = renderHook(() => useChangelog());+ await vi.waitFor(() =>+ expect(revisit.result.current.latestEntry?.slug).toBe(LATEST),+ );+ await act(() => vi.advanceTimersByTimeAsync(2000));+ expect(revisit.result.current.isVisible).toBe(false);+ },+ );++ it("dismiss hides the popup after fading out", async () => {+ vi.useFakeTimers();+ const { result } = renderHook(() => useChangelog());+ await vi.waitFor(() => expect(result.current.isVisible).toBe(true), {+ timeout: 3000,+ });++ act(() => result.current.dismiss());+ expect(result.current.isFading).toBe(true);+ expect(result.current.isVisible).toBe(true);+ await act(() => vi.advanceTimersByTimeAsync(500));+ expect(result.current.isVisible).toBe(false);+ expect(window.localStorage.getItem(STORAGE_KEY)).toBe(LATEST);+ });+});diff --git a/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/changelog-constants.ts b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/changelog-constants.tsnew file mode 100644index 0000000000..630ca87c09--- /dev/null+++ b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/changelog-constants.ts@@ -0,0 +1,6 @@+// The full changelog on the public docs site (opened via "View changelog").+export const CHANGELOG_BASE_URL =+ "https://agpt.co/docs/platform/changelog/changelog";+export const CHANGELOG_INDEX_MD_URL = "/api/changelog";+export const STORAGE_KEY = "autogpt-changelog-last-seen";+export const AUTO_DISMISS_MS = 8000;diff --git a/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/helpers.ts b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/helpers.tsnew file mode 100644index 0000000000..c29823cf40--- /dev/null+++ b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/helpers.ts@@ -0,0 +1,28 @@+import { CHANGELOG_BASE_URL } from "./changelog-constants";++export interface ChangelogEntry {+ slug: string;+ dateRange: string;+ highlights: string;+ // The public docs page for this release.+ url: string;+}++export function parseChangelogIndex(md: string): ChangelogEntry[] {+ const entries: ChangelogEntry[] = [];+ const rowPattern =+ /\|\s*\[([^\]]+)\]\(\/docs\/platform\/changelog\/changelog\/([a-z0-9-]+)\.md\)\s*\|\s*([^|]+)\|/g;++ let match;+ while ((match = rowPattern.exec(md)) !== null) {+ const [, dateRange, slug, highlights] = match;+ entries.push({+ slug,+ dateRange: dateRange.trim(),+ highlights: highlights.trim(),+ url: `${CHANGELOG_BASE_URL}/${slug}`,+ });+ }++ return entries;+}diff --git a/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/useChangelog.ts b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/useChangelog.tsnew file mode 100644index 0000000000..28bb9677c0--- /dev/null+++ b/autogpt_platform/frontend/src/components/molecules/ChangelogPopup/useChangelog.ts@@ -0,0 +1,129 @@+"use client";++import { useEffect, useRef, useState } from "react";+import {+ AUTO_DISMISS_MS,+ CHANGELOG_INDEX_MD_URL,+ STORAGE_KEY,+} from "./changelog-constants";+import { ChangelogEntry, parseChangelogIndex } from "./helpers";++export function useChangelog() {+ const [isVisible, setIsVisible] = useState(false);+ const [isFading, setIsFading] = useState(false);+ const [latestEntry, setLatestEntry] = useState<ChangelogEntry | null>(null);++ const autoDismissTimer = useRef<ReturnType<typeof setTimeout> | null>(null);+ const fadeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);+ const revealTimer = useRef<ReturnType<typeof setTimeout> | null>(null);+ const pauseSources = useRef(new Set<"hover" | "focus">());+ const isDismissing = useRef(false);+ // Track how much of the auto-dismiss countdown is left so hover/focus can+ // pause and resume the *remaining* time instead of restarting from scratch.+ const dismissStartedAt = useRef(0);+ const remainingMs = useRef(AUTO_DISMISS_MS);++ function clearTimers() {+ if (autoDismissTimer.current) clearTimeout(autoDismissTimer.current);+ if (fadeTimer.current) clearTimeout(fadeTimer.current);+ autoDismissTimer.current = null;+ fadeTimer.current = null;+ }++ function markAsSeen(slug: string) {+ try {+ localStorage.setItem(STORAGE_KEY, slug);+ } catch {+ /* noop */+ }+ }++ function dismiss() {+ if (isDismissing.current) return;+ isDismissing.current = true;+ clearTimers();+ setIsFading(true);+ fadeTimer.current = setTimeout(() => {+ setIsVisible(false);+ setIsFading(false);+ isDismissing.current = false;+ }, 500);+ }++ function startAutoDismiss(duration = AUTO_DISMISS_MS) {+ if (pauseSources.current.size > 0 || isDismissing.current) return;+ clearTimers();+ dismissStartedAt.current = Date.now();+ remainingMs.current = duration;+ autoDismissTimer.current = setTimeout(() => {+ if (pauseSources.current.size === 0) dismiss();+ }, duration);+ }++ function pauseAutoDismiss(source: "hover" | "focus") {+ pauseSources.current.add(source);+ if (autoDismissTimer.current) {+ clearTimeout(autoDismissTimer.current);+ autoDismissTimer.current = null;+ const elapsed = Date.now() - dismissStartedAt.current;+ remainingMs.current = Math.max(0, remainingMs.current - elapsed);+ }+ }++ function resumeAutoDismiss(source: "hover" | "focus") {+ pauseSources.current.delete(source);+ if (isDismissing.current) return;+ // Resume the leftover time rather than restarting the full countdown.+ startAutoDismiss(remainingMs.current);+ }++ useEffect(() => {+ let cancelled = false;++ fetch(CHANGELOG_INDEX_MD_URL)+ .then((res) => (res.ok ? res.text() : ""))+ .then((md) => {+ if (cancelled || !md) return;++ const entries = parseChangelogIndex(md);+ if (entries.length === 0) return;++ setLatestEntry(entries[0]);++ try {+ const lastSeen = localStorage.getItem(STORAGE_KEY);+ if (lastSeen === entries[0].slug) return;+ } catch {+ /* show anyway */+ }++ revealTimer.current = setTimeout(() => {+ if (!cancelled) setIsVisible(true);+ }, 1500);+ })+ .catch(() => {+ /* non-critical */+ });++ return () => {+ cancelled = true;+ clearTimers();+ if (revealTimer.current) clearTimeout(revealTimer.current);+ };+ }, []);++ useEffect(() => {+ if (!isVisible || isFading || !latestEntry) return;+ markAsSeen(latestEntry.slug);+ startAutoDismiss();+ }, [isVisible, isFading, latestEntry]);++ return {+ isVisible,+ isFading,+ latestEntry,+ dismiss,+ pauseAutoDismiss,+ resumeAutoDismiss,+ };+}diff --git a/autogpt_platform/frontend/src/middleware.ts b/autogpt_platform/frontend/src/middleware.tsindex f8e539b932..f8dc997dd5 100644--- a/autogpt_platform/frontend/src/middleware.ts+++ b/autogpt_platform/frontend/src/middleware.ts@@ -60,6 +60,7 @@ export const config = {* - /auth/callback (OAuth callback - needs to work without auth)* - /api/proxy (backend API proxy - the route handler authenticates* itself via httpOnly cookies)+ * - /api/changelog (public cached docs proxy - no auth; skip the round-trip)* Feel free to modify this pattern to include more paths.** Keep the PostHog proxy path (/relay/pnosthog) matched: middleware is@@ -68,6 +69,6 @@ export const config = {* Note: /auth/authorize and /auth/integrations/* ARE protected and need* middleware to run for authentication checks.*/- "/((?!_next/static|_next/image|favicon.ico|auth/callback|auth/integrations/mcp_callback|api/proxy|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",+ "/((?!_next/static|_next/image|favicon.ico|auth/callback|auth/integrations/mcp_callback|api/proxy|api/changelog|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)",],};