History

test(web): remove subagent style contract test

t3-code[bot] committed 3 months ago

Commit dfb884e1 parent 1bb371e2 files · +7 −39Browse files

Unified · Split

2 files
  1. apps/web/src/components/chat/AgentSpawnCtaRow.test.ts +0 −27
  2. apps/web/src/components/chat/MessagesTimeline.tsx +7 −12
apps/web/src/components/chat/AgentSpawnCtaRow.test.ts+0−27
@@ -1,27 +0,0 @@
1−import { describe, expect, it } from "vite-plus/test";
2−
3−import {
4− AGENT_SPAWN_CTA_CLASS_NAME,
5− AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME,
6− resolveAgentSpawnActionLabel,
7−} from "./MessagesTimeline";
8−
9−describe("AgentSpawnCtaRow", () => {
10− it("uses the changed-files card shell", () => {
11− expect(AGENT_SPAWN_CTA_CLASS_NAME).toContain("rounded-2xl");
12− expect(AGENT_SPAWN_CTA_CLASS_NAME).toContain("bg-secondary");
13− expect(AGENT_SPAWN_CTA_CLASS_NAME).toContain("p-2");
14− });
15−
16− it("keeps the trigger inside the card", () => {
17− expect(AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME).not.toContain("-mx-1");
18− expect(AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME).toContain("min-w-0");
19− expect(AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME).toContain("flex-1");
20− expect(AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME).toContain("rounded-lg");
21− });
22−
23− it("names the agents action when its visible label is hidden", () => {
24− expect(resolveAgentSpawnActionLabel(true)).toBe("Open agents");
25− expect(resolveAgentSpawnActionLabel(false)).toBe("View agents");
26− });
27−});
apps/web/src/components/chat/MessagesTimeline.tsx+7−12
@@ -2124,15 +2124,6 @@ const stopRowToggle = (e: { stopPropagation: () => void }) => e.stopPropagation( · 2123 unmodified lines
21242124 * only roster. Freezes to past tense when every member settles. Static dot,
21252125 * no animation.
21262126 */
2127−export const AGENT_SPAWN_CTA_CLASS_NAME =
2128− "@container/agent-spawn rounded-2xl border border-border/70 bg-secondary p-2 dark:border-transparent dark:bg-input/32";
2129−
2130−export const AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME =
2131− "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";
2132−
2133−export const resolveAgentSpawnActionLabel = (live: boolean) =>
2134− live ? "Open agents" : "View agents";
2135−
21362127 const AgentSpawnCtaRow = memo(function AgentSpawnCtaRow(props: { workEntry: TimelineWorkEntry }) {
21372128 const { workEntry } = props;
21382129 const { agentPanelModel, onOpenAgents } = use(TimelineRowCtx);
@@ -2197,12 +2188,16 @@ const AgentSpawnCtaRow = memo(function AgentSpawnCtaRow(props: { workEntry: Time · 58 unmodified lines
21972188 ? `${failed} failed`
21982189 : "✓ completed";
21992190
2200− const actionLabel = resolveAgentSpawnActionLabel(live);
2191+ const actionLabel = live ? "Open agents" : "View agents";
22012192
22022193 return (
2203− <div className={AGENT_SPAWN_CTA_CLASS_NAME}>
2194+ <div className="@container/agent-spawn rounded-2xl border border-border/70 bg-secondary p-2 dark:border-transparent dark:bg-input/32">
22042195 <div className="flex items-center justify-between gap-2 rounded-xl px-1">
2205− <button type="button" onClick={onOpenAgents} className={AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME}>
2196+ <button
2197+ type="button"
2198+ onClick={onOpenAgents}
2199+ className="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"
2200+ >
22062201 <span className="flex min-w-0 shrink-0 items-center gap-1.5 whitespace-nowrap font-medium text-foreground text-xs leading-4">
22072202 <span aria-hidden className={cn("size-1.5 shrink-0 rounded-full", dotClass)} />
22082203 <WorkEntryIconSvg name="bot" className="size-3.5 shrink-0 text-muted-foreground" />

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t