diff --git a/apps/web/src/components/chat/AgentSpawnCtaRow.test.ts b/apps/web/src/components/chat/AgentSpawnCtaRow.test.ts index 3fdb155323..6bad55c9d4 100644 --- a/apps/web/src/components/chat/AgentSpawnCtaRow.test.ts +++ b/apps/web/src/components/chat/AgentSpawnCtaRow.test.ts @@ -1,6 +1,10 @@ import { describe, expect, it } from "vite-plus/test"; -import { AGENT_SPAWN_CTA_CLASS_NAME, AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME } from "./MessagesTimeline"; +import { + AGENT_SPAWN_CTA_CLASS_NAME, + AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME, + resolveAgentSpawnActionLabel, +} from "./MessagesTimeline"; describe("AgentSpawnCtaRow", () => { it("uses the changed-files card shell", () => { @@ -15,4 +19,9 @@ describe("AgentSpawnCtaRow", () => { expect(AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME).toContain("flex-1"); expect(AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME).toContain("rounded-lg"); }); + + it("names the agents action when its visible label is hidden", () => { + expect(resolveAgentSpawnActionLabel(true)).toBe("Open agents"); + expect(resolveAgentSpawnActionLabel(false)).toBe("View agents"); + }); }); diff --git a/apps/web/src/components/chat/MessagesTimeline.tsx b/apps/web/src/components/chat/MessagesTimeline.tsx index 498c5ed6a1..62997fa487 100644 --- a/apps/web/src/components/chat/MessagesTimeline.tsx +++ b/apps/web/src/components/chat/MessagesTimeline.tsx @@ -2130,6 +2130,9 @@ export const AGENT_SPAWN_CTA_CLASS_NAME = export const AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME = "group flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden rounded-lg px-1 py-1.5 text-left transition-colors hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"; +export const resolveAgentSpawnActionLabel = (live: boolean) => + live ? "Open agents" : "View agents"; + const AgentSpawnCtaRow = memo(function AgentSpawnCtaRow(props: { workEntry: TimelineWorkEntry }) { const { workEntry } = props; const { agentPanelModel, onOpenAgents } = use(TimelineRowCtx); @@ -2194,6 +2197,8 @@ const AgentSpawnCtaRow = memo(function AgentSpawnCtaRow(props: { workEntry: Time ? `${failed} failed` : "✓ completed"; + const actionLabel = resolveAgentSpawnActionLabel(live); + return (