Chain of Thought
A summary line that expands into the steps an agent took. The summary says what happened, like "Researched in 3 steps"; the steps sit inside it, each one a line of its own.
Usage
Chain of Thought
import { Component, DestroyRef, ViewEncapsulation, computed, inject, signal,} from '@angular/core';import { ScBadge,A pattern, not a component: a Trace whose collapsible line is the summary, with a Trace of steps inside — their output in a Code Block, links or Badges. The streaming here is replayed on a timer.
Anatomy
import { ScTrace, ScTraceLine, ScTraceIcon, ScTraceTitle, ScTraceCollapsible, ScTraceCollapsibleTrigger, ScTraceCollapsiblePanelContent, ScCollapsible, ScCollapsibleTrigger, ScCollapsiblePanel,} from '@semantic-components/ui';<div scTrace> <div scCollapsible scTraceCollapsible [open]="open()"> <button scCollapsibleTrigger scTraceCollapsibleTrigger> <span scTraceLine> <span scTraceIcon>…</span> <span scTraceTitle>Researched in 3 steps</span> </span> </button> <div scCollapsiblePanel> <div scTraceCollapsiblePanelContent> <div scTrace> <span scTraceLine>…</span> … </div> </div> </div> </div></div>Steps
Each step is a line: set its status, and write its title in the matching tense.
| Step | status | Title |
|---|---|---|
| Running | "running" | Searching for … |
| Done, with detail | none | Searched for … |
| Done, links out | none | Read the Image component docs |
| Failed | "error" | Failed to search for … |
The steps stay in the page when the summary closes (the Collapsible's panel only hides them), so each keeps its own open state.
Open state
The summary is researching while the steps run and before the reply starts: it opens then and closes when the reply begins, unless the person opened or closed it. Its status and title follow the steps — "Researched in 4 steps, 1 failed" with an error status when one failed.
Examples
A web search's results: a badge for each hostname, in the step's content.
Search results
import { Component, ViewEncapsulation } from '@angular/core';import { ScBadge, ScCollapsible, ScCollapsiblePanel, ScCollapsibleTrigger, ScTrace, ScTraceCollapsible, ScTraceCollapsiblePanelContent, ScTraceCollapsibleTrigger,RTL
import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation } from '@angular/core';import { ScBadge, ScCollapsible, ScCollapsiblePanel, ScCollapsibleTrigger, ScTrace, ScTraceCollapsible, ScTraceCollapsiblePanelContent,API reference
See the Trace, the Code Block and the Badge.