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(platform): Sync on new UI design (#8194)

Zamil Majdy1286a1b0348f
diff --git a/autogpt_platform/frontend/src/app/auth/callback/route.ts b/autogpt_platform/frontend/src/app/auth/callback/route.ts
index c813415239..5d3e1e9536 100644
--- a/autogpt_platform/frontend/src/app/auth/callback/route.ts
+++ b/autogpt_platform/frontend/src/app/auth/callback/route.ts
@@ -6,7 +6,7 @@ export async function GET(request: Request) {
const { searchParams, origin } = new URL(request.url);
const code = searchParams.get("code");
// if "next" is in param, use it as the redirect URL
- const next = searchParams.get("next") ?? "/profile";
+ const next = searchParams.get("next") ?? "/";
if (code) {
const supabase = createServerClient();
diff --git a/autogpt_platform/frontend/src/app/build/page.tsx b/autogpt_platform/frontend/src/app/build/page.tsx
index 6d4c928c8d..6b5ea497e2 100644
--- a/autogpt_platform/frontend/src/app/build/page.tsx
+++ b/autogpt_platform/frontend/src/app/build/page.tsx
@@ -8,7 +8,7 @@ export default function Home() {
return (
<FlowEditor
- className="flow-container w-full min-h-[86vh] border border-gray-300 dark:border-gray-700 rounded-lg"
+ className="flow-container"
flowID={query.get("flowID") ?? query.get("templateID") ?? undefined}
template={!!query.get("templateID")}
/>
diff --git a/autogpt_platform/frontend/src/app/layout.tsx b/autogpt_platform/frontend/src/app/layout.tsx
index 49ba9c7ac5..d175adc210 100644
--- a/autogpt_platform/frontend/src/app/layout.tsx
+++ b/autogpt_platform/frontend/src/app/layout.tsx
@@ -34,7 +34,7 @@ export default function RootLayout({
>
<div className="flex min-h-screen flex-col">
<NavBar />
- <main className="flex-1 overflow-hidden p-4">{children}</main>
+ <main className="flex-1 p-4">{children}</main>
<TallyPopupSimple />
</div>
<Toaster />
diff --git a/autogpt_platform/frontend/src/app/login/actions.ts b/autogpt_platform/frontend/src/app/login/actions.ts
index b0f4a59bf1..ef0bff17dd 100644
--- a/autogpt_platform/frontend/src/app/login/actions.ts
+++ b/autogpt_platform/frontend/src/app/login/actions.ts
@@ -30,7 +30,7 @@ export async function login(values: z.infer<typeof loginFormSchema>) {
}
revalidatePath("/", "layout");
- redirect("/profile");
+ redirect("/");
});
}
@@ -61,7 +61,7 @@ export async function signup(values: z.infer<typeof loginFormSchema>) {
}
revalidatePath("/", "layout");
- redirect("/profile");
+ redirect("/");
},
);
}
diff --git a/autogpt_platform/frontend/src/app/login/page.tsx b/autogpt_platform/frontend/src/app/login/page.tsx
index b21dd95e5c..ad70e26981 100644
--- a/autogpt_platform/frontend/src/app/login/page.tsx
+++ b/autogpt_platform/frontend/src/app/login/page.tsx
@@ -48,8 +48,8 @@ export default function LoginPage() {
});
if (user) {
- console.log("User exists, redirecting to profile");
- router.push("/profile");
+ console.log("User exists, redirecting to home");
+ router.push("/");
}
if (isUserLoading || isSupabaseLoading || user) {
diff --git a/autogpt_platform/frontend/src/components/CustomNode.tsx b/autogpt_platform/frontend/src/components/CustomNode.tsx
index 8c434b9366..91c275a0fe 100644
--- a/autogpt_platform/frontend/src/components/CustomNode.tsx
+++ b/autogpt_platform/frontend/src/components/CustomNode.tsx
@@ -585,7 +585,7 @@ export function CustomNode({ data, id, width, height }: NodeProps<CustomNode>) {
{blockCost && (
<div className="p-3 font-semibold">
<span className="ml-auto flex items-center">
- <IconCoin /> {blockCost.cost_amount} per {blockCost.cost_type}
+ <IconCoin /> {blockCost.cost_amount} credits/{blockCost.cost_type}
</span>
</div>
)}
diff --git a/autogpt_platform/frontend/src/components/Flow.tsx b/autogpt_platform/frontend/src/components/Flow.tsx
index a55fd5fc4e..7d22be3923 100644
--- a/autogpt_platform/frontend/src/components/Flow.tsx
+++ b/autogpt_platform/frontend/src/components/Flow.tsx
@@ -579,21 +579,27 @@ const FlowEditor: React.FC<{
>
<Controls />
<Background />
- <ControlPanel className="absolute z-10" controls={editorControls}>
- <BlocksControl
- pinBlocksPopover={pinBlocksPopover} // Pass the state to BlocksControl
- blocks={availableNodes}
- addBlock={addNode}
- />
- <SaveControl
- agentMeta={savedAgent}
- onSave={(isTemplate) => requestSave(isTemplate ?? false)}
- agentDescription={agentDescription}
- onDescriptionChange={setAgentDescription}
- agentName={agentName}
- onNameChange={setAgentName}
- />
- </ControlPanel>
+ <ControlPanel
+ className="absolute z-10"
+ controls={editorControls}
+ topChildren={
+ <BlocksControl
+ pinBlocksPopover={pinBlocksPopover} // Pass the state to BlocksControl
+ blocks={availableNodes}
+ addBlock={addNode}
+ />
+ }
+ botChildren={
+ <SaveControl
+ agentMeta={savedAgent}
+ onSave={(isTemplate) => requestSave(isTemplate ?? false)}
+ agentDescription={agentDescription}
+ onDescriptionChange={setAgentDescription}
+ agentName={agentName}
+ onNameChange={setAgentName}
+ />
+ }
+ ></ControlPanel>
<PrimaryActionBar
onClickAgentOutputs={() => runnerUIRef.current?.openRunnerOutput()}
onClickRunAgent={() => {
diff --git a/autogpt_platform/frontend/src/components/NavBar.tsx b/autogpt_platform/frontend/src/components/NavBar.tsx
index 2ae259d880..667d653bff 100644
--- a/autogpt_platform/frontend/src/components/NavBar.tsx
+++ b/autogpt_platform/frontend/src/components/NavBar.tsx
@@ -5,19 +5,9 @@ import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet";
import Image from "next/image";
import getServerUser from "@/hooks/getServerUser";
import ProfileDropdown from "./ProfileDropdown";
-import {
- IconCircleUser,
- IconMenu,
- IconPackage2,
- IconRefresh,
- IconSquareActivity,
- IconWorkFlow,
-} from "@/components/ui/icons";
-import AutoGPTServerAPI from "@/lib/autogpt-server-api";
+import { IconCircleUser, IconMenu } from "@/components/ui/icons";
import CreditButton from "@/components/CreditButton";
-import { BsBoxes } from "react-icons/bs";
-import { LuLaptop } from "react-icons/lu";
-import { LuShoppingCart } from "react-icons/lu";
+import { NavBarButtons } from "./NavBarButtons";
export async function NavBar() {
const isAvailable = Boolean(
@@ -27,7 +17,7 @@ export async function NavBar() {
const { user } = await getServerUser();
return (
- <header className="sticky top-0 z-50 flex h-16 items-center gap-4 border-b bg-background px-4 md:rounded-b-3xl md:px-6 md:shadow-md">
+ <header className="sticky top-0 z-50 mx-4 flex h-16 items-center gap-4 border-b bg-background p-3 md:rounded-b-2xl md:px-6 md:shadow">
<div className="flex flex-1 items-center gap-4">
<Sheet>
<SheetTrigger asChild>
@@ -42,28 +32,11 @@ export async function NavBar() {
</SheetTrigger>
<SheetContent side="left">
<nav className="grid gap-6 text-lg font-medium">
- <Link
- href="/marketplace"
- className="mt-4 flex flex-row items-center gap-2 text-muted-foreground hover:text-foreground"
- >
- <LuShoppingCart /> Marketplace
- </Link>
- <Link
- href="/"
- className="flex flex-row items-center gap-2 text-muted-foreground hover:text-foreground"
- >
- <LuLaptop /> Monitor
- </Link>
- <Link
- href="/build"
- className="flex flex-row items-center gap-2 text-muted-foreground hover:text-foreground"
- >
- <BsBoxes /> Build
- </Link>
+ <NavBarButtons className="flex flex-row items-center gap-2" />
</nav>
</SheetContent>
</Sheet>
- <nav className="hidden md:flex md:flex-row md:items-center md:gap-7 lg:gap-8">
+ <nav className="hidden md:flex md:flex-row md:items-center md:gap-5 lg:gap-8">
<div className="flex h-10 w-20 flex-1 flex-row items-center justify-center gap-2">
<a href="https://agpt.co/">
<Image
@@ -75,24 +48,7 @@ export async function NavBar() {
/>
</a>
</div>
- <Link
- href="/marketplace"
- className="text-basehover:text-foreground flex flex-row items-center gap-2 font-semibold text-foreground"
- >
- <LuShoppingCart /> Marketplace
- </Link>
- <Link
- href="/"
- className="text-basehover:text-foreground flex flex-row items-center gap-2 font-semibold text-foreground"
- >
- <LuLaptop className="mr-1" /> Monitor
- </Link>
- <Link
- href="/build"
- className="flex flex-row items-center gap-2 text-base font-semibold text-foreground hover:text-foreground"
- >
- <BsBoxes className="mr-1" /> Build
- </Link>
+ <NavBarButtons className="flex flex-row items-center gap-1 border border-white font-semibold hover:border-gray-900" />
</nav>
</div>
<div className="flex flex-1 items-center justify-end gap-4">
diff --git a/autogpt_platform/frontend/src/components/NavBarButtons.tsx b/autogpt_platform/frontend/src/components/NavBarButtons.tsx
new file mode 100644
index 0000000000..5ca410e313
--- /dev/null
+++ b/autogpt_platform/frontend/src/components/NavBarButtons.tsx
@@ -0,0 +1,49 @@
+"use client";
+
+import Link from "next/link";
+import { BsBoxes } from "react-icons/bs";
+import { LuLaptop } from "react-icons/lu";
+import { LuShoppingCart } from "react-icons/lu";
+import { cn } from "@/lib/utils";
+import { usePathname } from "next/navigation";
+
+export function NavBarButtons({ className }: { className?: string }) {
+ "use client";
+
+ const pathname = usePathname();
+ const buttons = [
+ {
+ href: "/marketplace",
+ text: "Marketplace",
+ icon: <LuShoppingCart />,
+ },
+ {
+ href: "/",
+ text: "Monitor",
+ icon: <LuLaptop />,
+ },
+ {
+ href: "/build",
+ text: "Build",
+ icon: <BsBoxes />,
+ },
+ ];
+
+ const activeButton = buttons.find((button) => button.href === pathname);
+
+ console.log(">>>> ", activeButton);
+
+ return buttons.map((button) => (
+ <Link
+ key={button.href}
+ href={button.href}
+ className={cn(
+ className,
+ "rounded-xl p-3",
+ activeButton === button ? "button bg-gray-950 text-white" : "",
+ )}
+ >
+ {button.icon} {button.text}
+ </Link>
+ ));
+}
diff --git a/autogpt_platform/frontend/src/components/PrimaryActionButton.tsx b/autogpt_platform/frontend/src/components/PrimaryActionButton.tsx
index 739ad10cdf..2d399306eb 100644
--- a/autogpt_platform/frontend/src/components/PrimaryActionButton.tsx
+++ b/autogpt_platform/frontend/src/components/PrimaryActionButton.tsx
@@ -32,7 +32,7 @@ const PrimaryActionBar: React.FC<PrimaryActionBarProps> = ({
const runButtonOnClick = !isRunning ? onClickRunAgent : requestStopRun;
return (
- <div className="absolute bottom-0 left-0 right-0 z-50 flex items-center justify-center p-4">
+ <div className="absolute bottom-0 left-1/2 z-50 flex w-fit -translate-x-1/2 transform items-center justify-center p-4">
<div className={`flex gap-4`}>
<Tooltip key="ViewOutputs" delayDuration={500}>
<TooltipTrigger asChild>
@@ -42,8 +42,10 @@ const PrimaryActionBar: React.FC<PrimaryActionBarProps> = ({
size="primary"
variant="outline"
>
- <LogOut className="h-5 w-5" />
- <span className="text-lg font-medium">Agent Outputs </span>
+ <LogOut className="hidden h-5 w-5 md:flex" />
+ <span className="text-sm font-medium md:text-lg">
+ Agent Outputs{" "}
+ </span>
</Button>
</TooltipTrigger>
<TooltipContent>
@@ -62,7 +64,9 @@ const PrimaryActionBar: React.FC<PrimaryActionBarProps> = ({
}}
>
{runButtonIcon}
- <span className="text-lg font-medium">{runButtonLabel}</span>
+ <span className="text-sm font-medium md:text-lg">
+ {runButtonLabel}
+ </span>
</Button>
</TooltipTrigger>
<TooltipContent>
diff --git a/autogpt_platform/frontend/src/components/TallyPopup.tsx b/autogpt_platform/frontend/src/components/TallyPopup.tsx
index d16ed87877..f37e08b3fa 100644
--- a/autogpt_platform/frontend/src/components/TallyPopup.tsx
+++ b/autogpt_platform/frontend/src/components/TallyPopup.tsx
@@ -47,7 +47,7 @@ const TallyPopupSimple = () => {
};
return (
- <div className="fixed bottom-6 right-6 z-50 flex items-center gap-4 p-3 transition-all duration-300 ease-in-out">
+ <div className="fixed bottom-6 right-6 z-50 hidden items-center gap-4 p-3 transition-all duration-300 ease-in-out md:flex">
<Button variant="default" onClick={resetTutorial} className="mb-0">
Tutorial
</Button>
diff --git a/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx b/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx
index cfea589964..0813d08d97 100644
--- a/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx
+++ b/autogpt_platform/frontend/src/components/edit/control/BlocksControl.tsx
@@ -138,7 +138,7 @@ export const BlocksControl: React.FC<BlocksControlProps> = ({
))}
</div>
</CardHeader>
- <CardContent className="p-1">
+ <CardContent className="border-t px-1 py-0">
<ScrollArea
className="h-[60vh]"
data-id="blocks-control-scroll-area"
diff --git a/autogpt_platform/frontend/src/components/edit/control/ControlPanel.tsx b/autogpt_platform/frontend/src/components/edit/control/ControlPanel.tsx
index a74bb302f9..8a9476d741 100644
--- a/autogpt_platform/frontend/src/components/edit/control/ControlPanel.tsx
+++ b/autogpt_platform/frontend/src/components/edit/control/ControlPanel.tsx
@@ -25,7 +25,8 @@ export type Control = {
interface ControlPanelProps {
controls: Control[];
- children?: React.ReactNode;
+ topChildren?: React.ReactNode;
+ botChildren?: React.ReactNode;
className?: string;
}
@@ -39,14 +40,15 @@ interface ControlPanelProps {
*/
export const ControlPanel = ({
controls,
- children,
+ topChildren,
+ botChildren,
className,
}: ControlPanelProps) => {
return (
- <Card className={cn("w-14", className)}>
+ <Card className={cn("m-4 mt-24 w-14", className)}>
<CardContent className="p-0">
- <div className="rounded-radius flex flex-col items-center gap-8 px-2 sm:py-5">
- {children}
+ <div className="flex flex-col items-center gap-3 rounded-xl border py-3">
+ {topChildren}
<Separator />
{controls.map((control, index) => (
<Tooltip key={index} delayDuration={500}>
@@ -67,6 +69,8 @@ export const ControlPanel = ({
<TooltipContent side="right">{control.label}</TooltipContent>
</Tooltip>
))}
+ <Separator />
+ {botChildren}
</div>
</CardContent>
</Card>
diff --git a/autogpt_platform/frontend/src/components/flow.css b/autogpt_platform/frontend/src/components/flow.css
index 830099e750..30ef76b68f 100644
--- a/autogpt_platform/frontend/src/components/flow.css
+++ b/autogpt_platform/frontend/src/components/flow.css
@@ -111,6 +111,9 @@ textarea::placeholder {
}
.flow-container {
- width: 100%;
- height: 600px; /* Adjust this height as needed */
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100vw;
+ height: 100vh;
}
diff --git a/autogpt_platform/frontend/src/components/ui/button.tsx b/autogpt_platform/frontend/src/components/ui/button.tsx
index 467f58b2d8..2239996ac8 100644
--- a/autogpt_platform/frontend/src/components/ui/button.tsx
+++ b/autogpt_platform/frontend/src/components/ui/button.tsx
@@ -25,7 +25,7 @@ const buttonVariants = cva(
default: "h-9 px-4 py-2",
sm: "h-8 rounded-md px-3 text-xs",
lg: "h-10 rounded-md px-8",
- primary: "h-14 w-44 rounded-2xl",
+ primary: "md:h-14 md:w-44 rounded-2xl h-10 w-28",
icon: "h-9 w-9",
},
},