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): colour Home's work chips and show workflow pictures (#14408)
Ubbe4109de474f92
diff --git a/autogpt_platform/backend/backend/api/features/home/activity.py b/autogpt_platform/backend/backend/api/features/home/activity.pyindex 65eb7caa36..8839d15af1 100644--- a/autogpt_platform/backend/backend/api/features/home/activity.py+++ b/autogpt_platform/backend/backend/api/features/home/activity.py@@ -15,6 +15,7 @@ def compose_active_tasks(executions: list[GraphExecutionMeta],expert_by_id: dict[str, Expert],agent_by_graph: dict[str, AgentRef],+ expert_by_graph: dict[str, Expert] | None = None,) -> list[HomeActiveTask]:active = [execution@@ -22,7 +23,7 @@ def compose_active_tasks(if execution.status in {ExecutionStatus.RUNNING, ExecutionStatus.QUEUED}]return [- _active_task(execution, expert_by_id, agent_by_graph)+ _active_task(execution, expert_by_id, agent_by_graph, expert_by_graph or {})for execution in active[:_MAX_ACTIVE]]@@ -31,17 +32,20 @@ def _active_task(execution: GraphExecutionMeta,expert_by_id: dict[str, Expert],agent_by_graph: dict[str, AgentRef],+ expert_by_graph: dict[str, Expert],) -> HomeActiveTask:agent = agent_by_graph.get(execution.graph_id, UNKNOWN_AGENT)+ # A run started by hand from the library carries no expert stamp, so the+ # expert that owns the workflow stands in for it.+ expert = expert_by_id.get(execution.expert_id or "") or expert_by_graph.get(+ execution.graph_id+ )return HomeActiveTask(id=execution.id,title=agent.name,status="running" if execution.status == ExecutionStatus.RUNNING else "queued",- expert=(- to_home_expert(expert_by_id[execution.expert_id])- if execution.expert_id in expert_by_id- else None- ),+ expert=to_home_expert(expert) if expert else None,+ image_url=agent.image_url,started_at=as_utc_or_none(execution.started_at),link=run_link(agent.library_agent_id, execution.id),)@@ -50,6 +54,7 @@ def _active_task(def compose_upcoming_tasks(schedules: list[GraphExecutionJobInfo | CopilotTurnJobInfo],expert_by_schedule: dict[str, Expert],+ agent_by_graph: dict[str, AgentRef] | None = None,) -> list[HomeUpcomingTask]:upcoming = []for schedule in schedules:@@ -58,12 +63,14 @@ def compose_upcoming_tasks(continueif isinstance(schedule, GraphExecutionJobInfo):expert = expert_by_schedule.get(schedule.id)+ agent = (agent_by_graph or {}).get(schedule.graph_id)upcoming.append(HomeUpcomingTask(id=schedule.id,title=schedule.agent_name or schedule.name,kind="agent",expert=to_home_expert(expert) if expert else None,+ image_url=agent.image_url if agent else None,next_run_time=next_run,))diff --git a/autogpt_platform/backend/backend/api/features/home/activity_test.py b/autogpt_platform/backend/backend/api/features/home/activity_test.pyindex 42cb17bebe..cd6ff1eb51 100644--- a/autogpt_platform/backend/backend/api/features/home/activity_test.py+++ b/autogpt_platform/backend/backend/api/features/home/activity_test.py@@ -1,5 +1,6 @@from datetime import date, datetime, timedelta, timezone+from backend.api.features.experts.models import Expert, ExpertWorkflowReffrom backend.data.execution import ExecutionStatus, GraphExecutionMetafrom backend.data.execution_cost_summary import UserDailyCost, UserExecutionCostSummaryfrom backend.executor.scheduler import CopilotTurnJobInfo, GraphExecutionJobInfo@@ -8,7 +9,43 @@ from .activity import compose_active_tasks, compose_upcoming_tasks, compose_weekfrom .helpers import AgentRefNOW = datetime(2026, 8, 10, 9, 0, tzinfo=timezone.utc)-TRIAGE = {"graph": AgentRef(name="Inbox triage", library_agent_id="library-agent")}+TRIAGE = {+ "graph": AgentRef(+ name="Inbox triage",+ library_agent_id="library-agent",+ image_url="https://example.com/triage.png",+ )+}+++def _expert(expert_id: str) -> Expert:+ return Expert(+ id=expert_id,+ name=f"Expert {expert_id}",+ avatar_url=None,+ role="Assistant",+ tagline=None,+ bio=None,+ skills=[],+ identity="",+ voice_preferences="",+ boundaries="",+ protected_soul_rules=[],+ is_template=False,+ source_template_id=None,+ is_archived=False,+ workflows=[+ ExpertWorkflowRef(+ id=f"workflow-{expert_id}",+ store_listing_version_id=None,+ library_agent_id=None,+ graph_id="graph",+ name="Inbox triage",+ description=None,+ schedule_id=None,+ )+ ],+ )def _execution(@@ -105,6 +142,30 @@ def test_active_tasks_map_status_and_cap_the_list() -> None:)+def test_active_task_shows_the_workflow_picture() -> None:+ tasks = compose_active_tasks(+ [_execution(exec_id="run", status=ExecutionStatus.RUNNING, ended_at=NOW)],+ {},+ TRIAGE,+ )++ assert tasks[0].image_url == "https://example.com/triage.png"+++def test_active_task_names_the_expert_that_owns_the_workflow() -> None:+ expert = _expert("alice")++ tasks = compose_active_tasks(+ [_execution(exec_id="run", status=ExecutionStatus.RUNNING, ended_at=NOW)],+ {},+ TRIAGE,+ {"graph": expert},+ )++ assert tasks[0].expert is not None+ assert tasks[0].expert.id == "alice"++def test_active_task_falls_back_when_the_graph_is_unknown() -> None:tasks = compose_active_tasks([_execution(exec_id="run", status=ExecutionStatus.RUNNING, ended_at=NOW)],@@ -160,6 +221,14 @@ def test_upcoming_tasks_sort_by_next_run_and_cap_the_list() -> None:assert tasks[2].title == "Follow up on the invoice"+def test_upcoming_tasks_show_the_workflow_picture() -> None:+ tasks = compose_upcoming_tasks(+ [_graph_job("early", "2026-08-10T09:00:00Z")], {}, TRIAGE+ )++ assert tasks[0].image_url == "https://example.com/triage.png"++def test_upcoming_tasks_skip_unparseable_next_run_times() -> None:tasks = compose_upcoming_tasks([diff --git a/autogpt_platform/backend/backend/api/features/home/compose.py b/autogpt_platform/backend/backend/api/features/home/compose.pyindex fcd431c70b..556b95318e 100644--- a/autogpt_platform/backend/backend/api/features/home/compose.py+++ b/autogpt_platform/backend/backend/api/features/home/compose.py@@ -14,7 +14,12 @@ from .activity import compose_active_tasks, compose_upcoming_tasks, compose_weekfrom .agents import compose_agent_statuses, compose_team_summaryfrom .attention import compose_attention_itemsfrom .briefing import compose_briefing-from .helpers import agent_refs_by_graph, experts_by_schedule, next_runs_by_expert+from .helpers import (+ agent_refs_by_graph,+ experts_by_graph,+ experts_by_schedule,+ next_runs_by_expert,+)from .models import HomeDashboardResponsefrom .recent_work import compose_recent_work@@ -81,8 +86,12 @@ def compose_home_dashboard(agent_by_graph=agent_by_graph,persisted=persisted_briefing,),- active_tasks=compose_active_tasks(executions, expert_by_id, agent_by_graph),- upcoming_tasks=compose_upcoming_tasks(schedules, expert_by_schedule),+ active_tasks=compose_active_tasks(+ executions, expert_by_id, agent_by_graph, experts_by_graph(hired)+ ),+ upcoming_tasks=compose_upcoming_tasks(+ schedules, expert_by_schedule, agent_by_graph+ ),team=compose_team_summary(agents),agents=agents,week=compose_week_summary(cost_summary, credits_balance),diff --git a/autogpt_platform/backend/backend/api/features/home/helpers.py b/autogpt_platform/backend/backend/api/features/home/helpers.pyindex f71cd5acca..118448e6a2 100644--- a/autogpt_platform/backend/backend/api/features/home/helpers.py+++ b/autogpt_platform/backend/backend/api/features/home/helpers.py@@ -1,3 +1,4 @@+from collections import defaultdictfrom datetime import datetimefrom pydantic import BaseModel, ConfigDict@@ -43,6 +44,27 @@ def experts_by_schedule(return {schedule_id: expert for schedule_id, expert in owners.items() if expert}+def experts_by_graph(experts: list[Expert]) -> dict[str, Expert]:+ """Map graph id to the expert that owns a workflow built on it.++ A run started from the library carries no expert stamp, but the workflow+ it ran is still an expert's, so the surfaces that show who is working can+ fall back to the owner instead of showing nobody. Two experts can build on+ the same graph, and picking one of them would put the wrong face on the+ run, so a shared graph is left unattributed.+ """+ owners: defaultdict[str, dict[str, Expert]] = defaultdict(dict)+ for expert in experts:+ for workflow in expert.workflows:+ if workflow.graph_id:+ owners[workflow.graph_id][expert.id] = expert+ return {+ graph_id: next(iter(by_expert_id.values()))+ for graph_id, by_expert_id in owners.items()+ if len(by_expert_id) == 1+ }++def next_runs_by_expert(schedules: list[GraphExecutionJobInfo], expert_by_schedule: dict[str, Expert]) -> dict[str, datetime]:@@ -64,6 +86,7 @@ class AgentRef(BaseModel):name: strlibrary_agent_id: str | None+ image_url: str | None = NoneUNKNOWN_AGENT = AgentRef(name=DEFAULT_AGENT_NAME, library_agent_id=None)@@ -76,6 +99,7 @@ def agent_refs_by_graph(ref.graph_id: AgentRef(name=ref.name or UNKNOWN_AGENT.name,library_agent_id=None if ref.is_deleted else ref.id,+ image_url=ref.image_url,)for ref in refs}@@ -83,10 +107,13 @@ def agent_refs_by_graph(for workflow in expert.workflows:if workflow.graph_id:current = agents.get(workflow.graph_id, UNKNOWN_AGENT)+ # An expert names its own copy of the workflow, but only the+ # library row carries the picture, so keep the one we found.agents[workflow.graph_id] = AgentRef(name=workflow.name or current.name,library_agent_id=workflow.library_agent_idor current.library_agent_id,+ image_url=current.image_url,)return agentsdiff --git a/autogpt_platform/backend/backend/api/features/home/helpers_test.py b/autogpt_platform/backend/backend/api/features/home/helpers_test.pyindex bbdeed67a1..8cfcd9d9c0 100644--- a/autogpt_platform/backend/backend/api/features/home/helpers_test.py+++ b/autogpt_platform/backend/backend/api/features/home/helpers_test.py@@ -7,6 +7,7 @@ from backend.executor.scheduler import GraphExecutionJobInfofrom .activity import compose_upcoming_tasksfrom .helpers import (agent_refs_by_graph,+ experts_by_graph,experts_by_schedule,next_runs_by_expert,parse_datetime,@@ -119,6 +120,40 @@ def test_upcoming_tasks_attribute_each_job_to_its_own_expert() -> None:]+def test_expert_workflows_are_found_by_the_graph_they_run() -> None:+ owners = experts_by_graph([_expert("alice")])++ assert owners[SHARED_GRAPH].id == "alice"+++def test_a_graph_two_experts_build_on_is_left_unattributed() -> None:+ assert experts_by_graph([_expert("alice"), _expert("bob")]) == {}+++def test_an_expert_with_two_workflows_on_one_graph_still_owns_it() -> None:+ alice = _expert("alice")+ alice.workflows.append(+ alice.workflows[0].model_copy(update={"id": "workflow-alice-2"})+ )++ assert experts_by_graph([alice])[SHARED_GRAPH].id == "alice"+++def test_an_experts_copy_of_a_workflow_keeps_the_library_picture() -> None:+ refs = [+ LibraryAgentRef(+ id="lib-live",+ graph_id=SHARED_GRAPH,+ name="Inbox triage",+ image_url="https://example.com/triage.png",+ )+ ]++ agents = agent_refs_by_graph([_expert("alice")], refs)++ assert agents[SHARED_GRAPH].image_url == "https://example.com/triage.png"++def test_parse_datetime_pins_naive_values_to_utc() -> None:assert parse_datetime("2026-08-10T09:00:00") == datetime(2026, 8, 10, 9, 0, tzinfo=timezone.utcdiff --git a/autogpt_platform/backend/backend/api/features/home/models.py b/autogpt_platform/backend/backend/api/features/home/models.pyindex 2286c5b239..cd77a96d39 100644--- a/autogpt_platform/backend/backend/api/features/home/models.py+++ b/autogpt_platform/backend/backend/api/features/home/models.py@@ -72,6 +72,8 @@ class HomeActiveTask(BaseModel):title: strstatus: Literal["running", "queued"]expert: HomeExpert | None = None+ # The workflow's own picture, shown when no expert owns the run.+ image_url: str | None = Nonestarted_at: datetime | None = Nonelink: str | None = None@@ -81,6 +83,8 @@ class HomeUpcomingTask(BaseModel):title: strkind: Literal["agent", "followup"]expert: HomeExpert | None = None+ # The workflow's own picture, shown when no expert owns the schedule.+ image_url: str | None = Nonenext_run_time: datetime@@ -131,6 +135,8 @@ class HomeWorkActor(BaseModel):kind: Literal["expert", "workflow", "autopilot"]name: strexpert: HomeExpert | None = None+ # A workflow has no avatar of its own, so its library picture stands in.+ image_url: str | None = Nonelink: str | None = Nonediff --git a/autogpt_platform/backend/backend/api/features/home/recent_work.py b/autogpt_platform/backend/backend/api/features/home/recent_work.pyindex 47165ed4b2..3baed3b7b3 100644--- a/autogpt_platform/backend/backend/api/features/home/recent_work.py+++ b/autogpt_platform/backend/backend/api/features/home/recent_work.py@@ -167,6 +167,7 @@ def _actor(return HomeWorkActor(kind="workflow",name=agent.name,+ image_url=agent.image_url,link=(f"/library/agents/{agent.library_agent_id}"if agent.library_agent_iddiff --git a/autogpt_platform/backend/backend/api/features/home/recent_work_test.py b/autogpt_platform/backend/backend/api/features/home/recent_work_test.pyindex 0a03cacb6d..6f7058a855 100644--- a/autogpt_platform/backend/backend/api/features/home/recent_work_test.py+++ b/autogpt_platform/backend/backend/api/features/home/recent_work_test.py@@ -9,7 +9,11 @@ from .recent_work import _MAX_ITEMS_PER_GROUP, _MAX_RUNS_PER_GROUP, compose_receNOW = datetime(2026, 8, 28, 9, 0, tzinfo=timezone.utc)AGENTS = {- "graph-notes": AgentRef(name="Release Note Generator", library_agent_id="lib-1")+ "graph-notes": AgentRef(+ name="Release Note Generator",+ library_agent_id="lib-1",+ image_url="https://example.com/release-notes.png",+ )}@@ -145,6 +149,7 @@ def test_groups_runs_and_deliverables_under_the_actor_that_did_them() -> None:assert maria_group.items[0].link == "/copilot?sessionId=s1"assert notes_group.actor.kind == "workflow"+ assert notes_group.actor.image_url == "https://example.com/release-notes.png"assert notes_group.actor.link == "/library/agents/lib-1"assert [run.id for run in notes_group.runs] == ["run-notes"]assert [item.id for item in notes_group.items] == ["e2"]diff --git a/autogpt_platform/backend/backend/api/features/library/db.py b/autogpt_platform/backend/backend/api/features/library/db.pyindex 8cf476c1cb..39da27923a 100644--- a/autogpt_platform/backend/backend/api/features/library/db.py+++ b/autogpt_platform/backend/backend/api/features/library/db.py@@ -484,6 +484,7 @@ async def get_library_agent_refs_by_graph_ids(id=agent.id,graph_id=agent.agentGraphId,name=agent.name or "",+ image_url=agent.imageUrl,is_deleted=agent.isDeleted,)for agent in agentsdiff --git a/autogpt_platform/backend/backend/api/features/library/model.py b/autogpt_platform/backend/backend/api/features/library/model.pyindex 143f210d08..b306abea87 100644--- a/autogpt_platform/backend/backend/api/features/library/model.py+++ b/autogpt_platform/backend/backend/api/features/library/model.py@@ -143,6 +143,9 @@ class LibraryAgentRef(pydantic.BaseModel):id: strgraph_id: strname: str+ # The agent's own picture, so a surface listing runs can show the agent+ # instead of a generic glyph.+ image_url: str | None = None# A removed agent still names its past runs; it just cannot be linked.is_deleted: bool = Falsediff --git a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsxindex 6fdb628f63..76d61d3246 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/main.test.tsx@@ -6,7 +6,12 @@ import type { HomeAttentionItem } from "@/app/api/__generated__/models/homeAttenimport type { HomeBriefingOutcome } from "@/app/api/__generated__/models/homeBriefingOutcome";import type { HomeDashboardResponse } from "@/app/api/__generated__/models/homeDashboardResponse";import { server } from "@/mocks/mock-server";-import { render, screen, waitFor } from "@/tests/integrations/test-utils";+import {+ render,+ screen,+ waitFor,+ within,+} from "@/tests/integrations/test-utils";import HomePage from "../page";const { setFlagStatusMock } = vi.hoisted(() => ({@@ -228,6 +233,35 @@ test("renders every Home tile from the aggregate API", async () => {expect(screen.getByText("Spanish practice plan")).toBeDefined();});+test("says which workflow is running now and shows its picture", async () => {+ mockDashboard({+ ...dashboard,+ active_tasks: [+ {+ id: "active-2",+ title: "Tell me a fact!",+ status: "running",+ image_url: "https://example.com/tell-me-a-fact.png",+ started_at: new Date("2026-08-09T11:52:00Z"),+ link: "/library",+ },+ ],+ upcoming_tasks: [],+ });++ render(<HomePage />);++ const tile = await screen.findByRole("region", { name: "Now & next" });+ expect(within(tile).getByText("Tell me a fact!")).toBeDefined();+ expect(within(tile).getByText("workflow")).toBeDefined();+ const picture = await within(tile).findByRole("img", {+ name: "Tell me a fact!",+ });+ expect(picture.getAttribute("src")).toBe(+ "https://example.com/tell-me-a-fact.png",+ );+});+test("shows weekly spend per agent and on the team line", async () => {mockDashboard({...dashboard,diff --git a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsxindex c625661dd9..ad9c376902 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/__tests__/recent-work.test.tsx@@ -114,6 +114,7 @@ const recentWork: HomeRecentWork = {actor: {kind: "workflow",name: "Release Note Generator",+ image_url: "https://example.com/release-notes.png",link: "/library/agents/lib-1",},latest_at: NOW,@@ -258,7 +259,7 @@ test("groups the week's runs and deliverables by who did them", async () => {).toBeDefined();});-test("puts the team first and workflows in their own section below", async () => {+test("puts the team first and the workflows that ran on their own after them", async () => {mockDashboard(dashboard);render(<HomePage />);@@ -271,22 +272,27 @@ test("puts the team first and workflows in their own section below", async () =>.getAllByRole("article").map((article) => article.getAttribute("aria-label")),).toEqual(["Maria", "Autopilot", "Release Note Generator"]);+ // The kind chip says which half a group belongs to, so the rows run+ // straight on without a caption between them.+ expect(within(tile).queryByText("Workflows")).toBeNull();+});++test("marks a workflow group with its own picture and kind", async () => {+ mockDashboard(dashboard);- const label = within(tile).getByText("Workflows");- const autopilotGroup = within(tile).getByRole("article", {- name: "Autopilot",+ render(<HomePage />);++ await screen.findByRole("heading", { name: "Recent work" });+ const workflowGroup = screen.getByRole("article", {+ name: "Release Note Generator",});- const workflowGroup = within(tile).getByRole("article", {+ expect(within(workflowGroup).getByText("Workflow")).toBeDefined();+ const picture = await within(workflowGroup).findByRole("img", {name: "Release Note Generator",});- expect(- autopilotGroup.compareDocumentPosition(label) &- Node.DOCUMENT_POSITION_FOLLOWING,- ).toBeTruthy();- expect(- label.compareDocumentPosition(workflowGroup) &- Node.DOCUMENT_POSITION_FOLLOWING,- ).toBeTruthy();+ expect(picture.getAttribute("src")).toBe(+ "https://example.com/release-notes.png",+ );});test("links each actor to its home and thread work to its session", async () => {diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/NowNext/components/ActiveRow.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/NowNext/components/ActiveRow.tsxindex 61db320824..16222eb1a4 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/components/NowNext/components/ActiveRow.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/NowNext/components/ActiveRow.tsx@@ -2,6 +2,7 @@ import Link from "next/link";import type { HomeActiveTask } from "@/app/api/__generated__/models/homeActiveTask";import { Text } from "@/components/atoms/Text/Text";import { ExpertAvatar } from "@/components/molecules/ExpertAvatar/ExpertAvatar";+import { WorkflowAvatar } from "@/components/molecules/WorkflowAvatar/WorkflowAvatar";import { cn } from "@/lib/utils";import { formatRunningFor } from "../helpers";@@ -22,7 +23,11 @@ export function ActiveRow({ item }: Props) {size={36}/>) : (- <span className="size-2.5 rounded-full bg-primary" />+ <WorkflowAvatar+ name={item.title}+ imageUrl={item.image_url}+ size={36}+ />)}</span><div className="min-w-0 flex-1">@@ -31,7 +36,8 @@ export function ActiveRow({ item }: Props) {tone="primary"className="truncate leading-5">- {item.title}+ <span>{item.title}</span>+ <span className="font-normal text-zinc-500"> workflow</span></Text><Text variant="small" tone="muted" className="truncate">{item.status === "queued"diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/NowNext/components/UpcomingRow.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/NowNext/components/UpcomingRow.tsxindex eb32c78d03..5748a2e9be 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/components/NowNext/components/UpcomingRow.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/NowNext/components/UpcomingRow.tsx@@ -1,8 +1,9 @@-import { Calendar03Icon, Clock01Icon } from "@hugeicons/core-free-icons";+import { Calendar03Icon } from "@hugeicons/core-free-icons";import type { HomeUpcomingTask } from "@/app/api/__generated__/models/homeUpcomingTask";import { Icon } from "@/components/atoms/Icon/Icon";import { Text } from "@/components/atoms/Text/Text";import { ExpertAvatar } from "@/components/molecules/ExpertAvatar/ExpertAvatar";+import { WorkflowAvatar } from "@/components/molecules/WorkflowAvatar/WorkflowAvatar";import { formatUntil } from "../helpers";interface Props {@@ -12,24 +13,8 @@ interface Props {export function UpcomingRow({ item }: Props) {return (<div className="relative flex items-center gap-3 py-2 pl-[3.75rem] pr-4">- {/* The expert who will do the work is the marker; the glyph only- stands in when no expert owns the task. */}<span className="absolute left-4 top-1/2 z-10 flex size-9 -translate-y-1/2 items-center justify-center rounded-full bg-white">- {item.expert ? (- <ExpertAvatar- name={item.expert.name}- avatarUrl={item.expert.avatar_url}- size={36}- />- ) : (- <span className="flex size-9 items-center justify-center rounded-full bg-zinc-100 text-zinc-500 ring-2 ring-white">- <Icon- icon={item.kind === "followup" ? Calendar03Icon : Clock01Icon}- size={15}- aria-hidden="true"- />- </span>- )}+ <TaskMarker item={item} /></span><div className="min-w-0 flex-1"><Text@@ -37,7 +22,10 @@ export function UpcomingRow({ item }: Props) {tone="primary"className="truncate leading-5">- {item.title}+ <span>{item.title}</span>+ {item.kind === "agent" ? (+ <span className="font-normal text-zinc-500"> workflow</span>+ ) : null}</Text><Text variant="body" tone="muted" className="truncate">{item.expert?.name ??@@ -51,3 +39,27 @@ export function UpcomingRow({ item }: Props) {</div>);}++/** The expert who will do the work is the marker; a workflow shows its own+ * picture, and the glyph only stands in for a follow-up. */+function TaskMarker({ item }: Props) {+ if (item.expert) {+ return (+ <ExpertAvatar+ name={item.expert.name}+ avatarUrl={item.expert.avatar_url}+ size={36}+ />+ );+ }+ if (item.kind === "agent") {+ return (+ <WorkflowAvatar name={item.title} imageUrl={item.image_url} size={36} />+ );+ }+ return (+ <span className="flex size-9 items-center justify-center rounded-full bg-zinc-100 text-zinc-500 ring-2 ring-white">+ <Icon icon={Calendar03Icon} size={15} aria-hidden="true" />+ </span>+ );+}diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/RecentWork.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/RecentWork.tsxindex a7b1f67657..b3de8ad098 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/RecentWork.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/RecentWork.tsx@@ -4,7 +4,6 @@ import { WorkHistoryIcon } from "@hugeicons/core-free-icons";import type { HomeDashboardResponse } from "@/app/api/__generated__/models/homeDashboardResponse";import type { HomeRecentWorkGroup } from "@/app/api/__generated__/models/homeRecentWorkGroup";import { Text } from "@/components/atoms/Text/Text";-import { HomeSectionLabel } from "../HomeSectionLabel/HomeSectionLabel";import { HomeTile } from "../HomeTile/HomeTile";import { HomeTileEmpty } from "../HomeTileEmpty/HomeTileEmpty";import { WorkGroup } from "./components/WorkGroup";@@ -16,8 +15,7 @@ interface Props {}/** One card for what the agents did this week: the team (each expert and- * Autopilot) first, then the workflows that ran on their own in a section- * of their own below. */+ * Autopilot) first, then the workflows that ran on their own. */export function RecentWork({ dashboard, className }: Props) {const { briefing } = dashboard;const groups = dashboard.recent_work?.groups ?? [];@@ -75,27 +73,13 @@ export function RecentWork({ dashboard, className }: Props) {{briefing.narrative}</Text>) : null}- {team.map((group) => (+ {[...team, ...workflows].map((group) => (<WorkGroupkey={groupKey(group)}group={group}timezone={dashboard.timezone}/>))}- {workflows.length > 0 ? (- <div className="pt-2">- <HomeSectionLabel>Workflows</HomeSectionLabel>- <div className="divide-y divide-zinc-200 border-t border-zinc-200">- {workflows.map((group) => (- <WorkGroup- key={groupKey(group)}- group={group}- timezone={dashboard.timezone}- />- ))}- </div>- </div>- ) : null}</div>)}</HomeTile>diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/ActorMark.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/ActorMark.tsxindex 6d1e57195a..737c92bf6e 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/ActorMark.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/ActorMark.tsx@@ -1,6 +1,7 @@import type { HomeWorkActor } from "@/app/api/__generated__/models/homeWorkActor";import { Icon } from "@/components/atoms/Icon/Icon";import { ExpertAvatar } from "@/components/molecules/ExpertAvatar/ExpertAvatar";+import { WorkflowAvatar } from "@/components/molecules/WorkflowAvatar/WorkflowAvatar";import { getActorIcon } from "../helpers";interface Props {@@ -17,6 +18,11 @@ export function ActorMark({ actor }: Props) {/>);}+ if (actor.kind === "workflow") {+ return (+ <WorkflowAvatar name={actor.name} imageUrl={actor.image_url} size={18} />+ );+ }return (<span className="flex size-[18px] shrink-0 items-center justify-center rounded-full bg-zinc-100 text-zinc-500"><Icon icon={getActorIcon(actor.kind)} size={11} aria-hidden="true" />diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/WorkGroup.tsx b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/WorkGroup.tsxindex c480a5808d..66e4546337 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/WorkGroup.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/components/WorkGroup.tsx@@ -3,7 +3,8 @@ import Link from "next/link";import type { HomeRecentWorkGroup } from "@/app/api/__generated__/models/homeRecentWorkGroup";import { Icon } from "@/components/atoms/Icon/Icon";import { Text } from "@/components/atoms/Text/Text";-import { formatGroupCounts, getActorKindLabel } from "../helpers";+import { cn } from "@/lib/utils";+import { formatGroupCounts, getActorChip } from "../helpers";import { ActorMark } from "./ActorMark";import { OutcomeRow } from "./OutcomeRow";import { WorkItemRow } from "./WorkItemRow";@@ -15,6 +16,7 @@ interface Props {export function WorkGroup({ group, timezone }: Props) {const { actor } = group;+ const chip = getActorChip(actor.kind);const runs = group.runs ?? [];const items = group.items ?? [];const header = (@@ -26,10 +28,12 @@ export function WorkGroup({ group, timezone }: Props) {<Textvariant="small-medium"as="span"- tone="muted"- className="shrink-0 rounded-full border border-zinc-200 bg-white px-1.5 uppercase leading-4 tracking-[0.04em]"+ className={cn(+ "shrink-0 rounded-full border px-1.5 uppercase leading-4 tracking-[0.04em]",+ chip.className,+ )}>- {getActorKindLabel(actor.kind)}+ {chip.label}</Text><Textvariant="small"@@ -52,7 +56,7 @@ export function WorkGroup({ group, timezone }: Props) {return (<article aria-label={actor.name}>- <div className="bg-zinc-50/80 px-4 py-2">+ <div className="bg-zinc-100/80 px-4 py-2">{actor.link ? (<Linkhref={actor.link}diff --git a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/helpers.tsindex a64a7b105f..47b20ee2e1 100644--- a/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/helpers.ts+++ b/autogpt_platform/frontend/src/app/(platform)/home/components/RecentWork/helpers.ts@@ -1,6 +1,5 @@import {File01Icon,- FlowIcon,PlugIcon,RepeatIcon,Robot01Icon,@@ -21,7 +20,6 @@ export function getWorkItemIcon(}export function getActorIcon(kind: HomeWorkActorKind): IconSvgElement {- if (kind === "workflow") return FlowIcon;if (kind === "autopilot") return SparklesIcon;return Robot01Icon;}@@ -42,10 +40,29 @@ export function getRunTriggerLabel(return "Manual run";}-export function getActorKindLabel(kind: HomeWorkActorKind): string {- if (kind === "workflow") return "Workflow";- if (kind === "autopilot") return "Autopilot";- return "Expert";+type ActorChip = { label: string; className: string };++// The chip is the fastest way to tell the two halves of the card apart, so+// each kind gets its own colour and a matching glow.+const ACTOR_CHIPS: Record<HomeWorkActorKind, ActorChip> = {+ expert: {+ label: "Expert",+ className:+ "border-blue-200 bg-blue-50 text-blue-700 shadow-[0_0_8px_-1px_rgba(96,165,250,0.7)]",+ },+ workflow: {+ label: "Workflow",+ className:+ "border-yellow-200 bg-yellow-50 text-yellow-700 shadow-[0_0_8px_-1px_rgba(247,205,51,0.9)]",+ },+ autopilot: {+ label: "Autopilot",+ className: "border-zinc-200 bg-white text-zinc-500",+ },+};++export function getActorChip(kind: HomeWorkActorKind): ActorChip {+ return ACTOR_CHIPS[kind] ?? ACTOR_CHIPS.autopilot;}// The feed spans a week, so the weekday is load-bearing: "Mon 10:45" vsdiff --git a/autogpt_platform/frontend/src/app/api/openapi.json b/autogpt_platform/frontend/src/app/api/openapi.jsonindex 6eaebb8a8d..842cc239ea 100644--- a/autogpt_platform/frontend/src/app/api/openapi.json+++ b/autogpt_platform/frontend/src/app/api/openapi.json@@ -21598,6 +21598,10 @@{ "type": "null" }]},+ "image_url": {+ "anyOf": [{ "type": "string" }, { "type": "null" }],+ "title": "Image Url"+ },"started_at": {"anyOf": [{ "type": "string", "format": "date-time" },@@ -22014,6 +22018,10 @@{ "type": "null" }]},+ "image_url": {+ "anyOf": [{ "type": "string" }, { "type": "null" }],+ "title": "Image Url"+ },"next_run_time": {"type": "string","format": "date-time",@@ -22077,6 +22085,10 @@{ "type": "null" }]},+ "image_url": {+ "anyOf": [{ "type": "string" }, { "type": "null" }],+ "title": "Image Url"+ },"link": {"anyOf": [{ "type": "string" }, { "type": "null" }],"title": "Link"diff --git a/autogpt_platform/frontend/src/components/molecules/WorkflowAvatar/WorkflowAvatar.tsx b/autogpt_platform/frontend/src/components/molecules/WorkflowAvatar/WorkflowAvatar.tsxnew file mode 100644index 0000000000..b481dc1723--- /dev/null+++ b/autogpt_platform/frontend/src/components/molecules/WorkflowAvatar/WorkflowAvatar.tsx@@ -0,0 +1,40 @@+import {+ Avatar,+ AvatarFallback,+ AvatarImage,+} from "@/components/atoms/Avatar/Avatar";+import { cn } from "@/lib/utils";++/** The two sizes the home surfaces draw: a row bullet and a task marker. */+type WorkflowAvatarSize = 18 | 36;++const SIZE_CLASS: Record<WorkflowAvatarSize, string> = {+ 18: "size-[18px]",+ 36: "size-9",+};++interface Props {+ name: string;+ imageUrl: string | null | undefined;+ size?: WorkflowAvatarSize;+ className?: string;+}++/**+ * A workflow's own picture, falling back to the same generated marble the+ * expert avatars use. Lets a run row show what ran instead of a glyph that+ * looks the same for every workflow.+ */+export function WorkflowAvatar({+ name,+ imageUrl,+ size = 18,+ className,+}: Props) {+ return (+ <Avatar className={cn("shrink-0", SIZE_CLASS[size], className)}>+ {imageUrl ? <AvatarImage src={imageUrl} alt={name} /> : null}+ <AvatarFallback>{name}</AvatarFallback>+ </Avatar>+ );+}