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

Why is the checkout deploy so slow?

Image optimization takes almost four minutes because its cache key includes the commit hash. Key it on the image directory instead.

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.

StepstatusTitle
Running"running"Searching for …
Done, with detailnoneSearched for …
Done, links outnoneRead 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

Steps

Searching for the cache keySearched for the build log Read the Image component docs (opens in a new tab)Failed to search for deploy hooks
import { Component, ViewEncapsulation } from '@angular/core';import {  ScCollapsible,  ScCollapsiblePanel,  ScCollapsibleTrigger,  ScTrace,  ScTraceCollapsible,  ScTraceCollapsiblePanelContent,  ScTraceCollapsibleTrigger,  ScTraceIcon,

A web search's results: a badge for each hostname, in the step's content.

Search results

nextjs.orgvercel.comgithub.com
import { Component, ViewEncapsulation } from '@angular/core';import {  ScBadge,  ScCollapsible,  ScCollapsiblePanel,  ScCollapsibleTrigger,  ScTrace,  ScTraceCollapsible,  ScTraceCollapsiblePanelContent,  ScTraceCollapsibleTrigger,

RTL

قرأ سجل البناء لـ dpl_8Kx2بحث في الويب عن مفتاح ذاكرة الصور
next.config.tsscripts/optimize-images.ts
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.