Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

WorkflowPanel.tsx

753 lines23.3 KB

1import { DiffsHighlighter, getSharedHighlighter, SupportedLanguages } from "@pierre/diffs";
2import type { EnvironmentId } from "@t3tools/contracts";
3import { CheckIcon, ChevronRightIcon, CopyIcon, ExternalLinkIcon, NetworkIcon } from "lucide-react";
4import {
5 Component,
6 type KeyboardEvent as ReactKeyboardEvent,
7 type MouseEvent as ReactMouseEvent,
8 type ReactElement,
9 type ReactNode,
10 Suspense,
11 use,
12 useCallback,
13 useEffect,
14 useMemo,
15 useRef,
16 useState,
17} from "react";
18​
19import { useTheme } from "~/hooks/useTheme";
20import { type DiffThemeName, resolveDiffThemeName } from "~/lib/diffRendering";
21import { cn } from "~/lib/utils";
22import { useEnvironmentQuery } from "~/state/query";
23import { useAtomCommand } from "~/state/use-atom-command";
24import { workflowEnvironment } from "~/state/workflow";
25import {
26 isRemoteWorkflowRun,
27 type WorkflowRun,
28 type WorkflowRunAgent,
29 type WorkflowRunStatus,
30 workflowRunTitle,
31} from "~/workflow-logic";
32import { Button } from "../ui/button";
33import {
34 AgentRowContent,
35 PhaseHeader,
36 WorkflowStatusChip,
37 safeWorkflowSessionUrl,
38} from "./workflowUi";
39import { useCopyToClipboard } from "../../hooks/useCopyToClipboard";
40​
41type WorkflowTabId = "run" | "script" | "logs";
42​
43const WORKFLOW_TABS: ReadonlyArray<{ id: WorkflowTabId; label: string }> = [
44 { id: "run", label: "Run" },
45 { id: "script", label: "Script" },
46 { id: "logs", label: "Logs" },
47];
48​
49// ---------------------------------------------------------------------------
50// Root — handles the not-found empty state, then delegates to the inner panel
51// so every data hook runs unconditionally.
52// ---------------------------------------------------------------------------
53​
54export function WorkflowPanel(props: {
55 workflowRun: WorkflowRun | null;
56 environmentId: EnvironmentId;
57 onStop?: (() => void) | undefined;
58}): ReactElement {
59 if (props.workflowRun === null) {
60 return (
61 <div className="flex h-full min-w-0 items-center justify-center p-6 text-muted-foreground text-sm">
62 Workflow not found
63 </div>
64 );
65 }
66 return (
67 <WorkflowPanelInner
68 run={props.workflowRun}
69 environmentId={props.environmentId}
70 onStop={props.onStop}
71 />
72 );
74​
75function WorkflowPanelInner({
76 run,
77 environmentId,
78 onStop,
79}: {
80 run: WorkflowRun;
81 environmentId: EnvironmentId;
82 onStop?: (() => void) | undefined;
83}): ReactElement {
84 const [tab, setTab] = useState<WorkflowTabId>("run");
85 const { resolvedTheme } = useTheme();
86 const themeName = resolveDiffThemeName(resolvedTheme);
87​
88 const scriptPath = run.handles?.scriptPath;
89 const transcriptDir = run.handles?.transcriptDir;
90 const remote = isRemoteWorkflowRun(run);
91 const isTerminal = run.status !== "running";
92​
93 const scriptQuery = useEnvironmentQuery(
94 tab === "script" && scriptPath !== undefined
95 ? workflowEnvironment.readScript({ environmentId, input: { scriptPath } })
96 : null,
97 );
98 const journalQuery = useEnvironmentQuery(
99 tab === "logs" && transcriptDir !== undefined
100 ? workflowEnvironment.readJournal({ environmentId, input: { transcriptDir } })
101 : null,
102 );
103​
104 return (
105 <div className="flex h-full min-w-0 flex-col">
106 <div className="flex items-center gap-2 border-border/60 border-b px-3 py-2">
107 <NetworkIcon className="size-4 shrink-0 text-muted-foreground" />
108 <span className="truncate font-medium text-foreground text-sm">
109 {workflowRunTitle(run)}
110 </span>
111 <WorkflowStatusChip status={run.status} />
112 <div className="ml-auto flex items-center gap-1.5">
113 {isTerminal && run.handles?.runId !== undefined && scriptPath !== undefined && (
114 <CopyResumeButton scriptPath={scriptPath} runId={run.handles.runId} />
115 )}
116 {onStop && (
117 <Button type="button" size="xs" variant="outline" onClick={onStop}>
118 Stop
119 </Button>
120 )}
121 </div>
122 </div>
123​
124 <div className="flex items-center gap-1 border-border/60 border-b px-2 py-1.5">
125 {WORKFLOW_TABS.map((entry) => (
126 <button
127 key={entry.id}
128 type="button"
129 data-active-tab={tab === entry.id}
130 onClick={() => setTab(entry.id)}
131 className={cn(
132 "flex h-7 items-center rounded-md px-2.5 text-sm transition-colors",
133 tab === entry.id
134 ? "bg-accent text-foreground"
135 : "text-muted-foreground hover:bg-accent/60 hover:text-foreground",
136 )}
137 >
138 {entry.label}
139 </button>
140 ))}
141 </div>
142​
143 <div className="min-h-0 flex-1 overflow-y-auto p-2.5">
144 {tab === "run" && (
145 <RunTab
146 run={run}
147 environmentId={environmentId}
148 transcriptDir={transcriptDir}
149 remote={remote}
150 />
151 )}
152 {tab === "script" && (
153 <ScriptTab scriptPath={scriptPath} query={scriptQuery} themeName={themeName} />
154 )}
155 {tab === "logs" && (
156 <LogsTab logs={run.logs} transcriptDir={transcriptDir} query={journalQuery} />
157 )}
158 </div>
159 </div>
160 );
162​
163// ---------------------------------------------------------------------------
164// Header copy button
165// ---------------------------------------------------------------------------
166​
167function CopyResumeButton({
168 scriptPath,
169 runId,
170}: {
171 scriptPath: string;
172 runId: string;
173}): ReactElement {
174 const { copyToClipboard, isCopied } = useCopyToClipboard({
175 timeout: 1200,
176 target: "workflow resume command",
177 });
178​
179 const handleCopy = useCallback(() => {
180 copyToClipboard(`Workflow({ scriptPath: "${scriptPath}", resumeFromRunId: "${runId}" })`);
181 }, [copyToClipboard, runId, scriptPath]);
182​
183 return (
184 <Button type="button" size="xs" variant="outline" onClick={handleCopy}>
185 {isCopied ? <CheckIcon /> : <CopyIcon />}
186 Copy resume command
187 </Button>
188 );
190​
191// ---------------------------------------------------------------------------
192// Run tab
193// ---------------------------------------------------------------------------
194​
195function RunTab({
196 run,
197 environmentId,
198 transcriptDir,
199 remote,
200}: {
201 run: WorkflowRun;
202 environmentId: EnvironmentId;
203 transcriptDir: string | undefined;
204 remote: boolean;
205}): ReactElement {
206 if (remote) {
207 const sessionUrl = safeWorkflowSessionUrl(run.handles?.sessionUrl);
208 if (sessionUrl === undefined) {
209 return <MutedBody text="Running in the cloud" />;
210 }
211 return (
212 <a
213 href={sessionUrl}
214 target="_blank"
215 rel="noopener noreferrer"
216 className="flex items-center gap-1.5 rounded-md px-0.5 py-1 text-[12px] text-foreground/82 leading-5 hover:bg-accent/20 hover:text-foreground"
217 >
218 <ExternalLinkIcon className="size-3.5 shrink-0 text-muted-foreground" />
219 Running in the cloud — open session
220 </a>
221 );
222 }
223​
224 if (run.phases.length === 0) {
225 return <MutedBody text="No agents yet" />;
226 }
227​
228 return (
229 <div className="space-y-px">
230 {run.phases.map((phase) => (
231 <div key={`${run.taskId}:${phase.index}`}>
232 <PhaseHeader phase={phase} />
233 {phase.agents.map((agent) => (
234 <ExpandableAgentRow
235 key={`${run.taskId}:${agent.index}`}
236 agent={agent}
237 environmentId={environmentId}
238 transcriptDir={transcriptDir}
239 runStatus={run.status}
240 />
241 ))}
242 </div>
243 ))}
244 </div>
245 );
247​
248const stopPropagation = (event: ReactMouseEvent) => event.stopPropagation();
249​
250function ExpandableAgentRow({
251 agent,
252 environmentId,
253 transcriptDir,
254 runStatus,
255}: {
256 agent: WorkflowRunAgent;
257 environmentId: EnvironmentId;
258 transcriptDir: string | undefined;
259 runStatus: WorkflowRunStatus;
260}): ReactElement {
261 const [expanded, setExpanded] = useState(false);
262 const agentId = agent.agentId;
263 const canExpand =
264 agentId !== undefined && transcriptDir !== undefined && agent.isolation !== "remote";
265​
266 const toggle = useCallback(() => setExpanded((value) => !value), []);
267 const onKeyDown = useCallback(
268 (event: ReactKeyboardEvent<HTMLDivElement>) => {
269 if (event.key === "Enter" || event.key === " ") {
270 event.preventDefault();
271 toggle();
272 }
273 },
274 [toggle],
275 );
276​
277 const leading = canExpand ? (
278 <ChevronRightIcon
279 className={cn(
280 "size-3 shrink-0 text-muted-foreground/60 transition-transform",
281 expanded && "rotate-90",
282 )}
283 />
284 ) : (
285 <span className="size-3 shrink-0" />
286 );
287​
288 return (
289 <div
290 className={cn(
291 "flex flex-col rounded-md px-0.5 py-0.5 transition-colors",
292 canExpand &&
293 "cursor-pointer hover:bg-accent/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/70 focus-visible:ring-inset",
294 )}
295 {...(canExpand
296 ? { role: "button", tabIndex: 0, "aria-expanded": expanded, onClick: toggle, onKeyDown }
297 : {})}
298 >
299 <AgentRowContent agent={agent} leading={leading} />
300 {canExpand && expanded && agentId !== undefined && transcriptDir !== undefined && (
301 <AgentTranscriptView
302 environmentId={environmentId}
303 transcriptDir={transcriptDir}
304 agentId={agentId}
305 runStatus={runStatus}
306 />
307 )}
308 </div>
309 );
311​
312// ---------------------------------------------------------------------------
313// Transcript view (cursor-paged, polled while running)
314// ---------------------------------------------------------------------------
315​
316interface TranscriptEntry {
317 kind: "text" | "tool";
318 text: string;
320​
321const TRANSCRIPT_MAX_RETAINED_LINES = 600;
322const TRANSCRIPT_TEXT_MAX_CHARS = 600;
323const TRANSCRIPT_TOOL_PREVIEW_CHARS = 120;
324​
325function clipTranscriptText(text: string, limit: number): string {
326 const trimmed = text.trim();
327 return trimmed.length > limit ? `${trimmed.slice(0, limit)}\u2026` : trimmed;
329​
330function toolInputPreview(input: unknown): string | undefined {
331 if (typeof input !== "object" || input === null) {
332 return undefined;
333 }
334 const record = input as Record<string, unknown>;
335 // The most informative single field per common tool, else the first string.
336 const preferred = record.command ?? record.file_path ?? record.pattern ?? record.prompt;
337 const value =
338 typeof preferred === "string"
339 ? preferred
340 : Object.values(record).find((entry): entry is string => typeof entry === "string");
341 return value !== undefined ? clipTranscriptText(value, TRANSCRIPT_TOOL_PREVIEW_CHARS) : undefined;
343​
344/**
345 * Distill one transcript JSONL line into displayable entries. Only assistant
346 * text and tool calls render; user turns, tool results, attachments, thinking,
347 * and harness metadata are skipped — they dominate line counts on long runs
348 * and read as noise ("user", "attachment", ...) when printed raw.
349 */
350function parseTranscriptEntries(raw: string): TranscriptEntry[] {
351 let parsed: unknown;
352 try {
353 parsed = JSON.parse(raw);
354 } catch {
355 return [];
356 }
357 if (typeof parsed !== "object" || parsed === null) {
358 return [];
359 }
360 const record = parsed as Record<string, unknown>;
361 if (record.type !== "assistant") {
362 return [];
363 }
364 const message =
365 typeof record.message === "object" && record.message !== null
366 ? (record.message as Record<string, unknown>)
367 : record;
368 const content = message.content;
369 if (typeof content === "string") {
370 const text = clipTranscriptText(content, TRANSCRIPT_TEXT_MAX_CHARS);
371 return text.length > 0 ? [{ kind: "text", text }] : [];
372 }
373 if (!Array.isArray(content)) {
374 return [];
375 }
376 const entries: TranscriptEntry[] = [];
377 for (const block of content) {
378 if (typeof block !== "object" || block === null) {
379 continue;
380 }
381 const blockRecord = block as Record<string, unknown>;
382 if (blockRecord.type === "text" && typeof blockRecord.text === "string") {
383 const text = clipTranscriptText(blockRecord.text, TRANSCRIPT_TEXT_MAX_CHARS);
384 if (text.length > 0) {
385 entries.push({ kind: "text", text });
386 }
387 } else if (blockRecord.type === "tool_use" && typeof blockRecord.name === "string") {
388 const preview = toolInputPreview(blockRecord.input);
389 entries.push({
390 kind: "tool",
391 text: preview !== undefined ? `${blockRecord.name} ${preview}` : blockRecord.name,
392 });
393 }
394 }
395 return entries;
397​
398function AgentTranscriptView({
399 environmentId,
400 transcriptDir,
401 agentId,
402 runStatus,
403}: {
404 environmentId: EnvironmentId;
405 transcriptDir: string;
406 agentId: string;
407 runStatus: WorkflowRunStatus;
408}): ReactElement {
409 const runTranscript = useAtomCommand(
410 workflowEnvironment.readAgentTranscript,
411 "workflow read transcript",
412 );
413 const [lines, setLines] = useState<string[]>([]);
414 const [trimmed, setTrimmed] = useState(false);
415 const [failed, setFailed] = useState(false);
416 const [loading, setLoading] = useState(false);
417 // Render-visible mirror of completeRef: "have we caught up to EOF at least
418 // once" — before that, an absence of parsed entries just means we are
419 // still paging, not that the agent produced no output.
420 const [caughtUp, setCaughtUp] = useState(false);
421 const transcriptEntries = useMemo(() => lines.flatMap(parseTranscriptEntries), [lines]);
422 const nextLineRef = useRef(0);
423 const completeRef = useRef(false);
424 const loadingRef = useRef(false);
425​
426 const loadMore = useCallback(async () => {
427 // `complete` only means the last read caught up to end-of-file; a live
428 // run keeps appending, so polling must keep re-reading past prior EOF.
429 if (loadingRef.current) {
430 return;
431 }
432 loadingRef.current = true;
433 setLoading(true);
434 const result = await runTranscript({
435 environmentId,
436 input: { transcriptDir, agentId, afterLine: nextLineRef.current },
437 });
438 loadingRef.current = false;
439 setLoading(false);
440 if (result._tag !== "Success") {
441 setFailed(true);
442 return;
443 }
444 setFailed(false);
445 nextLineRef.current = result.value.nextLine;
446 completeRef.current = result.value.complete;
447 if (result.value.complete) {
448 setCaughtUp(true);
449 }
450 if (result.value.lines.length > 0) {
451 // Long-running agents can produce transcripts far larger than a view
452 // needs — retain a bounded tail so memory stays flat on million-token
453 // threads.
454 setLines((prev) => {
455 const merged = [...prev, ...result.value.lines];
456 if (merged.length > TRANSCRIPT_MAX_RETAINED_LINES) {
457 setTrimmed(true);
458 return merged.slice(-TRANSCRIPT_MAX_RETAINED_LINES);
459 }
460 return merged;
461 });
462 }
463 }, [agentId, environmentId, runTranscript, transcriptDir]);
464​
465 // Drain all currently-available pages when the row opens.
466 useEffect(() => {
467 const control = { cancelled: false };
468 const drain = async () => {
469 while (!control.cancelled && !completeRef.current) {
470 const before = nextLineRef.current;
471 await loadMore();
472 if (control.cancelled || nextLineRef.current === before) {
473 break;
474 }
475 }
476 };
477 void drain();
478 return () => {
479 control.cancelled = true;
480 };
481 }, [loadMore]);
482​
483 // Keep polling for new lines while the run is live; when the run settles
484 // (or the row opens on an already-terminal run), fetch once more so lines
485 // appended after the last poll tick are not lost.
486 useEffect(() => {
487 if (runStatus !== "running") {
488 void loadMore();
489 return;
490 }
491 const id = setInterval(() => {
492 void loadMore();
493 }, 2000);
494 return () => clearInterval(id);
495 }, [loadMore, runStatus]);
496​
497 return (
498 <div
499 className="mt-1 ml-4 max-h-72 overflow-y-auto rounded-md border border-border/60 bg-muted/30 p-1.5 font-mono text-[11px] leading-4"
500 onClick={stopPropagation}
501 >
502 {transcriptEntries.length === 0 ? (
503 failed ? (
504 <p className="text-destructive/80">Failed to load transcript.</p>
505 ) : loading || !caughtUp ? (
506 <p className="text-muted-foreground/60">Loading transcript…</p>
507 ) : (
508 <p className="text-muted-foreground/60">No assistant output yet.</p>
509 )
510 ) : (
511 <>
512 {trimmed && (
513 <p className="text-muted-foreground/50">
514 Earlier activity trimmed — showing the latest entries.
515 </p>
516 )}
517 {transcriptEntries.map((entry, index) => (
518 <div
519 // Entries are append-only and never reordered, so the index is stable.
520 // oxlint-disable-next-line no-array-index-key
521 key={`${index}:${entry.text.length}`}
522 className={cn(
523 "whitespace-pre-wrap break-words",
524 entry.kind === "tool" && "text-muted-foreground/60",
525 )}
526 >
527 {entry.kind === "tool" ? `→ ${entry.text}` : entry.text}
528 </div>
529 ))}
530 </>
531 )}
532 {failed && lines.length > 0 && (
533 <p className="text-destructive/70">Failed to load more transcript.</p>
534 )}
535 </div>
536 );
538​
539// ---------------------------------------------------------------------------
540// Script tab
541// ---------------------------------------------------------------------------
542​
543let cachedScriptHighlighter: Promise<DiffsHighlighter> | undefined;
544​
545function getScriptHighlighter(): Promise<DiffsHighlighter> {
546 cachedScriptHighlighter ??= getSharedHighlighter({
547 themes: [resolveDiffThemeName("dark"), resolveDiffThemeName("light")],
548 langs: ["javascript" as SupportedLanguages],
549 preferredHighlighter: "shiki-js",
550 });
551 return cachedScriptHighlighter;
553​
554class WorkflowCodeErrorBoundary extends Component<
555 { fallback: ReactNode; children: ReactNode },
556 { hasError: boolean }
557> {
558 constructor(props: { fallback: ReactNode; children: ReactNode }) {
559 super(props);
560 this.state = { hasError: false };
561 }
562​
563 static getDerivedStateFromError() {
564 return { hasError: true };
565 }
566​
567 override render() {
568 return this.state.hasError ? this.props.fallback : this.props.children;
569 }
571​
572function ScriptHighlight({
573 source,
574 themeName,
575}: {
576 source: string;
577 themeName: DiffThemeName;
578}): ReactElement {
579 const highlighter = use(getScriptHighlighter());
580 const html = useMemo(
581 () => highlighter.codeToHtml(source, { lang: "javascript", theme: themeName }),
582 [highlighter, source, themeName],
583 );
584 return (
585 <div
586 className="chat-markdown-shiki overflow-x-auto text-[12px]"
587 dangerouslySetInnerHTML={{ __html: html }}
588 />
589 );
591​
592function ScriptTab({
593 scriptPath,
594 query,
595 themeName,
596}: {
597 scriptPath: string | undefined;
598 query: {
599 data: { source: string; truncated: boolean } | null;
600 error: string | null;
601 isPending: boolean;
602 };
603 themeName: DiffThemeName;
604}): ReactElement {
605 if (scriptPath === undefined) {
606 return <MutedBody text="No script for this run." />;
607 }
608 if (query.error !== null) {
609 return <p className="text-[12px] text-destructive/80">{query.error}</p>;
610 }
611 if (query.data === null) {
612 return <MutedBody text={query.isPending ? "Loading script…" : "No script."} />;
613 }
614 const { source, truncated } = query.data;
615 const fallback = (
616 <pre className="overflow-x-auto rounded-md bg-muted/30 p-2 font-mono text-[12px] leading-5">
617 {source}
618 </pre>
619 );
620 return (
621 <div>
622 {truncated && (
623 <p className="mb-1.5 text-[11px] text-warning">Script truncated for display.</p>
624 )}
625 <WorkflowCodeErrorBoundary fallback={fallback}>
626 <Suspense fallback={fallback}>
627 <ScriptHighlight source={source} themeName={themeName} />
628 </Suspense>
629 </WorkflowCodeErrorBoundary>
630 </div>
631 );
633​
634// ---------------------------------------------------------------------------
635// Logs tab
636// ---------------------------------------------------------------------------
637​
638interface JournalEntry {
639 agentId: string;
640 hasResult: boolean;
641 resultJson?: string | undefined;
642 resultTruncated?: boolean | undefined;
644​
645function LogsTab({
646 logs,
647 transcriptDir,
648 query,
649}: {
650 logs: string[];
651 transcriptDir: string | undefined;
652 query: {
653 data: { entries: readonly JournalEntry[]; truncated: boolean } | null;
654 error: string | null;
655 isPending: boolean;
656 };
657}): ReactElement {
658 return (
659 <div className="space-y-3">
660 {logs.length === 0 ? (
661 <MutedBody text="No logs." />
662 ) : (
663 <div className="space-y-px font-mono text-[11px] text-muted-foreground/70 leading-4">
664 {logs.map((log, index) => (
665 // oxlint-disable-next-line no-array-index-key -- logs are append-only, index is stable
666 <div key={`${index}:${log.length}`} className="whitespace-pre-wrap break-words">
667 {log}
668 </div>
669 ))}
670 </div>
671 )}
672​
673 {transcriptDir !== undefined && (
674 <div>
675 <p className="mb-1 text-[10px] text-muted-foreground/65 uppercase tracking-[0.12em]">
676 Results
677 </p>
678 {query.error !== null ? (
679 <p className="text-[12px] text-destructive/80">{query.error}</p>
680 ) : query.data === null ? (
681 query.isPending ? (
682 <MutedBody text="Loading results…" />
683 ) : null
684 ) : query.data.entries.length === 0 ? (
685 <MutedBody text="No results yet." />
686 ) : (
687 <div className="space-y-px">
688 {query.data.entries.map((entry) => (
689 <JournalResultRow key={entry.agentId} entry={entry} />
690 ))}
691 </div>
692 )}
693 {query.data?.truncated && (
694 <p className="mt-1 text-[11px] text-muted-foreground/55">Results truncated.</p>
695 )}
696 </div>
697 )}
698 </div>
699 );
701​
702function JournalResultRow({ entry }: { entry: JournalEntry }): ReactElement {
703 const [expanded, setExpanded] = useState(false);
704 const resultJson = entry.resultJson;
705 return (
706 <div className="rounded-md px-0.5 py-0.5">
707 <div className="flex items-center gap-1.5 text-[12px] leading-5">
708 <span className="shrink-0 truncate font-medium text-foreground/82">{entry.agentId}</span>
709 {!entry.hasResult && <span className="text-[11px] text-muted-foreground/55">pending</span>}
710 </div>
711 {resultJson !== undefined &&
712 (expanded ? (
713 <div
714 className="mt-1 cursor-pointer"
715 role="button"
716 tabIndex={0}
717 onClick={() => setExpanded(false)}
718 onKeyDown={(event) => {
719 if (event.key === "Enter" || event.key === " ") {
720 event.preventDefault();
721 setExpanded(false);
722 }
723 }}
724 >
725 <pre className="max-h-64 overflow-auto rounded-md bg-muted/30 p-1.5 font-mono text-[11px] leading-4">
726 {resultJson}
727 </pre>
728 {entry.resultTruncated && (
729 <p className="mt-0.5 text-[10px] text-muted-foreground/55">Result truncated.</p>
730 )}
731 </div>
732 ) : (
733 <button
734 type="button"
735 onClick={() => setExpanded(true)}
736 className="mt-0.5 block w-full cursor-pointer text-left"
737 >
738 <span className="line-clamp-3 whitespace-pre-wrap break-words font-mono text-[11px] text-muted-foreground/70 leading-4">
739 {resultJson}
740 </span>
741 </button>
742 ))}
743 </div>
744 );
746​
747// ---------------------------------------------------------------------------
748// Shared muted body
749// ---------------------------------------------------------------------------
750​
751function MutedBody({ text }: { text: string }): ReactElement {
752 return <p className="px-0.5 py-1 text-[12px] text-muted-foreground/60 leading-5">{text}</p>;