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.
fix(frontend): call the adoptable list "Your workflows" and match heading sizes (#14142)
Ubbe06a2f4a79094
diff --git a/autogpt_platform/frontend/src/app/(platform)/team/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/team/__tests__/main.test.tsxindex c6c02e1bf1..29cd5fc416 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/__tests__/main.test.tsx@@ -1217,7 +1217,7 @@ describe("TeamPage", () => {expect(within(group).getByText(/nothing installed yet/i)).toBeDefined();});- test("lists adoptable and local-only agents under Your agents", async () => {+ test("lists adoptable and local-only agents under Your workflows", async () => {const user = userEvent.setup();server.use(getListExpertsMockHandler([hiredMaria]),@@ -1228,7 +1228,9 @@ describe("TeamPage", () => {render(<TeamPage />);- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });expect(within(agents).getByText("Research Assistant")).toBeDefined();expect(within(agents).getByText("My Private Agent")).toBeDefined();expect(within(agents).getByRole("button", { name: "Adopt" })).toBeDefined();@@ -1240,7 +1242,7 @@ describe("TeamPage", () => {);});- test("hides already-installed agents from Your agents", async () => {+ test("hides already-installed agents from Your workflows", async () => {const installedAgent = makeLibraryAgent({id: "lib-installed",graph_id: "graph-1",@@ -1256,7 +1258,9 @@ describe("TeamPage", () => {render(<TeamPage />);- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });expect(within(agents).getByText("Research Assistant")).toBeDefined();expect(within(agents).queryByText("My Private Agent")).toBeNull();expect(@@ -1289,7 +1293,9 @@ describe("TeamPage", () => {render(<TeamPage />);- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });await user.click(within(agents).getByRole("button", { name: "Adopt" }));await waitFor(() => expect(installExpertId).toBe("expert-maria"));@@ -1326,7 +1332,9 @@ describe("TeamPage", () => {render(<TeamPage />);- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });await user.click(within(agents).getByRole("button", { name: "Adopt" }));expect(screen.queryByText(/undo anytime/i)).toBeNull();await user.click(@@ -1381,7 +1389,9 @@ describe("TeamPage", () => {render(<TeamPage />);- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });await user.click(within(agents).getByRole("button", { name: "Adopt" }));await waitFor(() => expect(installExpertId).toBe("expert-john"));@@ -1400,15 +1410,17 @@ describe("TeamPage", () => {render(<TeamPage />);await screen.findByRole("region", { name: "Maria runs" });- await screen.findByRole("region", { name: "Your agents" });+ await screen.findByRole("region", { name: "Your workflows" });await user.click(screen.getByRole("button", { name: "Agents" }));expect(screen.queryByRole("region", { name: "Maria runs" })).toBeNull();- expect(screen.getByRole("region", { name: "Your agents" })).toBeDefined();+ expect(+ screen.getByRole("region", { name: "Your workflows" }),+ ).toBeDefined();await user.click(screen.getByRole("button", { name: "Members" }));expect(screen.getByRole("region", { name: "Maria runs" })).toBeDefined();- expect(screen.queryByRole("region", { name: "Your agents" })).toBeNull();+ expect(screen.queryByRole("region", { name: "Your workflows" })).toBeNull();});test("keeps only workflows with actual jobs when Scheduled is active", async () => {@@ -1547,7 +1559,9 @@ describe("TeamPage", () => {render(<TeamPage />);- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });await user.click(within(agents).getByRole("button", { name: "Adopt" }));await waitFor(() =>@@ -1574,7 +1588,9 @@ describe("TeamPage", () => {render(<TeamPage />);- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });await user.click(within(agents).getByRole("button", { name: "Adopt" }));await waitFor(() =>@@ -1615,7 +1631,9 @@ describe("TeamPage", () => {render(<TeamPage />);- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });const rows = within(agents).getAllByTestId("what-runs-agent-row");const firstAdopt = within(rows[0]).getByRole("button", { name: "Adopt" });const secondAdopt = within(rows[1]).getByRole("button", { name: "Adopt" });@@ -1642,7 +1660,7 @@ describe("TeamPage", () => {render(<TeamPage />);expect(- await screen.findByText(/could not load your agents/i),+ await screen.findByText(/could not load your workflows/i),).toBeDefined();server.use(@@ -1652,7 +1670,9 @@ describe("TeamPage", () => {);await user.click(screen.getByRole("button", { name: "Retry" }));- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });expect(within(agents).getByText("Research Assistant")).toBeDefined();});@@ -1677,9 +1697,11 @@ describe("TeamPage", () => {render(<TeamPage />);- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });expect(- await within(agents).findByText("No available agents to adopt."),+ await within(agents).findByText("No available workflows to adopt."),).toBeDefined();});@@ -1708,13 +1730,15 @@ describe("TeamPage", () => {render(<TeamPage />);- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });expect(within(agents).getByText("Research Assistant")).toBeDefined();expect(within(agents).queryByText("Second-page Agent")).toBeNull();expect(requestedPages).toEqual(["1"]);await user.click(- within(agents).getByRole("button", { name: "Load more agents" }),+ within(agents).getByRole("button", { name: "Load more workflows" }),);expect(await within(agents).findByText("Second-page Agent")).toBeDefined();@@ -1738,12 +1762,14 @@ describe("TeamPage", () => {render(<TeamPage />);- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });expect(- within(agents).queryByText("Every agent is already on your team."),+ within(agents).queryByText("Every workflow is already on your team."),).toBeNull();expect(- within(agents).getByRole("button", { name: "Load more agents" }),+ within(agents).getByRole("button", { name: "Load more workflows" }),).toBeDefined();});@@ -1773,14 +1799,16 @@ describe("TeamPage", () => {render(<TeamPage />);- const agents = await screen.findByRole("region", { name: "Your agents" });+ const agents = await screen.findByRole("region", {+ name: "Your workflows",+ });expect(within(agents).getByText("Research Assistant")).toBeDefined();await user.click(- within(agents).getByRole("button", { name: "Load more agents" }),+ within(agents).getByRole("button", { name: "Load more workflows" }),);expect(- await within(agents).findByText("We could not load more agents."),+ await within(agents).findByText("We could not load more workflows."),).toBeDefined();expect(within(agents).getByText("Research Assistant")).toBeDefined();diff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/WhatRunsZone/WhatRunsZone.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/WhatRunsZone/WhatRunsZone.tsxindex c70d7da46b..801ab058e9 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/WhatRunsZone/WhatRunsZone.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/WhatRunsZone/WhatRunsZone.tsx@@ -50,12 +50,9 @@ export function WhatRunsZone({ experts, schedules }: Props) {const groupEmptyMessage = GROUP_EMPTY_MESSAGES[filter];return (- <section aria-label="What runs" className="flex flex-col gap-4">- <div className={cn("flex flex-col gap-1", SECTION_INSET_CLASS)}>- <Text variant="h3">What runs</Text>- <Text variant="body" className="max-w-prose text-zinc-600">- Workflows installed on your experts, plus agents you can adopt.- </Text>+ <section aria-label="What runs" className="!mt-10 flex flex-col gap-4">+ <div className={cn("border-b border-zinc-100 pb-4", SECTION_INSET_CLASS)}>+ <Text variant="h4">What runs</Text></div><div className={SECTION_INSET_CLASS}>@@ -67,10 +64,10 @@ export function WhatRunsZone({ experts, schedules }: Props) {instantly. Neither child holds state, so the remount costs nothing. */}<divkey={filter}- className="flex flex-col gap-4 duration-300 animate-in fade-in slide-in-from-bottom-2 motion-reduce:animate-none"+ className="flex flex-col gap-6 duration-300 animate-in fade-in slide-in-from-bottom-2 motion-reduce:animate-none">{groups.length > 0 ? (- <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-4">{groups.map((group) => (<ExpertWorkflowGroup key={group.expert.id} group={group} />))}@@ -87,7 +84,7 @@ export function WhatRunsZone({ experts, schedules }: Props) {) : isErrorAgents ? (<div className="flex items-center justify-between gap-3 rounded-2xl border border-zinc-200 bg-white px-4 py-3"><Text variant="small" className="text-zinc-500">- We could not load your agents.+ We could not load your workflows.</Text><Button variant="secondary" size="small" onClick={retryAgents}>Retrydiff --git a/autogpt_platform/frontend/src/app/(platform)/team/components/WhatRunsZone/components/YourAgentsList.tsx b/autogpt_platform/frontend/src/app/(platform)/team/components/WhatRunsZone/components/YourAgentsList.tsxindex f6eeea0d7c..0d5e8b8ea6 100644--- a/autogpt_platform/frontend/src/app/(platform)/team/components/WhatRunsZone/components/YourAgentsList.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/team/components/WhatRunsZone/components/YourAgentsList.tsx@@ -39,16 +39,16 @@ export function YourAgentsList({onAdopt,}: Props) {return (- <section aria-label="Your agents" className="flex flex-col gap-2">- <Text variant="small-medium" className="text-zinc-500">- Your agents- </Text>+ <section aria-label="Your workflows" className="!mt-8 flex flex-col gap-2">+ <div className="mb-4 border-b border-zinc-100 pb-4">+ <Text variant="h4">Your workflows</Text>+ </div>{agents.length === 0 ? (!hasMoreAgents ? (<Text variant="small" className="text-zinc-500">{libraryAgentCount === 0- ? "No available agents to adopt."- : "Every agent is already on your team."}+ ? "No available workflows to adopt."+ : "Every workflow is already on your team."}</Text>) : null) : (@@ -114,7 +114,7 @@ export function YourAgentsList({{isErrorLoadingMoreAgents ? (<div className="flex items-center justify-between gap-3 rounded-xl border border-zinc-200 px-3 py-2"><Text variant="small" className="text-zinc-500">- We could not load more agents.+ We could not load more workflows.</Text><Button variant="secondary" size="small" onClick={onLoadMore}>Retry loading more@@ -128,7 +128,7 @@ export function YourAgentsList({onClick={onLoadMore}className="self-start">- Load more agents+ Load more workflows</Button>) : null}</section>