Skip to content

Commit 3061257

Browse files
committed
style: replace generic idle-specialist prompt with specific suggested first action
1 parent cd59b47 commit 3061257

File tree

3 files changed

+54
-10
lines changed

3 files changed

+54
-10
lines changed

apps/desktop/src/features/agents/components/SpecialistCard.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,16 @@ export function SpecialistCard({ specialist, onChat, recentOutputs, recentBundle
126126
))}
127127
</div>
128128

129-
{/* Unused specialist prompt */}
129+
{/* Suggested first action for idle specialists */}
130130
{!hasOutputs && !isManager ? (
131-
<p className="mt-4 font-mono text-[11px] text-muted-foreground/40">
132-
Start your first conversation
133-
</p>
131+
<button
132+
type="button"
133+
onClick={() => onChat(specialist.id)}
134+
className="mt-4 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground/50 transition-colors hover:text-primary"
135+
>
136+
<span>Try:</span>
137+
<span className="font-medium">{specialist.outputTypes[0]}</span>
138+
</button>
134139
) : null}
135140

136141
{/* Recent outputs — bundles and standalone artifacts */}

test/features/agents/specialist-activity-status.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,21 @@ describe("SpecialistCard activity status badge", () => {
4545
// Activity status — "Start your first conversation" for unused specialists
4646
// ---------------------------------------------------------------------------
4747
describe("SpecialistCard unused specialist prompt", () => {
48-
it("renders a prompt for unused specialists", () => {
49-
expect(specialistCardSrc).toMatch(/Start your first conversation/i);
48+
it("renders a suggested first action for idle specialists", () => {
49+
expect(specialistCardSrc).toMatch(/Try:/);
50+
expect(specialistCardSrc).toMatch(/specialist\.outputTypes\[0\]/);
5051
});
5152

52-
it("uses muted styling for the unused prompt", () => {
53+
it("uses muted styling for the idle suggestion", () => {
5354
// Should use muted-foreground or similar subdued styling
5455
expect(specialistCardSrc).toMatch(/text-muted-foreground/);
5556
});
5657

57-
it("uses monospace font for the unused prompt", () => {
58-
expect(specialistCardSrc).toMatch(/font-mono.*Start your first conversation|Start your first conversation.*font-mono/si);
58+
it("uses monospace font for the idle suggestion", () => {
59+
expect(specialistCardSrc).toMatch(/font-mono.*Try:|Try:.*font-mono/si);
5960
});
6061

61-
it("only shows unused prompt when there are no outputs (not on managers)", () => {
62+
it("only shows idle suggestion when there are no outputs (not on managers)", () => {
6263
// Should conditionally render based on hasOutputs being false
6364
expect(specialistCardSrc).toMatch(/!hasOutputs|hasOutputs.*false/s);
6465
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { describe, expect, it } from "vitest";
2+
import { readFileSync } from "node:fs";
3+
import { resolve } from "node:path";
4+
5+
const src = readFileSync(
6+
resolve(
7+
__dirname,
8+
"../../apps/desktop/src/features/agents/components/SpecialistCard.tsx",
9+
),
10+
"utf-8",
11+
);
12+
13+
describe("Idle specialist suggested first action", () => {
14+
it("does not show generic 'Start your first conversation' text", () => {
15+
expect(src).not.toMatch(/Start your first conversation/);
16+
});
17+
18+
it("uses specialist.outputTypes[0] to generate a specific suggestion", () => {
19+
expect(src).toMatch(/specialist\.outputTypes\[0\]/);
20+
});
21+
22+
it("includes a 'Try:' prefix label", () => {
23+
expect(src).toMatch(/Try:/);
24+
});
25+
26+
it("calls onChat when the suggestion is clicked", () => {
27+
expect(src).toMatch(/!hasOutputs\s*&&\s*!isManager[\s\S]*?onChat\(specialist\.id\)/);
28+
});
29+
30+
it("still renders the recent outputs section for cards with outputs", () => {
31+
expect(src).toMatch(/hasOutputs/);
32+
expect(src).toMatch(/Recent outputs/);
33+
});
34+
35+
it("only appears for non-manager specialists without outputs", () => {
36+
expect(src).toMatch(/!hasOutputs\s*&&\s*!isManager/);
37+
});
38+
});

0 commit comments

Comments
 (0)