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 @@
1import { describe, expect, it } from "vite-plus/test";
2
3import {
4 AGENT_SPAWN_CTA_CLASS_NAME,
5 AGENT_SPAWN_CTA_TRIGGER_CLASS_NAME,
6 resolveAgentSpawnActionLabel,
7} from "./MessagesTimeline";
8
9describe("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
2124 * only roster. Freezes to past tense when every member settles. Static dot,2124 * only roster. Freezes to past tense when every member settles. Static dot,
2125 * no animation.2125 * no animation.
2126 */2126 */
2127export 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
2130export 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
2133export const resolveAgentSpawnActionLabel = (live: boolean) =>
2134 live ? "Open agents" : "View agents";
2135
2136const AgentSpawnCtaRow = memo(function AgentSpawnCtaRow(props: { workEntry: TimelineWorkEntry }) {2127const AgentSpawnCtaRow = memo(function AgentSpawnCtaRow(props: { workEntry: TimelineWorkEntry }) {
2137 const { workEntry } = props;2128 const { workEntry } = props;
2138 const { agentPanelModel, onOpenAgents } = use(TimelineRowCtx);2129 const { agentPanelModel, onOpenAgents } = use(TimelineRowCtx);
@@ -2197,12 +2188,16 @@ const AgentSpawnCtaRow = memo(function AgentSpawnCtaRow(props: { workEntry: Time · 58 unmodified lines
2197 ? `${failed} failed`2188 ? `${failed} failed`
2198 : "✓ completed";2189 : "✓ completed";
2199 2190
2200 const actionLabel = resolveAgentSpawnActionLabel(live);2191 const actionLabel = live ? "Open agents" : "View agents";
2201 2192
2202 return (2193 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">
2204 <div className="flex items-center justify-between gap-2 rounded-xl px-1">2195 <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 >
2206 <span className="flex min-w-0 shrink-0 items-center gap-1.5 whitespace-nowrap font-medium text-foreground text-xs leading-4">2201 <span className="flex min-w-0 shrink-0 items-center gap-1.5 whitespace-nowrap font-medium text-foreground text-xs leading-4">
2207 <span aria-hidden className={cn("size-1.5 shrink-0 rounded-full", dotClass)} />2202 <span aria-hidden className={cn("size-1.5 shrink-0 rounded-full", dotClass)} />
2208 <WorkEntryIconSvg name="bot" className="size-3.5 shrink-0 text-muted-foreground" />2203 <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