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/library): Add icons to primary agent run action buttons (#9651)

Reinier van der Leer2c92122721c4
diff --git a/autogpt_platform/frontend/src/components/agents/agent-run-details-view.tsx b/autogpt_platform/frontend/src/components/agents/agent-run-details-view.tsx
index ccdef84575..5153ec3e93 100644
--- a/autogpt_platform/frontend/src/components/agents/agent-run-details-view.tsx
+++ b/autogpt_platform/frontend/src/components/agents/agent-run-details-view.tsx
@@ -11,6 +11,7 @@ import {
import type { ButtonAction } from "@/components/agptui/types";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+import { IconRefresh, IconSquare } from "@/components/ui/icons";
import { Button } from "@/components/agptui/Button";
import { Input } from "@/components/ui/input";
@@ -121,14 +122,29 @@ export default function AgentRunDetailsView({
...(["running", "queued"].includes(runStatus)
? ([
{
- label: "Stop run",
+ label: (
+ <>
+ <IconSquare className="mr-2 size-4" />
+ Stop run
+ </>
+ ),
variant: "secondary",
callback: stopRun,
},
] satisfies ButtonAction[])
: []),
...(["success", "failed", "stopped"].includes(runStatus)
- ? [{ label: "Run again", callback: runAgain }]
+ ? [
+ {
+ label: (
+ <>
+ <IconRefresh className="mr-2 size-4" />
+ Run again
+ </>
+ ),
+ callback: runAgain,
+ },
+ ]
: []),
{ label: "Delete run", variant: "secondary", callback: deleteRun },
],
diff --git a/autogpt_platform/frontend/src/components/agents/agent-run-draft-view.tsx b/autogpt_platform/frontend/src/components/agents/agent-run-draft-view.tsx
index 50ba007c96..dfe215f2b2 100644
--- a/autogpt_platform/frontend/src/components/agents/agent-run-draft-view.tsx
+++ b/autogpt_platform/frontend/src/components/agents/agent-run-draft-view.tsx
@@ -7,6 +7,7 @@ import { GraphExecutionID, GraphMeta } from "@/lib/autogpt-server-api";
import type { ButtonAction } from "@/components/agptui/types";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Button, ButtonProps } from "@/components/agptui/Button";
+import { IconPlay } from "@/components/ui/icons";
import { Input } from "@/components/ui/input";
export default function AgentRunDraftView({
@@ -31,12 +32,19 @@ export default function AgentRunDraftView({
[api, graph, inputValues, onRun],
);
- const runActions: {
- label: string;
- variant?: ButtonProps["variant"];
- callback: () => void;
- }[] = useMemo(
- () => [{ label: "Run", variant: "accent", callback: () => doRun() }],
+ const runActions: ButtonAction[] = useMemo(
+ () => [
+ {
+ label: (
+ <>
+ <IconPlay className="mr-2 size-5" />
+ Run
+ </>
+ ),
+ variant: "accent",
+ callback: doRun,
+ },
+ ],
[doRun],
);
diff --git a/autogpt_platform/frontend/src/components/agptui/types.ts b/autogpt_platform/frontend/src/components/agptui/types.ts
index b02e0aa5ec..7b07afc8cc 100644
--- a/autogpt_platform/frontend/src/components/agptui/types.ts
+++ b/autogpt_platform/frontend/src/components/agptui/types.ts
@@ -1,7 +1,8 @@
import type { ButtonProps } from "@/components/agptui/Button";
+import React from "react";
export type ButtonAction = {
- label: string;
+ label: React.ReactNode;
variant?: ButtonProps["variant"];
callback: () => void;
};