Collapsible Thinking Trace
The "thought for 5s" panel: a native details/summary outside, individually expandable steps inside — buttons rather than nested disclosures, which are announced as a disclosure within a disclosure.
What the agent tried, what failed, and what it did about it — the run history a user needs before they trust a second attempt.
components/agent-retry-log.tsxnpx hoverlab add agent-retry-log
Or over MCP, from your editor's agent — no account needed.
Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.
Start a page with this section — add more, order them, and leave with the page source.
A retried step that is invisible reads as a slow agent. A retried step that is shown reads as a careful one, and it is the same run either way.
Rendered live in your current theme — this is the same component whose source is below, not a screenshot of it.
'use client'
/**
* <AgentRetryLog> — What the agent tried, what failed, and what it did about it — the run history a user needs before they trust a second attempt.
*
* An agent that retries silently reads as an agent that is slow. The same
* run, shown, reads as one that is careful — and the layout problem is that
* the interesting rows are the failures, which are the minority. The
* obvious wrong answer is to show failures only: a log of three errors with
* no successes around them reads as a broken system rather than as a run
* that recovered.
*
* So every step is a row and the badge carries the outcome. "ok" twice is
* context, not filler; it is what makes "abandoned" legible as one step out
* of four rather than as the whole story.
*
* The abandoned row is the one worth reading twice. It names why the agent
* stopped — a column that does not exist — rather than reporting a generic
* failure, because "stopped rather than guessing a column name" is the
* behaviour a user is deciding whether to trust, and it cannot be inferred
* from a red pill.
*
* The rows are buttons with `aria-pressed` rather than divs: selecting one
* is how a real implementation would open its full trace, so the row is
* operable and must be reachable and announceable as such. The badge text
* is separate from the tone for the same reason as the digest — a pill
* reading "warning" tells a reader nothing about what happened, and "retried"
* tells them everything.
*
* The demo selects the first row rather than the failure. A panel that
* opens on its own worst row is making an editorial claim about which step
* matters, and here the reader's question is usually "what did it do", in
* order.
*/
import * as React from 'react'
type Tone = 'neutral' | 'positive' | 'warning' | 'critical'
export interface AgentRetryLogRow {
id: string
label: string
detail?: string
tone?: Tone
/** What the badge says. Falls back to the tone name when absent. */
status?: string
}
export interface AgentRetryLogProps {
heading?: string
intro?: string
rows?: AgentRetryLogRow[]
className?: string
}
/*
Tones as complete utility classes, never assembled from fragments.
Tailwind scans source text, so `text-${tone}-foreground` produces no
class at all — the same failure as an undefined token, and just as
invisible in review.
*/
const TONE_CLASS: Record<Tone, string> = {
neutral: 'bg-muted text-muted-foreground',
positive: 'bg-primary/10 text-primary',
warning: 'bg-accent text-accent-foreground',
critical: 'bg-destructive/10 text-destructive',
}
const ROWS: AgentRetryLogRow[] = [
{ id: "row-1", label: "search_docs — succeeded", detail: "First attempt. 12 passages returned, 4 above the relevance floor.", tone: "positive", status: "ok" },
{ id: "row-2", label: "fetch_invoice — rate limited, retried", detail: "429 on the first call. Backed off 2.1 s and succeeded on the second.", tone: "warning", status: "retried" },
{ id: "row-3", label: "run_query — failed twice, abandoned", detail: "Column `renewed_at` does not exist. The agent stopped rather than guessing a column name.", tone: "critical", status: "abandoned" },
{ id: "row-4", label: "summarise — succeeded", detail: "Ran against the two sources that resolved, and says so in the answer.", tone: "positive", status: "ok" },
]
export function AgentRetryLog({
heading = "What it tried before this answer",
intro = "A retried step that is invisible reads as a slow agent. A retried step that is shown reads as a careful one, and it is the same run either way.",
rows = ROWS,
className,
}: AgentRetryLogProps) {
/*
Per-instance prefix for every id this block emits.
The literals these replaced were a latent duplicate the moment the
block appeared twice on one document, and `aria-labelledby` on a
duplicated id resolves to the first match -- so the second copy was
labelled by the first copy's heading. Client component, so `useId` is
the right tool.
*/
const uid = React.useId()
const [selected, setSelected] = React.useState<string | null>(rows[0]?.id ?? null)
return (
<section
aria-labelledby={`${uid}-agent-retry-log-heading`}
className={`w-full bg-background px-6 py-16 ${className ?? ''}`}
>
<div className="mx-auto max-w-3xl">
<h2
id={`${uid}-agent-retry-log-heading`}
className="text-2xl font-semibold tracking-tight text-foreground"
>
{heading}
</h2>
<p className="mt-2 text-sm text-muted-foreground">{intro}</p>
<ul className="mt-8 divide-y divide-border overflow-hidden rounded-xl border border-border bg-card">
{rows.map((row) => {
const isSelected = row.id === selected
return (
<li key={row.id}>
{/*
A button, not a div with onClick. The row is operable, so
it has to be reachable by keyboard and announce its
selected state — aria-pressed is what carries that.
*/}
<button
type="button"
aria-pressed={isSelected}
onClick={() => setSelected(row.id)}
className={`flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ${
isSelected ? 'bg-muted/40' : ''
}`}
>
<span className="min-w-0">
<span className="block truncate text-sm font-medium text-foreground">
{row.label}
</span>
{row.detail ? (
<span className="mt-0.5 block text-sm text-muted-foreground">
{row.detail}
</span>
) : null}
</span>
<span
className={`shrink-0 rounded-full px-2.5 py-1 text-xs font-medium ${
TONE_CLASS[row.tone ?? 'neutral']
}`}
>
{row.status ?? row.tone ?? 'neutral'}
</span>
</button>
</li>
)
})}
</ul>
</div>
</section>
)
}
bg-card, text-muted-foreground) — it inherits your theme instead of overriding it.Drop it at components/agent-retry-log.tsx and import it where you need the section:
import { AgentRetryLog } from '@/components/agent-retry-log'1 of this block’s props are simple enough to drive from here. Change them and the block below re-renders — it is the same component whose source is above, not a mock of it. Everything else it accepts is in the table underneath.
Read out of the component’s own type and signature, so this cannot drift from the source below. Every prop has a default — the component renders standalone before you pass it anything.
| Prop | Type | Default |
|---|---|---|
heading | string | "What it tried before this answer" |
intro | string | — |
rows | AgentRetryLogRow[] | ROWS |
className | string | — |
The same block rendered once to markup, wrapped as a file your framework compiles. Tailwind classes are framework-agnostic, so the design transfers intact — the behaviour does not.
This block is interactive. The markup below is its initial state with the event handlers stripped — you will need to re-wire the behaviour in your framework.
<!--
Agent Retry Log — markup from the Hoverlab catalog.
This is the block rendered once to HTML and wrapped as a component
file. It is not a port of the React source: the Tailwind classes carry
the design, which is the part that took the work, and they are the same
in every framework.
This block is interactive in React and the handlers are NOT here.
Buttons, toggles and menus render in their initial state and do
nothing until you wire them up.
-->
<section aria-labelledby="_R_0_-agent-retry-log-heading" class="w-full bg-background px-6 py-16 ">
<div class="mx-auto max-w-3xl">
<h2 id="_R_0_-agent-retry-log-heading" class="text-2xl font-semibold tracking-tight text-foreground">What it tried before this answer</h2>
<p class="mt-2 text-sm text-muted-foreground">A retried step that is invisible reads as a slow agent. A retried step that is shown reads as a careful one, and it is the same run either way.</p>
<ul class="mt-8 divide-y divide-border overflow-hidden rounded-xl border border-border bg-card">
<li>
<button type="button" aria-pressed="true" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset bg-muted/40">
<span class="min-w-0">
<span class="block truncate text-sm font-medium text-foreground">search_docs — succeeded</span>
<span class="mt-0.5 block text-sm text-muted-foreground">First attempt. 12 passages returned, 4 above the relevance floor.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-primary/10 text-primary">ok</span>
</button>
</li>
<li>
<button type="button" aria-pressed="false" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ">
<span class="min-w-0">
<span class="block truncate text-sm font-medium text-foreground">fetch_invoice — rate limited, retried</span>
<span class="mt-0.5 block text-sm text-muted-foreground">429 on the first call. Backed off 2.1 s and succeeded on the second.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-accent text-accent-foreground">retried</span>
</button>
</li>
<li>
<button type="button" aria-pressed="false" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ">
<span class="min-w-0">
<span class="block truncate text-sm font-medium text-foreground">run_query — failed twice, abandoned</span>
<span class="mt-0.5 block text-sm text-muted-foreground">Column `renewed_at` does not exist. The agent stopped rather than guessing a column name.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-destructive/10 text-destructive">abandoned</span>
</button>
</li>
<li>
<button type="button" aria-pressed="false" class="flex w-full items-center justify-between gap-4 px-5 py-4 text-start transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset ">
<span class="min-w-0">
<span class="block truncate text-sm font-medium text-foreground">summarise — succeeded</span>
<span class="mt-0.5 block text-sm text-muted-foreground">Ran against the two sources that resolved, and says so in the answer.</span>
</span>
<span class="shrink-0 rounded-full px-2.5 py-1 text-xs font-medium bg-primary/10 text-primary">ok</span>
</button>
</li>
</ul>
</div>
</section>
What each framework gets across the whole catalog — effects convert properly; this rung is markup.
The component, its props, the design tokens it expects and the command that installs it — as one prompt. Paste it into Claude, Cursor, v0 or ChatGPT and what they build around it will match the rest of the catalog instead of inventing its own system.
Want the whole screen instead of this one section? Open a page and copy it entire.
All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.
Browse Agent ReasoningCopying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.
The "thought for 5s" panel: a native details/summary outside, individually expandable steps inside — buttons rather than nested disclosures, which are announced as a disclosure within a disclosure.
Dense tool invocations that open into their arguments and result, with status carried by icon and word rather than colour, and errors marked as alerts only once the user opens them.
Run status as rows — done, running, failed, queued — with native progress elements, per-task retry buttons that name their task, and progress announced from one small status region instead of every row.
The gap before the first token: a shimmer grid, a phase label that advances as the wait lengthens, and a running counter — which is the only honest answer to "is it stuck". The timer is hidden from the live region on purpose.
The trace after something broke: retries counted in the open with what each one cost, a step that was silently worked around drawn in amber rather than green, and the raw error kept apart from the agent’s reading of it.
What one run cost, per step, so an expensive answer is attributable rather than a monthly surprise.