diff --git a/components/artifacts/steer-card.tsx b/components/artifacts/steer-card.tsx index d1b223d..fab2503 100644 --- a/components/artifacts/steer-card.tsx +++ b/components/artifacts/steer-card.tsx @@ -15,11 +15,11 @@ import { VisualOutputCard } from "@/components/artifacts/visual-card"; * ("data-subagent-artifact") carries the result. It renders as an artifact — * NEVER a learner bubble, never wrapped in a message container: * - * research — a quiet "Research complete" badge. The full brief is TOO LONG - * to inline and the teacher's wake turn weaves it into the lesson anyway; - * it stays persisted in the transcript (the artifact part), so a - * "view full research" affordance can be added later. Failures keep the - * failure card (the brief explains what went wrong). + * research — a quiet "Research complete" one-liner that expands on demand + * (native
) to the full persisted brief + sources: the brief is + * too long to inline by default and the teacher's wake turn weaves it + * into the lesson anyway. Failures keep the failure card (the brief + * explains what went wrong). * demo / visual — the artifact itself (sandboxed iframe / sanitized SVG). * The sub-agent's verification notes are model-facing glue and do NOT * render; only a failure note does. @@ -48,15 +48,25 @@ export function SubagentSteerCard({ message }: { message: TeacherUIMessage }) { } } -/** Quiet one-liner, the dispatch-settled idiom: the brief lives in the record, - * the lesson lives in the teacher's wake turn — the badge just marks delivery. */ +/** Quiet one-liner, the dispatch-settled idiom — the lesson lives in the + * teacher's wake turn; the badge just marks delivery. The persisted brief + * rides along in a collapsed
(the wave-1 "view full research" + * affordance): full markdown + sources, one click away, no extra fetch — + * the artifact part in the record is the single source of truth. */ function ResearchCompleteBadge({ result }: { result: ResearchResult }) { return ( -
- - Research - complete - {result.sources.length > 0 && · {result.sources.length} sources} -
+
+ + + Research + complete + {result.sources.length > 0 && · {result.sources.length} sources} + view brief + hide brief + +
+ +
+
); } diff --git a/tests/demos.test.tsx b/tests/demos.test.tsx index b2b349c..84c151b 100644 --- a/tests/demos.test.tsx +++ b/tests/demos.test.tsx @@ -342,7 +342,7 @@ describe("steer card rendering (the delivered artifact)", () => { assert.ok(!html.includes("Looking at the render"), "model-facing notes never render"); }); - it("renders a quiet Research-complete badge — the full brief stays out of the transcript (but persisted)", () => { + it("renders a quiet Research-complete one-liner whose collapsed
carries the full brief", () => { const steer = buildSubagentSteer( { id: "jr", kind: "research", toolCallId: "cr" }, { @@ -357,8 +357,14 @@ describe("steer card rendering (the delivered artifact)", () => { assert.match(html, /Research/); assert.match(html, /complete/); assert.match(html, /2 sources/); - assert.ok(!html.includes("founded the Academy"), "the long brief never renders inline"); - assert.ok(!html.includes("britannica"), "source links stay out too — the wake turn cites them"); + assert.match(html, /view brief/, "the expansion affordance is offered"); + // the one-liner is a native
— collapsed by default, so the + // brief + sources ride in the DOM but never clutter the transcript + // until the learner opens them (the wave-1 "view full research" ask) + assert.match(html, /]*data-testid="research-complete-badge"/, "a real disclosure"); + assert.ok(!/]*open/.test(html), "collapsed by default — no `open` attribute"); + assert.ok(html.includes("founded the Academy"), "the persisted brief rides inside the details"); + assert.ok(html.includes("britannica.com/plato"), "source links ride inside the details"); }); it("renders the visual failure note with no svg when the build FAILED", () => {