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.
refactor(frontend): delete the unused page components and helpers outside components/ (#15925)
Reinier van der Leer057a0c682df3
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ProgressBar/ProgressBar.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ProgressBar/ProgressBar.tsxdeleted file mode 100644index d251b08640..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ProgressBar/ProgressBar.tsx+++ /dev/null@@ -1,26 +0,0 @@-import { cn } from "@/lib/utils";--interface Props {- value: number;- label?: string;- className?: string;-}--export function ProgressBar({ value, label, className }: Props) {- const clamped = Math.min(100, Math.max(0, value));-- return (- <div className={cn("flex flex-col gap-1.5", className)}>- <div className="flex items-center justify-between text-xs text-neutral-500">- <span>{label ?? "Working on it..."}</span>- <span>{Math.round(clamped)}%</span>- </div>- <div className="h-2 w-full overflow-hidden rounded-full bg-neutral-200">- <div- className="h-full rounded-full bg-neutral-900 transition-[width] duration-300 ease-out"- style={{ width: `${clamped}%` }}- />- </div>- </div>- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/SpinnerLoader/SpinnerLoader.module.css b/autogpt_platform/frontend/src/app/(platform)/copilot/components/SpinnerLoader/SpinnerLoader.module.cssdeleted file mode 100644index ee456bfac4..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/SpinnerLoader/SpinnerLoader.module.css+++ /dev/null@@ -1,57 +0,0 @@-.loader {- position: relative;- display: inline-block;- flex-shrink: 0;- transform: rotateZ(45deg);- perspective: 1000px;- border-radius: 50%;- color: currentColor;-}--.loader::before,-.loader::after {- content: "";- display: block;- position: absolute;- top: 0;- left: 0;- width: inherit;- height: inherit;- border-radius: 50%;- transform: rotateX(70deg);- animation: spin 1s linear infinite;-}--.loader::after {- color: var(--spinner-accent, #a855f7);- transform: rotateY(70deg);- animation-delay: 0.4s;-}--@keyframes spin {- 0%,- 100% {- box-shadow: 0.2em 0 0 0 currentColor;- }- 12% {- box-shadow: 0.2em 0.2em 0 0 currentColor;- }- 25% {- box-shadow: 0 0.2em 0 0 currentColor;- }- 37% {- box-shadow: -0.2em 0.2em 0 0 currentColor;- }- 50% {- box-shadow: -0.2em 0 0 0 currentColor;- }- 62% {- box-shadow: -0.2em -0.2em 0 0 currentColor;- }- 75% {- box-shadow: 0 -0.2em 0 0 currentColor;- }- 87% {- box-shadow: 0.2em -0.2em 0 0 currentColor;- }-}diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/SpinnerLoader/SpinnerLoader.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/SpinnerLoader/SpinnerLoader.tsxdeleted file mode 100644index d921b5f778..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/SpinnerLoader/SpinnerLoader.tsx+++ /dev/null@@ -1,16 +0,0 @@-import { cn } from "@/lib/utils";-import styles from "./SpinnerLoader.module.css";--interface Props {- size?: number;- className?: string;-}--export function SpinnerLoader({ size = 24, className }: Props) {- return (- <div- className={cn(styles.loader, className)}- style={{ width: size, height: size }}- />- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryActionSubHeader/LibraryActionSubHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryActionSubHeader/LibraryActionSubHeader.tsxdeleted file mode 100644index 74b86ca652..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/library/components/LibraryActionSubHeader/LibraryActionSubHeader.tsx+++ /dev/null@@ -1,28 +0,0 @@-"use client";--import { LibraryAgentSort } from "@/app/api/__generated__/models/libraryAgentSort";-import { Text } from "@/components/atoms/Text/Text";-import { LibrarySortMenu } from "../LibrarySortMenu/LibrarySortMenu";--interface Props {- agentCount: number;- setLibrarySort: (value: LibraryAgentSort) => void;-}--export function LibraryActionSubHeader({ agentCount, setLibrarySort }: Props) {- return (- <div className="flex items-baseline justify-between">- <div className="flex items-baseline gap-4">- <Text variant="h5">My workflows</Text>- <Text- variant="body"- data-testid="agents-count"- className="text-zinc-500"- >- {agentCount}- </Text>- </div>- <LibrarySortMenu setLibrarySort={setLibrarySort} />- </div>- );-}diff --git a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/CreatorInfoCard/CreatorInfoCard.tsx b/autogpt_platform/frontend/src/app/(platform)/marketplace/components/CreatorInfoCard/CreatorInfoCard.tsxdeleted file mode 100644index 0d15e66487..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/marketplace/components/CreatorInfoCard/CreatorInfoCard.tsx+++ /dev/null@@ -1,120 +0,0 @@-import Avatar, {- AvatarFallback,- AvatarImage,-} from "@/components/atoms/Avatar/Avatar";-import { StarRatingIcons } from "@/components/__legacy__/ui/icons";--interface CreatorInfoCardProps {- username: string;- handle: string;- avatarSrc: string | null;- categories: string[];- averageRating: number;- totalRuns: number;-}--export const CreatorInfoCard = ({- username,- handle,- avatarSrc,- categories,- averageRating,- totalRuns,-}: CreatorInfoCardProps) => {- return (- <div- className="inline-flex h-auto min-h-[500px] w-full max-w-[440px] flex-col items-start justify-between rounded-[26px] bg-violet-100 p-4 dark:bg-violet-900 sm:h-[632px] sm:w-[440px] sm:p-6"- role="article"- aria-label={`Creator profile for ${username}`}- >- <div className="flex w-full flex-col items-start justify-start gap-3.5 sm:h-[218px]">- <Avatar className="h-[100px] w-[100px] sm:h-[130px] sm:w-[130px]">- {avatarSrc && (- <AvatarImage- width={130}- height={130}- src={avatarSrc}- alt={`${username}'s avatar`}- />- )}- <AvatarFallback- size={130}- className="h-[100px] w-[100px] sm:h-[130px] sm:w-[130px]"- >- {username}- </AvatarFallback>- </Avatar>- <div className="flex w-full flex-col items-start justify-start gap-1.5">- <div- data-testid="creator-title"- className="w-full font-poppins text-[35px] font-medium leading-10 text-neutral-900 dark:text-neutral-100 sm:text-[35px] sm:leading-10"- >- {username}- </div>- <div className="w-full text-lg font-normal leading-6 text-neutral-800 dark:text-neutral-200 sm:text-xl sm:leading-7">- @{handle}- </div>- </div>- </div>-- <div className="my-4 flex w-full flex-col items-start justify-start gap-6 sm:gap-[50px]">- <div className="flex w-full flex-col items-start justify-start gap-3">- <div className="h-px w-full bg-neutral-700 dark:bg-neutral-300" />- <div className="flex flex-col items-start justify-start gap-2.5">- <div className="w-full text-base font-medium leading-normal text-neutral-800 dark:text-neutral-200">- Top categories- </div>- <div- className="flex flex-wrap items-center gap-2.5"- role="list"- aria-label="Categories"- >- {categories.map((category, index) => (- <div- key={index}- className="flex items-center justify-center gap-2.5 rounded-[34px] border border-neutral-600 px-4 py-3 dark:border-neutral-400"- role="listitem"- >- <div className="text-base font-normal leading-normal text-neutral-800 dark:text-neutral-200">- {category}- </div>- </div>- ))}- </div>- </div>- </div>-- <div className="flex w-full flex-col items-start justify-start gap-3">- <div className="h-px w-full bg-neutral-700 dark:bg-neutral-300" />- <div className="flex w-full flex-col items-start justify-between gap-4 sm:flex-row sm:gap-0">- <div className="flex w-full flex-col items-start justify-start gap-2.5 sm:w-[164px]">- <div className="w-full text-base font-medium leading-normal text-neutral-800 dark:text-neutral-200">- Average rating- </div>- <div className="inline-flex items-center gap-2">- <div className="text-[18px] font-semibold leading-[28px] text-neutral-800 dark:text-neutral-200">- {averageRating.toFixed(1)}- </div>- <div- className="flex items-center gap-px"- role="img"- aria-label={`Rating: ${averageRating} out of 5 stars`}- >- {StarRatingIcons(averageRating)}- </div>- </div>- </div>- <div className="flex w-full flex-col items-start justify-start gap-2.5 sm:w-[164px]">- <div className="w-full text-base font-medium leading-normal text-neutral-800 dark:text-neutral-200">- Number of runs- </div>- <div className="text-[18px] font-semibold leading-[28px] text-neutral-800 dark:text-neutral-200">- {new Intl.NumberFormat().format(totalRuns)} runs- </div>- </div>- </div>- </div>- </div>- </div>- );-};diff --git a/autogpt_platform/frontend/src/app/(platform)/raise/components/AssistantBubble/AssistantBubble.tsx b/autogpt_platform/frontend/src/app/(platform)/raise/components/AssistantBubble/AssistantBubble.tsxdeleted file mode 100644index effb424b60..0000000000--- a/autogpt_platform/frontend/src/app/(platform)/raise/components/AssistantBubble/AssistantBubble.tsx+++ /dev/null@@ -1,32 +0,0 @@-"use client";--import { useEffect, useState } from "react";--type Props = {- text: string;- typingDelayMs?: number;-};--export function AssistantBubble({ text, typingDelayMs = 350 }: Props) {- const [revealed, setRevealed] = useState(typingDelayMs === 0);-- useEffect(() => {- if (typingDelayMs === 0) return;- const timer = setTimeout(() => setRevealed(true), typingDelayMs);- return () => clearTimeout(timer);- }, [typingDelayMs]);-- return (- <div className="max-w-[80%] self-start rounded-3xl rounded-bl-lg bg-background px-5 py-3.5 text-[15px] leading-relaxed text-foreground shadow-sm duration-500 animate-in fade-in slide-in-from-bottom-3 fill-mode-both motion-reduce:animate-none">- {revealed ? (- text- ) : (- <span className="flex gap-1" aria-label="Typing">- <span className="h-2 w-2 animate-bounce rounded-full bg-muted-foreground/40 [animation-delay:-0.3s]" />- <span className="h-2 w-2 animate-bounce rounded-full bg-muted-foreground/40 [animation-delay:-0.15s]" />- <span className="h-2 w-2 animate-bounce rounded-full bg-muted-foreground/40" />- </span>- )}- </div>- );-}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.tsxdeleted file mode 100644index 6d6183df97..0000000000--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourNextScenarioChip/TourNextScenarioChip.tsx+++ /dev/null@@ -1,39 +0,0 @@-"use client";-import { TOUR_NEXT_SCENARIO_SECONDS } from "../../constants";-import { getNextTourScenario } from "../../script/tourScenarios";-import { useTourStore } from "../../tourStore";-import { trackTourCtaClick } from "../../tracking";-import { useTourScenarioSelection } from "../../useTourScenarioSelection";-import { PlayIcon } from "@hugeicons/core-free-icons";-import { Icon } from "@/components/atoms/Icon/Icon";--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"- >- <Icon icon={PlayIcon} className="size-3.5 shrink-0" />- <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/constants.ts b/autogpt_platform/frontend/src/app/(public)/tour/chat/constants.tsindex 8983ac573e..b4d399a0e8 100644--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/constants.ts+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/constants.ts@@ -5,8 +5,6 @@ export const TOUR_GITHUB_URL =* 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. */diff --git a/autogpt_platform/frontend/src/services/feature-flags/FeatureFlagPage.tsx b/autogpt_platform/frontend/src/services/feature-flags/FeatureFlagPage.tsxdeleted file mode 100644index f7d49e805f..0000000000--- a/autogpt_platform/frontend/src/services/feature-flags/FeatureFlagPage.tsx+++ /dev/null@@ -1,30 +0,0 @@-"use client";--import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";-import { useRouter } from "next/navigation";-import { ReactNode, useEffect } from "react";-import { Flag, useFlagStatus } from "./use-get-flag";--interface Props {- flag: Flag;- whenDisabled: string;- children: ReactNode;-}--export function FeatureFlagPage({ flag, whenDisabled, children }: Props) {- const router = useRouter();- const { enabled, ready } = useFlagStatus(flag);- const flagEnabled = Boolean(enabled);-- useEffect(() => {- if (ready && !flagEnabled) {- router.replace(whenDisabled);- }- }, [ready, flagEnabled, router, whenDisabled]);-- return !ready || !flagEnabled ? (- <LoadingSpinner size="large" cover />- ) : (- <>{children}</>- );-}diff --git a/autogpt_platform/frontend/src/services/feature-flags/FeatureFlagRedirect.tsx b/autogpt_platform/frontend/src/services/feature-flags/FeatureFlagRedirect.tsxdeleted file mode 100644index c2b1f9fb1b..0000000000--- a/autogpt_platform/frontend/src/services/feature-flags/FeatureFlagRedirect.tsx+++ /dev/null@@ -1,29 +0,0 @@-"use client";--import { LoadingSpinner } from "@/components/atoms/LoadingSpinner/LoadingSpinner";-import { useRouter } from "next/navigation";-import { useEffect } from "react";-import { Flag, useFlagStatus } from "./use-get-flag";--interface Props {- flag: Flag;- whenEnabled: string;- whenDisabled: string;-}--export function FeatureFlagRedirect({- flag,- whenEnabled,- whenDisabled,-}: Props) {- const router = useRouter();- const { enabled, ready } = useFlagStatus(flag);- const flagEnabled = Boolean(enabled);-- useEffect(() => {- if (!ready) return;- router.replace(flagEnabled ? whenEnabled : whenDisabled);- }, [ready, flagEnabled, router, whenEnabled, whenDisabled]);-- return <LoadingSpinner size="large" cover />;-}diff --git a/autogpt_platform/frontend/src/types/chat.ts b/autogpt_platform/frontend/src/types/chat.tsdeleted file mode 100644index 16362ea953..0000000000--- a/autogpt_platform/frontend/src/types/chat.ts+++ /dev/null@@ -1,30 +0,0 @@-/**- * Shared type definitions for chat-related data structures.- * These types provide type-safe alternatives to Record<string, any>.- */--/**- * Represents a valid JSON value that can be used in tool arguments or results.- * This is a recursive type that allows for nested objects and arrays.- */-export type JsonValue =- | string- | number- | boolean- | null- | JsonValue[]- | { [key: string]: JsonValue };--/**- * Represents tool arguments passed to a tool call.- * Can be a simple object with string keys and JSON values.- */-export interface ToolArguments {- [key: string]: JsonValue;-}--/**- * Represents the result returned from a tool execution.- * Can be either a string or a structured object with JSON values.- */-export type ToolResult = string | { [key: string]: JsonValue };