Open History to see the last commit
1import { ThreadHoverCardPopup } from "../ThreadHoverCard";
2import { AgentElapsed } from "./AgentElapsed";
3import { projectedSubagentsToRuntime } from "@t3tools/client-runtime/state/subagentRuntime";
4import type { ReactNode } from "react";
5import { useThreadShell, useProject } from "../../state/entities";
6import { SubagentTooltipContent } from "./SubagentTooltipContent";
7import { useAtomValue } from "@effect/atom-react";
8import { scopeThreadRef, scopeProjectRef } from "@t3tools/client-runtime/environment";
9import { environmentThreadDetails } from "../../state/threads";
10import { EMPTY_SERVER_PROVIDERS, serverEnvironment } from "../../state/server";
11import { MiddleTruncate } from "../ui/middle-truncate";
12import * as DateTime from "effect/DateTime";
13import { WorkLogRow } from "./WorkLog";
14import {
15 resolveHandoffEndpoints,
16 type HandoffEndpoints,
17 type HandoffTimelineRun,
18} from "@t3tools/client-runtime/handoff";
19import { formatSubagentDisplayTitle } from "@t3tools/client-runtime/state/subagent-display";
20import {
21 ProviderDriverKind,
22 type OrchestrationV2Notification,
23 type OrchestrationV2TurnItem,
24 type OrchestrationV2Subagent,
25 type ProviderInstanceId,
26 type ServerProvider,
27 type ThreadId,
28 type EnvironmentId,
29 type NodeId,
30 type ScopedThreadRef,
31} from "@t3tools/contracts";
32import type { TimestampFormat } from "@t3tools/contracts/settings";
33import {
34 BotIcon,
35 ChevronRightIcon,
36 ArrowRightLeftIcon,
37 ArrowRightIcon,
38 GitForkIcon,
39 MessageSquareIcon,
40 MinusIcon,
41 XIcon,
42} from "lucide-react";
43
44import { Tooltip, TooltipTrigger, TooltipPopup } from "../ui/tooltip";
45import {
46 applyProviderInstanceSettings,
47 deriveProviderInstanceEntries,
48 shouldShowInstanceBadge,
49 type ProviderInstanceEntry,
50} from "../../providerInstances";
51import { formatShortTimestamp } from "../../timestampFormat";
52import { getTriggerDisplayModelName } from "./providerIconUtils";
53import { ProviderInstanceIcon, providerTextColor } from "./ProviderInstanceIcon";
54import { cn } from "~/lib/utils";
55import { TimelineSystemDivider } from "./TimelineSystemDivider";
56import { subagentResumedSince } from "./V2LifecycleRow.logic";
57import { Button, InlineButton } from "../ui/button";
58import { T3Wordmark } from "../T3Wordmark";
59
60const LIFECYCLE_TYPES = new Set<OrchestrationV2TurnItem["type"]>([
61 "run_interrupt_request",
62 "run_interrupt_result",
63 "compaction",
64 "handoff",
65 "fork",
66 "subagent",
67 "thread_created",
68]);
69
70export function isV2LifecycleItem(item: OrchestrationV2TurnItem): boolean {
71 return LIFECYCLE_TYPES.has(item.type);
72}
73
74export type { HandoffTimelineRun } from "@t3tools/client-runtime/handoff";
75
76export function V2LifecycleRow(props: {
77 readonly item: OrchestrationV2TurnItem;
78 readonly environmentId: EnvironmentId;
79 readonly resourceSummary?: boolean | undefined;
80 readonly createdAt: string;
81 readonly timestampFormat: TimestampFormat;
82 readonly runs: ReadonlyArray<HandoffTimelineRun>;
83 readonly onOpenThread: (threadId: ThreadId) => void;
84}) {
85 const { item } = props;
86 if (item.type === "run_interrupt_request") {
87 return (
88 <div className="flex justify-end px-1 py-1" data-v2-item-type={item.type}>
89 <div className="flex max-w-[80%] items-center gap-2 text-xs text-destructive">
90 <span aria-hidden="true" className="font-mono">
91 ■
92 </span>
93 <span className="font-medium">Interrupt requested</span>
94 <span aria-hidden="true" className="opacity-50">
95 ·
96 </span>
97 <span className="font-medium">{item.message}</span>
98 <span className="text-3xs text-muted-foreground">
99 {formatShortTimestamp(props.createdAt, props.timestampFormat)}
100 </span>
101 </div>
102 </div>
103 );
104 }
105 if (item.type === "run_interrupt_result") {
106 return (
107 <TimelineSystemDivider
108 label="Run interrupted"
109 detail={item.message}
110 tone="danger"
111 icon={XIcon}
112 />
113 );
114 }
115 if (item.type === "compaction") {
116 const tokenDetail =
117 item.beforeTokenCount === undefined && item.afterTokenCount === undefined
118 ? null
119 : `${item.beforeTokenCount ?? "?"} → ${item.afterTokenCount ?? "?"} tokens`;
120 const label =
121 item.status === "failed"
122 ? "Context compaction failed"
123 : item.status === "cancelled" || item.status === "interrupted"
124 ? "Context compaction stopped"
125 : item.status === "pending" || item.status === "running" || item.status === "waiting"
126 ? "Compacting context"
127 : "Context compacted";
128 return (
129 <TimelineSystemDivider label={label} detail={item.summary ?? tokenDetail} icon={MinusIcon} />
130 );
131 }
132 if (item.type === "handoff") {
133 return (
134 <EnvironmentHandoffRow
135 environmentId={props.environmentId}
136 endpoints={resolveHandoffEndpoints(item, props.runs)}
137 failed={item.status === "failed"}
138 />
139 );
140 }
141 if (item.type === "fork") {
142 const relatedThreadId = item.source.type === "run" ? item.source.threadId : item.targetThreadId;
143 return (
144 <TimelineSystemDivider
145 label={item.source.type === "run" ? "Forked from conversation" : "Conversation fork"}
146 icon={GitForkIcon}
147 actionLabel={item.source.type === "run" ? "Open source conversation" : "Open fork"}
148 onAction={() => props.onOpenThread(relatedThreadId)}
149 />
150 );
151 }
152 if (item.type === "thread_created") {
153 if (props.resourceSummary) {
154 return (
155 <div
156 data-v2-item-type={item.type}
157 className="flex min-w-0 items-center gap-3 rounded-lg border border-border/60 p-3"
158 >
159 <span className="flex size-9 shrink-0 items-center justify-center rounded-lg bg-muted/60">
160 <MessageSquareIcon className="size-4 text-secondary-label" aria-hidden />
161 </span>
162 <span className="min-w-0 flex-1 truncate text-sm font-medium">
163 {item.title ?? "Created thread"}
164 </span>
165 <Button
166 size="xs"
167 variant="outline"
168 aria-label={`Open ${item.title ?? "created thread"}`}
169 onClick={() => props.onOpenThread(item.targetThreadId)}
170 >
171 Open chat
172 </Button>
173 </div>
174 );
175 }
176 return (
177 <WorkLogRow
178 data-v2-item-type={item.type}
179 icon={<T3Wordmark className="size-4 text-icon-muted" aria-hidden />}
180 label={<>Created thread{item.title ? ` · ${item.title}` : ""}</>}
181 trailing={
182 <InlineButton
183 aria-label={`Open ${item.title ?? "created thread"}`}
184 onClick={() => props.onOpenThread(item.targetThreadId)}
185 >
186 Open chat
187 </InlineButton>
188 }
189 />
190 );
191 }
192 if (item.type === "subagent") {
193 return (
194 <SubagentTimelineLink
195 parentRef={scopeThreadRef(props.environmentId, item.threadId)}
196 subagentId={item.subagentId}
197 providerInstanceId={item.providerInstanceId}
198 origin={item.origin}
199 status={item.status}
200 driver={item.driver}
201 title={formatSubagentDisplayTitle(item.title ?? "Subagent")}
202 result={item.result}
203 progress={item.progress}
204 startedAt={item.startedAt}
205 completedAt={item.completedAt}
206 threadId={item.childThreadId}
207 onOpenThread={props.onOpenThread}
208 />
209 );
210 }
211 return null;
212}
213
214const STATUS_VISUALS: Record<
215 OrchestrationV2TurnItem["status"],
216 { dotClass: string; label: string }
217> = {
218 pending: { dotClass: "bg-info", label: "Queued" },
219 running: { dotClass: "bg-info", label: "Running" },
220 waiting: { dotClass: "bg-info", label: "Waiting" },
221 idle: { dotClass: "bg-muted-foreground/50", label: "Idle · resumable" },
222 completed: { dotClass: "bg-success", label: "Completed" },
223 failed: { dotClass: "bg-destructive", label: "Failed" },
224 cancelled: { dotClass: "bg-muted-foreground/60", label: "Stopped" },
225 interrupted: { dotClass: "bg-muted-foreground/60", label: "Stopped" },
226};
227
228function subagentStatusVisual(status: OrchestrationV2TurnItem["status"]) {
229 return STATUS_VISUALS[status];
230}
231
232const SETTLED_SUBAGENT_STATUSES = new Set<OrchestrationV2TurnItem["status"]>([
233 "completed",
234 "failed",
235 "cancelled",
236 "interrupted",
237]);
238
239const GENERIC_CHILD_END = /^Child task ended with status\b/i;
240
241function plainDetail(text: string): string {
242 return text
243 .replace(/\[([^\]]+)\]\([^)]*\)/g, "$1")
244 .replace(/`/g, "")
245 .replace(/^[ \t]*[-*][ \t]+/gm, "")
246 .replace(/\s+/g, " ")
247 .trim();
248}
249
250function isoOrNull(value: DateTime.Utc | null | undefined): string | null {
251 return value ? DateTime.formatIso(value) : null;
252}
253
254export function SubagentElapsed({ agent }: { agent: Parameters<typeof AgentElapsed>[0]["agent"] }) {
255 return <AgentElapsed agent={agent} />;
256}
257
258function SubagentAvatar({
259 driver,
260 displayName,
261 iconUrl,
262 status,
263 className,
264}: {
265 driver?: ProviderDriverKind | undefined;
266 displayName?: string | undefined;
267 iconUrl?: string | undefined;
268 status?: OrchestrationV2TurnItem["status"] | undefined;
269 className?: string;
270}) {
271 return (
272 <span
273 aria-hidden
274 className={cn(
275 "relative inline-flex size-6 shrink-0 items-center justify-center rounded-full border border-border/70 bg-muted ring-2 ring-background",
276 className,
277 )}
278 >
279 {driver ? (
280 <ProviderInstanceIcon
281 driverKind={driver}
282 displayName={displayName ?? driver}
283 acpRegistryIconUrl={iconUrl}
284 className="z-auto"
285 iconClassName="size-3.5"
286 />
287 ) : (
288 <BotIcon className="size-3.5 text-muted-foreground" />
289 )}
290 {status ? (
291 <span
292 className={cn(
293 "absolute -right-px -bottom-px size-2 rounded-full ring-2 ring-background",
294 subagentStatusVisual(status).dotClass,
295 )}
296 />
297 ) : null}
298 </span>
299 );
300}
301
302/**
303 * Reads only the two provider fields the avatar draws. Provider status pushes
304 * replace the provider objects (fresh `checkedAt`), so selecting strings keeps
305 * the avatar from re-rendering when nothing it shows changed.
306 */
307export function EnvironmentSubagentAvatar({
308 environmentId,
309 providerInstanceId,
310 ...props
311}: {
312 environmentId: EnvironmentId;
313 providerInstanceId: ProviderInstanceId;
314 driver?: ProviderDriverKind | undefined;
315 status?: OrchestrationV2TurnItem["status"] | undefined;
316}) {
317 const providersAtom = serverEnvironment.providersValueAtom(environmentId);
318 const displayName = useAtomValue(
319 providersAtom,
320 (providers) =>
321 providers?.find((provider) => provider.instanceId === providerInstanceId)?.displayName,
322 );
323 const iconUrl = useAtomValue(
324 providersAtom,
325 (providers) =>
326 providers?.find((provider) => provider.instanceId === providerInstanceId)?.iconUrl,
327 );
328 return <SubagentAvatar {...props} displayName={displayName} iconUrl={iconUrl} />;
329}
330
331const NOTIFICATION_OUTCOME_STATUS: Record<
332 OrchestrationV2Notification["outcome"],
333 OrchestrationV2TurnItem["status"] | null
334> = {
335 completed: "completed",
336 failed: "failed",
337 cancelled: "cancelled",
338 updated: null,
339 unknown: null,
340};
341
342const NOTIFICATION_OUTCOME_LABEL: Record<OrchestrationV2Notification["outcome"], string> = {
343 completed: "Finished",
344 failed: "Failed",
345 cancelled: "Stopped",
346 updated: "Updated",
347 unknown: "Finished",
348};
349
350export function SubagentNotificationLink(props: {
351 readonly parentRef: ScopedThreadRef;
352 readonly childThreadId: ThreadId;
353 readonly outcome: OrchestrationV2Notification["outcome"];
354 readonly createdAt: string;
355 readonly timestampFormat: TimestampFormat;
356 readonly onOpenThread: (threadId: ThreadId) => void;
357 readonly fallback: ReactNode;
358}) {
359 const agent = useAtomValue(
360 environmentThreadDetails.threadAtom(props.parentRef),
361 (thread) =>
362 thread?.projection.subagents.find((agent) => agent.childThreadId === props.childThreadId) ??
363 null,
364 );
365 if (agent === null) return props.fallback;
366 // A subagent resumed since this notification shows its live status, not the outcome reported then.
367 const resumed =
368 NOTIFICATION_OUTCOME_STATUS[props.outcome] !== null &&
369 subagentResumedSince(agent, props.createdAt);
370 return (
371 <SubagentTimelineLink
372 parentRef={props.parentRef}
373 subagentId={agent.id}
374 providerInstanceId={agent.providerInstanceId}
375 origin={agent.origin}
376 status={agent.status}
377 driver={agent.driver}
378 title={formatSubagentDisplayTitle(agent.title ?? "Subagent")}
379 result={agent.result}
380 progress={agent.progress}
381 startedAt={agent.startedAt}
382 completedAt={agent.completedAt}
383 threadId={props.childThreadId}
384 onOpenThread={props.onOpenThread}
385 {...(resumed
386 ? {}
387 : {
388 event: {
389 status: NOTIFICATION_OUTCOME_STATUS[props.outcome],
390 label: NOTIFICATION_OUTCOME_LABEL[props.outcome],
391 timestamp: formatShortTimestamp(props.createdAt, props.timestampFormat),
392 },
393 })}
394 />
395 );
396}
397
398function SubagentTimelineLink(props: {
399 readonly parentRef: ScopedThreadRef;
400 readonly subagentId: NodeId;
401 readonly providerInstanceId: ProviderInstanceId;
402 readonly origin: OrchestrationV2Subagent["origin"];
403 readonly driver: ProviderDriverKind;
404 readonly title: string;
405 readonly result: string | null;
406 readonly progress: string | undefined;
407 readonly status: OrchestrationV2TurnItem["status"];
408 readonly startedAt: DateTime.Utc | null;
409 readonly completedAt: DateTime.Utc | null;
410 readonly threadId: ThreadId | null;
411 readonly onOpenThread: (threadId: ThreadId) => void;
412 readonly event?: {
413 readonly status: OrchestrationV2TurnItem["status"] | null;
414 readonly label: string;
415 readonly timestamp: string;
416 };
417}) {
418 const agent = useAtomValue(
419 environmentThreadDetails.threadAtom(props.parentRef),
420 (thread) => thread?.projection.subagents.find((agent) => agent.id === props.subagentId) ?? null,
421 );
422 const threadId = props.threadId;
423 const liveStatus = agent?.status ?? props.status;
424 const status = props.event ? props.event.status : liveStatus;
425 const statusLabel = props.event?.label ?? subagentStatusVisual(liveStatus).label;
426 const result = (agent?.result ?? props.result)?.trim();
427 const progress = (agent?.progress ?? props.progress)?.trim();
428 const settled = SETTLED_SUBAGENT_STATUSES.has(status ?? liveStatus);
429 const rawDetail = settled ? result || progress : progress || result;
430 const detail =
431 rawDetail && !GENERIC_CHILD_END.test(rawDetail) ? plainDetail(rawDetail) || null : null;
432 const failed = status === "failed";
433 const timing = {
434 status: liveStatus,
435 startedAt: isoOrNull(agent?.startedAt ?? props.startedAt),
436 completedAt: isoOrNull(agent?.completedAt ?? props.completedAt),
437 };
438 const content = (
439 <>
440 <EnvironmentSubagentAvatar
441 environmentId={props.parentRef.environmentId}
442 providerInstanceId={props.providerInstanceId}
443 driver={props.driver}
444 status={status ?? undefined}
445 />
446 <span className="min-w-0 flex-1">
447 <span className="flex items-baseline gap-2">
448 <span className="min-w-0 truncate text-xs font-medium text-foreground">
449 {props.title}
450 </span>
451 {detail !== null && (props.event !== undefined || status !== "completed") ? (
452 <span
453 className={cn(
454 "shrink-0 text-3xs",
455 failed ? "text-destructive" : "text-muted-foreground",
456 )}
457 >
458 {statusLabel}
459 </span>
460 ) : null}
461 </span>
462 <span
463 className={cn(
464 "block text-2xs leading-relaxed",
465 failed ? "text-destructive" : "text-muted-foreground",
466 )}
467 >
468 {detail === null ? (
469 statusLabel
470 ) : detail.includes("/") && !detail.includes(" ") ? (
471 <MiddleTruncate value={detail} showTitle={false} className="flex" />
472 ) : (
473 <span className="block truncate">{detail}</span>
474 )}
475 </span>
476 </span>
477 <span className="shrink-0 text-xs text-muted-foreground tabular-nums">
478 {props.event ? props.event.timestamp : <SubagentElapsed agent={timing} />}
479 </span>
480 {threadId !== null ? (
481 <ChevronRightIcon
482 aria-hidden
483 className="size-3.5 shrink-0 text-muted-foreground/60 transition-colors group-hover/subagent:text-foreground"
484 />
485 ) : null}
486 </>
487 );
488 const className =
489 "group/subagent flex w-full min-w-0 items-center gap-2.5 rounded-md px-2 py-1.5 text-left";
490 return (
491 <Tooltip>
492 <TooltipTrigger
493 delay={200}
494 render={
495 threadId === null ? (
496 <div data-v2-item-type="subagent" aria-description={statusLabel} className={className}>
497 {content}
498 </div>
499 ) : (
500 <button
501 type="button"
502 data-v2-item-type="subagent"
503 aria-label={`Open ${props.title}`}
504 aria-description={statusLabel}
505 onClick={() => props.onOpenThread(threadId)}
506 className={cn(
507 className,
508 "cursor-pointer transition-colors hover:bg-accent/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/70",
509 )}
510 >
511 {content}
512 </button>
513 )
514 }
515 />
516 <ThreadHoverCardPopup>
517 <SubagentTimelineTooltip
518 {...props}
519 elapsed={agent ? <AgentElapsed agent={projectedSubagentsToRuntime([agent])[0]!} /> : null}
520 model={agent?.model ?? null}
521 modelSelection={agent?.modelSelection}
522 status={liveStatus}
523 result={agent?.result ?? props.result}
524 progress={agent?.progress ?? props.progress}
525 />
526 </ThreadHoverCardPopup>
527 </Tooltip>
528 );
529}
530
531function SubagentTimelineTooltip(
532 props: Parameters<typeof SubagentTimelineLink>[0] & {
533 model: string | null;
534 modelSelection: OrchestrationV2Subagent["modelSelection"];
535 elapsed: ReactNode;
536 },
537) {
538 const environmentId = props.parentRef.environmentId;
539 // The popup only mounts while open, so the full provider list is read here
540 // instead of in every timeline row.
541 const providers =
542 useAtomValue(serverEnvironment.providersValueAtom(environmentId)) ?? EMPTY_SERVER_PROVIDERS;
543 const parent = useThreadShell(props.parentRef)?.source;
544 const child = useThreadShell(
545 props.threadId ? scopeThreadRef(environmentId, props.threadId) : null,
546 )?.source;
547 const parentProject = useProject(
548 parent ? scopeProjectRef(environmentId, parent.projectId) : null,
549 );
550 const childProject = useProject(child ? scopeProjectRef(environmentId, child.projectId) : null);
551 return (
552 <SubagentTooltipContent
553 title={formatSubagentDisplayTitle(child?.title ?? props.title)}
554 model={props.model}
555 providerInstanceId={props.providerInstanceId}
556 origin={props.origin}
557 modelSelection={props.modelSelection}
558 provider={providers.find((provider) => provider.instanceId === props.providerInstanceId)}
559 providers={providers}
560 driver={props.driver}
561 elapsed={props.elapsed}
562 status={props.status}
563 result={props.result}
564 progress={props.progress}
565 parentThread={parent}
566 childThread={child}
567 parentProject={parentProject ?? undefined}
568 childProject={childProject ?? undefined}
569 />
570 );
571}
572
573function EnvironmentHandoffRow({
574 environmentId,
575 ...props
576}: {
577 readonly environmentId: EnvironmentId;
578 readonly endpoints: HandoffEndpoints;
579 readonly failed: boolean;
580}) {
581 const providers =
582 useAtomValue(serverEnvironment.providersValueAtom(environmentId)) ?? EMPTY_SERVER_PROVIDERS;
583 return <HandoffRow {...props} environmentId={environmentId} providers={providers} />;
584}
585
586export function HandoffRow(props: {
587 readonly environmentId: EnvironmentId;
588 readonly endpoints: HandoffEndpoints;
589 readonly providers: ReadonlyArray<ServerProvider>;
590 readonly pending?: boolean;
591 readonly failed?: boolean;
592}) {
593 const { from: fromEndpoints, to } = props.endpoints;
594 const settings = useAtomValue(serverEnvironment.settingsValueAtom(props.environmentId));
595 const derived = deriveProviderInstanceEntries(props.providers);
596 const entries = settings ? applyProviderInstanceSettings(derived, settings, null) : derived;
597 return (
598 <TimelineSystemDivider
599 label={props.pending ? "Context handoff pending" : "Context handoff"}
600 icon={ArrowRightLeftIcon}
601 showDetailSeparator={false}
602 tone={props.failed ? "danger" : "neutral"}
603 detail={
604 <span className="inline-flex min-w-0 flex-wrap items-center justify-center gap-1.5">
605 {fromEndpoints.map((endpoint, index) => (
606 <span
607 key={`${endpoint.instanceId}:${endpoint.model ?? ""}`}
608 className="inline-flex min-w-0 items-center"
609 >
610 <HandoffEndpoint
611 entries={entries}
612 instanceId={endpoint.instanceId}
613 model={endpoint.model}
614 />
615 {index < fromEndpoints.length - 1 ? (
616 <span aria-hidden="true" className="ml-0.5">
617 ,
618 </span>
619 ) : null}
620 </span>
621 ))}
622 {fromEndpoints.length > 0 ? (
623 <ArrowRightIcon aria-hidden="true" className="size-3 shrink-0" />
624 ) : null}
625 <HandoffEndpoint entries={entries} instanceId={to.instanceId} model={to.model} />
626 </span>
627 }
628 />
629 );
630}
631
632function HandoffEndpoint(props: {
633 readonly entries: ReadonlyArray<ProviderInstanceEntry>;
634 readonly instanceId: ProviderInstanceId;
635 readonly model?: string | undefined;
636}) {
637 const entry = props.entries.find((candidate) => candidate.instanceId === props.instanceId);
638 const showBadge = entry !== undefined && shouldShowInstanceBadge(entry, props.entries);
639 const model = props.model?.trim();
640 const providerModel =
641 model === undefined || model.length === 0
642 ? undefined
643 : entry?.models.find((candidate) => candidate.slug === model);
644 const label =
645 providerModel !== undefined
646 ? getTriggerDisplayModelName(providerModel)
647 : model !== undefined && model.length > 0
648 ? model
649 : (entry?.displayName ?? props.instanceId);
650 const labelColor = providerTextColor(
651 entry?.driverKind ?? ProviderDriverKind.make(props.instanceId),
652 );
653 return (
654 <Tooltip>
655 <TooltipTrigger
656 render={
657 <span
658 tabIndex={0}
659 className="inline-flex min-w-0 items-center gap-1.5 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring"
660 >
661 <ProviderInstanceIcon
662 driverKind={entry?.driverKind ?? ProviderDriverKind.make(props.instanceId)}
663 displayName={entry?.displayName ?? props.instanceId}
664 accentColor={entry?.accentColor}
665 acpRegistryAgentId={entry?.acpRegistryAgentId}
666 acpRegistryIconUrl={entry?.acpRegistryIconUrl}
667 showBadge={showBadge}
668 size="compact"
669 iconClassName={cn(showBadge && "opacity-60")}
670 indicatorBackground="var(--background)"
671 />
672 <span
673 className={cn("truncate font-medium", labelColor.className)}
674 style={labelColor.style}
675 >
676 {label}
677 </span>
678 </span>
679 }
680 />
681 <TooltipPopup>
682 {entry?.displayName ?? props.instanceId} · {label}
683 </TooltipPopup>
684 </Tooltip>
685 );
686}