Open History to see the last commit
1import { CheckpointRef, EnvironmentId, MessageId, TurnId } from "@t3tools/contracts";
2import { createRef, type ReactNode, type Ref } from "react";
3import { renderToStaticMarkup } from "react-dom/server";
4import { beforeAll, describe, expect, it, vi } from "vite-plus/test";
5import type { LegendListRef } from "@legendapp/list/react";
6
7vi.mock("@legendapp/list/react", async () => {
8 const legendListTestId = "legend-list";
9
10 const LegendList = (props: {
11 data: Array<{ id: string }>;
12 keyExtractor: (item: { id: string }) => string;
13 renderItem: (args: { item: { id: string } }) => ReactNode;
14 ListHeaderComponent?: ReactNode;
15 ListFooterComponent?: ReactNode;
16 anchoredEndSpace?: {
17 anchorIndex: number;
18 anchorMaxSize?: number;
19 anchorOffset?: number;
20 onReady?: (info: { anchorIndex: number }) => void;
21 };
22 contentInsetEndAdjustment?: number;
23 className?: string;
24 maintainScrollAtEnd?:
25 | boolean
26 | {
27 animated?: boolean;
28 on?: {
29 dataChange?: boolean;
30 itemLayout?: boolean;
31 layout?: boolean;
32 };
33 };
34 maintainVisibleContentPosition?:
35 | boolean
36 | {
37 data?: boolean;
38 size?: boolean;
39 shouldRestorePosition?: (item: { id: string }) => boolean;
40 };
41 ref?: Ref<LegendListRef>;
42 }) => {
43 if (props.anchoredEndSpace) {
44 props.anchoredEndSpace.onReady?.({ anchorIndex: props.anchoredEndSpace.anchorIndex });
45 }
46 return (
47 <div
48 data-testid={legendListTestId}
49 data-anchor-index={props.anchoredEndSpace?.anchorIndex}
50 data-anchor-max-size={props.anchoredEndSpace?.anchorMaxSize}
51 data-anchor-offset={props.anchoredEndSpace?.anchorOffset}
52 data-anchor-on-ready={Boolean(props.anchoredEndSpace?.onReady)}
53 data-content-inset-end={props.contentInsetEndAdjustment}
54 data-class-name={props.className}
55 data-maintain-scroll-at-end={props.maintainScrollAtEnd ? "enabled" : undefined}
56 data-maintain-scroll-at-end-animated={
57 typeof props.maintainScrollAtEnd === "object"
58 ? props.maintainScrollAtEnd.animated
59 : undefined
60 }
61 data-maintain-scroll-at-end-data-change={
62 typeof props.maintainScrollAtEnd === "object"
63 ? props.maintainScrollAtEnd.on?.dataChange
64 : undefined
65 }
66 data-maintain-scroll-at-end-item-layout={
67 typeof props.maintainScrollAtEnd === "object"
68 ? props.maintainScrollAtEnd.on?.itemLayout
69 : undefined
70 }
71 data-maintain-scroll-at-end-layout={
72 typeof props.maintainScrollAtEnd === "object"
73 ? props.maintainScrollAtEnd.on?.layout
74 : undefined
75 }
76 data-maintain-visible-content-position={
77 typeof props.maintainVisibleContentPosition === "object"
78 ? "object"
79 : props.maintainVisibleContentPosition
80 }
81 data-maintain-visible-content-position-data={
82 typeof props.maintainVisibleContentPosition === "object"
83 ? props.maintainVisibleContentPosition.data
84 : undefined
85 }
86 data-maintain-visible-content-position-size={
87 typeof props.maintainVisibleContentPosition === "object"
88 ? props.maintainVisibleContentPosition.size
89 : undefined
90 }
91 data-maintain-visible-content-position-restore={
92 typeof props.maintainVisibleContentPosition === "object"
93 ? Boolean(props.maintainVisibleContentPosition.shouldRestorePosition)
94 : undefined
95 }
96 >
97 {props.ListHeaderComponent}
98 {props.data.map((item) => (
99 <div key={props.keyExtractor(item)}>{props.renderItem({ item })}</div>
100 ))}
101 {props.ListFooterComponent}
102 </div>
103 );
104 };
105
106 return { LegendList };
107});
108
109function MockFileDiff(props: {
110 fileDiff: { name?: string | null; prevName?: string | null };
111 renderCustomHeader?: (fileDiff: {
112 name?: string | null;
113 prevName?: string | null;
114 }) => React.ReactNode;
115}) {
116 return (
117 <div data-testid="file-diff">
118 {props.renderCustomHeader?.(props.fileDiff)}
119 {props.fileDiff.name ?? props.fileDiff.prevName ?? "diff"}
120 </div>
121 );
122}
123
124vi.mock("@pierre/diffs/react", () => {
125 return { FileDiff: MockFileDiff };
126});
127
128function matchMedia() {
129 return {
130 matches: false,
131 addEventListener: () => {},
132 removeEventListener: () => {},
133 };
134}
135
136let MessagesTimeline: typeof import("./MessagesTimeline").MessagesTimeline;
137
138beforeAll(async () => {
139 const classList = {
140 add: () => {},
141 remove: () => {},
142 toggle: () => {},
143 contains: () => false,
144 };
145
146 vi.stubGlobal("localStorage", {
147 getItem: () => null,
148 setItem: () => {},
149 removeItem: () => {},
150 clear: () => {},
151 });
152 vi.stubGlobal("window", {
153 matchMedia,
154 addEventListener: () => {},
155 removeEventListener: () => {},
156 requestAnimationFrame: (callback: FrameRequestCallback) => {
157 callback(0);
158 return 0;
159 },
160 cancelAnimationFrame: () => {},
161 desktopBridge: undefined,
162 });
163 vi.stubGlobal("document", {
164 documentElement: {
165 classList,
166 offsetHeight: 0,
167 },
168 });
169
170 ({ MessagesTimeline } = await import("./MessagesTimeline"));
171}, 30_000);
172
173const ACTIVE_THREAD_ENVIRONMENT_ID = EnvironmentId.make("environment-local");
174const MESSAGE_CREATED_AT = "2026-03-17T19:12:28.000Z";
175
176function buildProps() {
177 return {
178 isWorking: false,
179 activeTurnInProgress: false,
180 activeTurnStartedAt: null,
181 listRef: createRef<LegendListRef | null>(),
182 latestTurn: null,
183 runningTurnId: null,
184 turnDiffSummaryByAssistantMessageId: new Map(),
185 routeThreadKey: "environment-local:thread-1",
186 onOpenTurnDiff: () => {},
187 revertTurnCountByUserMessageId: new Map(),
188 onRevertUserMessage: () => {},
189 isRevertingCheckpoint: false,
190 onImageExpand: () => {},
191 activeThreadEnvironmentId: ACTIVE_THREAD_ENVIRONMENT_ID,
192 markdownCwd: undefined,
193 resolvedTheme: "light" as const,
194 timestampFormat: "locale" as const,
195 workspaceRoot: undefined,
196 anchorMessageId: null,
197 onAnchorReady: () => {},
198 contentInsetEndAdjustment: 0,
199 liveFollowEnabled: true,
200 onIsAtEndChange: () => {},
201 onManualNavigation: () => {},
202 };
203}
204
205function buildLongUserMessageText(tail = "deep hidden detail only after expand") {
206 return Array.from({ length: 9 }, (_, index) =>
207 index === 8 ? tail : `Line ${index + 1}: ${"verbose prompt content ".repeat(8).trim()}`,
208 ).join("\n");
209}
210
211function buildUserTimelineEntry(text: string) {
212 return {
213 id: "entry-1",
214 kind: "message" as const,
215 createdAt: MESSAGE_CREATED_AT,
216 message: {
217 id: MessageId.make("message-1"),
218 role: "user" as const,
219 text,
220 turnId: null,
221 createdAt: MESSAGE_CREATED_AT,
222 updatedAt: MESSAGE_CREATED_AT,
223 streaming: false,
224 },
225 };
226}
227
228describe("MessagesTimeline", () => {
229 it("uses the larger leading inset only when the top fade is enabled", () => {
230 const timelineEntries = [buildUserTimelineEntry("Hello")];
231
232 const compactMarkup = renderToStaticMarkup(
233 <MessagesTimeline {...buildProps()} timelineEntries={timelineEntries} />,
234 );
235 const fadedMarkup = renderToStaticMarkup(
236 <MessagesTimeline {...buildProps()} timelineEntries={timelineEntries} topFadeEnabled />,
237 );
238
239 expect(compactMarkup).toContain('class="h-3 sm:h-4"');
240 expect(compactMarkup).not.toContain("chat-timeline-scroll-fade");
241 expect(fadedMarkup).toContain('class="h-10 sm:h-12"');
242 expect(fadedMarkup).toContain("chat-timeline-scroll-fade");
243 });
244
245 it("keeps assistant changed-files headers sticky below the thread header", () => {
246 const assistantMessageId = MessageId.make("message-assistant-with-files");
247 const turnId = TurnId.make("turn-with-files");
248 const markup = renderToStaticMarkup(
249 <MessagesTimeline
250 {...buildProps()}
251 latestTurn={{
252 turnId,
253 state: "completed",
254 startedAt: MESSAGE_CREATED_AT,
255 completedAt: MESSAGE_CREATED_AT,
256 }}
257 timelineEntries={[
258 {
259 id: "entry-assistant-with-files",
260 kind: "message",
261 createdAt: MESSAGE_CREATED_AT,
262 message: {
263 id: assistantMessageId,
264 role: "assistant",
265 text: "Updated the fixture.",
266 turnId,
267 createdAt: MESSAGE_CREATED_AT,
268 updatedAt: MESSAGE_CREATED_AT,
269 streaming: false,
270 },
271 },
272 ]}
273 turnDiffSummaryByAssistantMessageId={
274 new Map([
275 [
276 assistantMessageId,
277 {
278 turnId,
279 checkpointTurnCount: 1,
280 checkpointRef: CheckpointRef.make("checkpoint-with-files"),
281 status: "ready",
282 files: [{ path: "README.md", kind: "modified", additions: 2, deletions: 1 }],
283 assistantMessageId,
284 completedAt: MESSAGE_CREATED_AT,
285 },
286 ],
287 ])
288 }
289 />,
290 );
291
292 expect(markup).toContain("sticky top-2 z-10");
293 expect(markup).not.toContain("self-start");
294 expect(markup).toContain("whitespace-nowrap");
295 expect(markup).toContain("!size-[22px]");
296 expect(markup).toContain("size-3");
297 expect(markup).toContain('aria-label="Collapse all folders"');
298 expect(markup).toContain('aria-label="Open diff"');
299 expect(markup).toContain("1 changed file");
300 });
301
302 it("treats only the strict list end as the live edge", async () => {
303 const {
304 resolveTimelineIsAtEnd,
305 resolveTimelineMinimapHasPersistentGutter,
306 resolveTimelineMinimapHeightStyle,
307 resolveTimelineMinimapHitStripWidth,
308 resolveTimelineMinimapIndexFromPointer,
309 resolveTimelineMinimapInteractiveWidth,
310 resolveTimelineMinimapTopPercent,
311 } = await import("./MessagesTimeline.logic");
312
313 expect(resolveTimelineIsAtEnd({ isAtEnd: true })).toBe(true);
314 expect(resolveTimelineIsAtEnd(undefined)).toBeUndefined();
315 // Within the pixel band above the content bottom counts as the end...
316 expect(
317 resolveTimelineIsAtEnd({
318 isAtEnd: false,
319 contentLength: 2000,
320 scroll: 1170,
321 scrollLength: 800,
322 }),
323 ).toBe(true);
324 // ...but half a viewport up (LegendList's isNearEnd territory) does not.
325 expect(
326 resolveTimelineIsAtEnd({
327 isAtEnd: false,
328 contentLength: 2000,
329 scroll: 900,
330 scrollLength: 800,
331 }),
332 ).toBe(false);
333 // The composer inset is part of contentLength and must not count as
334 // distance-to-end.
335 expect(
336 resolveTimelineIsAtEnd(
337 { isAtEnd: false, contentLength: 2100, scroll: 1170, scrollLength: 800 },
338 100,
339 ),
340 ).toBe(true);
341 // Geometry missing (older state shape): fall back to the strict flag.
342 expect(resolveTimelineIsAtEnd({ isAtEnd: false })).toBe(false);
343
344 expect(resolveTimelineMinimapHeightStyle(5)).toBe("min(32px, calc(100vh - 18rem))");
345 expect(resolveTimelineMinimapTopPercent(2, 5)).toBe(50);
346 expect(
347 resolveTimelineMinimapIndexFromPointer({
348 itemCount: 101,
349 railTop: 100,
350 railHeight: 500,
351 pointerY: 350,
352 }),
353 ).toBe(50);
354 expect(
355 resolveTimelineMinimapIndexFromPointer({
356 itemCount: 101,
357 railTop: 100,
358 railHeight: 500,
359 pointerY: 999,
360 }),
361 ).toBe(100);
362 expect(resolveTimelineMinimapHasPersistentGutter(832)).toBe(false);
363 expect(resolveTimelineMinimapHasPersistentGutter(863)).toBe(false);
364 expect(resolveTimelineMinimapHasPersistentGutter(864)).toBe(true);
365
366 // No usable gutter (zoomed in / narrow pane): the strip must go inert
367 // instead of overlaying the centered content column.
368 expect(resolveTimelineMinimapHitStripWidth(768)).toBe(0);
369 expect(resolveTimelineMinimapHitStripWidth(792)).toBe(0);
370 // Partial gutter: strip shrinks to what fits between the viewport edge
371 // and the content column.
372 expect(resolveTimelineMinimapHitStripWidth(820)).toBe(14);
373 // Full gutter: unchanged 40px-wide strip.
374 expect(resolveTimelineMinimapHitStripWidth(872)).toBe(40);
375 expect(resolveTimelineMinimapHitStripWidth(1400)).toBe(40);
376 expect(resolveTimelineMinimapHitStripWidth(0)).toBe(0);
377 expect(resolveTimelineMinimapHitStripWidth(Number.NaN)).toBe(0);
378
379 // The collapsed target stays narrow, but an open preview keeps its full
380 // 20rem width plus the 2rem offset from the minimap rail interactive.
381 expect(resolveTimelineMinimapInteractiveWidth(0, false)).toBe(0);
382 expect(resolveTimelineMinimapInteractiveWidth(14, false)).toBe(14);
383 expect(resolveTimelineMinimapInteractiveWidth(40, false)).toBe(40);
384 expect(resolveTimelineMinimapInteractiveWidth(0, true)).toBe("22rem");
385 expect(resolveTimelineMinimapInteractiveWidth(14, true)).toBe("22rem");
386 expect(resolveTimelineMinimapInteractiveWidth(40, true)).toBe("22rem");
387 });
388
389 it("anchors a sent attachment message using its measured height", () => {
390 const onAnchorReady = vi.fn();
391 const firstEntry = buildUserTimelineEntry("First prompt.");
392 const secondEntry = {
393 ...buildUserTimelineEntry("Newest prompt."),
394 id: "entry-2",
395 message: {
396 ...buildUserTimelineEntry("Newest prompt.").message,
397 id: MessageId.make("message-2"),
398 attachments: [
399 {
400 type: "image" as const,
401 id: "attachment-1",
402 name: "screenshot.png",
403 mimeType: "image/png",
404 sizeBytes: 1,
405 previewUrl: "data:image/png;base64,iVBORw0KGgo=",
406 },
407 ],
408 },
409 };
410 const markup = renderToStaticMarkup(
411 <MessagesTimeline
412 {...buildProps()}
413 anchorMessageId={secondEntry.message.id}
414 onAnchorReady={onAnchorReady}
415 contentInsetEndAdjustment={144}
416 timelineEntries={[firstEntry, secondEntry]}
417 />,
418 );
419
420 expect(markup).toContain('data-anchor-index="1"');
421 expect(markup).toContain('data-anchor-offset="16"');
422 expect(markup).toContain('data-anchor-on-ready="true"');
423 expect(markup).not.toContain("data-anchor-max-size=");
424 expect(markup).toContain('data-content-inset-end="144"');
425 expect(markup).toContain("[overflow-anchor:none]");
426 expect(markup).not.toContain('data-maintain-scroll-at-end="enabled"');
427 expect(markup).toContain('data-maintain-visible-content-position="object"');
428 expect(markup).toContain('data-maintain-visible-content-position-data="true"');
429 expect(markup).toContain('data-maintain-visible-content-position-size="true"');
430 expect(markup).toContain('data-maintain-visible-content-position-restore="true"');
431 expect(onAnchorReady).toHaveBeenCalledOnce();
432 expect(onAnchorReady).toHaveBeenCalledWith(secondEntry.message.id, 1);
433 });
434
435 it("renders collapse controls for long user messages", () => {
436 const markup = renderToStaticMarkup(
437 <MessagesTimeline
438 {...buildProps()}
439 timelineEntries={[buildUserTimelineEntry(buildLongUserMessageText())]}
440 />,
441 );
442
443 expect(markup).toContain("Show full message");
444 expect(markup).toContain('data-maintain-scroll-at-end="enabled"');
445 expect(markup).toContain('data-maintain-scroll-at-end-animated="false"');
446 expect(markup).toContain('data-maintain-scroll-at-end-data-change="true"');
447 expect(markup).toContain('data-maintain-scroll-at-end-item-layout="true"');
448 expect(markup).toContain('data-maintain-scroll-at-end-layout="true"');
449 expect(markup).toContain('data-user-message-collapsed="true"');
450 expect(markup).toContain('data-user-message-fade="true"');
451 expect(markup).toContain('data-user-message-footer="true"');
452 });
453
454 it("does not render collapse controls for short user messages", () => {
455 const markup = renderToStaticMarkup(
456 <MessagesTimeline
457 {...buildProps()}
458 timelineEntries={[buildUserTimelineEntry("Short prompt.")]}
459 />,
460 );
461
462 expect(markup).not.toContain("Show full message");
463 expect(markup).toContain('data-user-message-collapsible="false"');
464 expect(markup).toContain("rounded-2xl bg-message p-3");
465 });
466
467 it("renders inline terminal labels with the composer chip UI", () => {
468 const markup = renderToStaticMarkup(
469 <MessagesTimeline
470 {...buildProps()}
471 timelineEntries={[
472 buildUserTimelineEntry(
473 [
474 buildLongUserMessageText("yoo what's @terminal-1:1-5 mean"),
475 "",
476 "<terminal_context>",
477 "- Terminal 1 lines 1-5:",
478 " 1 | julius@mac effect-http-ws-cli % bun i",
479 " 2 | bun install v1.3.9 (cf6cdbbb)",
480 "</terminal_context>",
481 ].join("\n"),
482 ),
483 ]}
484 />,
485 );
486
487 expect(markup).toContain("Terminal 1 lines 1-5");
488 expect(markup).toContain("lucide-terminal");
489 expect(markup).toContain("yoo what's</p>");
490 expect(markup).toContain('<span aria-hidden="true"> </span>');
491 expect(markup).toContain("Show full message");
492 }, 20_000);
493
494 it("renders chips for standalone element-pick context messages", () => {
495 const markup = renderToStaticMarkup(
496 <MessagesTimeline
497 {...buildProps()}
498 timelineEntries={[
499 buildUserTimelineEntry(
500 [
501 "<element_context>",
502 "- <SubmitButton> (Button.tsx:12):",
503 " url: https://example.com/dashboard",
504 " selector: button.submit",
505 " source: /repo/src/Button.tsx:12:5",
506 " html:",
507 ' <button class="submit">Save</button>',
508 "</element_context>",
509 ].join("\n"),
510 ),
511 ]}
512 />,
513 );
514
515 expect(markup).toContain("SubmitButton");
516 expect(markup).not.toContain("<element_context");
517 expect(markup).not.toContain("<element_context");
518 });
519
520 it("keeps the copy button for collapsed long user messages", () => {
521 const markup = renderToStaticMarkup(
522 <MessagesTimeline
523 {...buildProps()}
524 timelineEntries={[buildUserTimelineEntry(buildLongUserMessageText())]}
525 />,
526 );
527
528 expect(markup).toContain('aria-label="Copy link"');
529 expect(markup).toContain('data-user-message-collapsed="true"');
530 expect(markup).toContain('data-user-message-footer="true"');
531 });
532
533 it("renders context compaction entries in the normal work log", () => {
534 const markup = renderToStaticMarkup(
535 <MessagesTimeline
536 {...buildProps()}
537 timelineEntries={[
538 {
539 id: "entry-1",
540 kind: "work",
541 createdAt: "2026-03-17T19:12:28.000Z",
542 entry: {
543 id: "work-1",
544 createdAt: "2026-03-17T19:12:28.000Z",
545 label: "Context compacted",
546 tone: "info",
547 },
548 },
549 ]}
550 />,
551 );
552
553 expect(markup).toContain("Context compacted");
554 expect(markup).toContain("Work Log");
555 });
556
557 it("formats changed file paths from the workspace root", () => {
558 const markup = renderToStaticMarkup(
559 <MessagesTimeline
560 {...buildProps()}
561 timelineEntries={[
562 {
563 id: "entry-1",
564 kind: "work",
565 createdAt: "2026-03-17T19:12:28.000Z",
566 entry: {
567 id: "work-1",
568 createdAt: "2026-03-17T19:12:28.000Z",
569 label: "Updated files",
570 tone: "tool",
571 changedFiles: ["C:/Users/mike/dev-stuff/t3code/apps/web/src/session-logic.ts"],
572 },
573 },
574 ]}
575 workspaceRoot="C:/Users/mike/dev-stuff/t3code"
576 />,
577 );
578
579 expect(markup).toContain("t3code/apps/web/src/session-logic.ts");
580 expect(markup).not.toContain("C:/Users/mike/dev-stuff/t3code/apps/web/src/session-logic.ts");
581 });
582
583 it("renders review comment contexts as structured cards instead of raw tags", () => {
584 const markup = renderToStaticMarkup(
585 <MessagesTimeline
586 {...buildProps()}
587 timelineEntries={[
588 {
589 id: "entry-1",
590 kind: "message",
591 createdAt: "2026-03-17T19:12:28.000Z",
592 message: {
593 id: MessageId.make("message-2"),
594 role: "user",
595 text: [
596 '<review_comment sectionId="turn:2" sectionTitle="Turn 2" filePath="apps/web/src/lib/contextWindow.test.ts" startIndex="3" endIndex="14" rangeLabel="+47 to +58">',
597 "Wadduo",
598 "```diff",
599 "@@ -0,0 +47,2 @@",
600 '+ it("keeps valid zero-usage snapshots", () => {',
601 "+ expect(snapshot).not.toBeNull();",
602 "```",
603 "</review_comment>",
604 ].join("\n"),
605 turnId: null,
606 createdAt: "2026-03-17T19:12:28.000Z",
607 updatedAt: "2026-03-17T19:12:28.000Z",
608 streaming: false,
609 },
610 },
611 ]}
612 />,
613 );
614
615 expect(markup).toContain("contextWindow.test.ts");
616 expect(markup).toContain("Wadduo");
617 expect(markup).toContain('data-testid="file-diff"');
618 expect(markup).not.toContain(">Review comment<");
619 expect(markup).not.toContain("<review_comment");
620 expect(markup).not.toContain("</review_comment>");
621 });
622
623 it("renders file review comments as source code instead of diffs", () => {
624 const markup = renderToStaticMarkup(
625 <MessagesTimeline
626 {...buildProps()}
627 timelineEntries={[
628 {
629 id: "entry-1",
630 kind: "message",
631 createdAt: "2026-03-17T19:12:28.000Z",
632 message: {
633 id: MessageId.make("message-source-comment"),
634 role: "user",
635 text: [
636 '<review_comment sectionId="file:docs/plan.md" sectionTitle="File comment" filePath="docs/plan.md" startIndex="0" endIndex="1" rangeLabel="L1 to L2">',
637 "Clarify this.",
638 "```md",
639 "# Plan",
640 "- Step one",
641 "```",
642 "</review_comment>",
643 ].join("\n"),
644 turnId: null,
645 createdAt: "2026-03-17T19:12:28.000Z",
646 updatedAt: "2026-03-17T19:12:28.000Z",
647 streaming: false,
648 },
649 },
650 ]}
651 />,
652 );
653
654 expect(markup).toContain("plan.md");
655 expect(markup).toContain("Clarify this.");
656 expect(markup).toContain("# Plan");
657 expect(markup).not.toContain('data-testid="file-diff"');
658 });
659
660 it("renders a failure marker for failed tool lifecycle entries", () => {
661 const markup = renderToStaticMarkup(
662 <MessagesTimeline
663 {...buildProps()}
664 timelineEntries={[
665 {
666 id: "entry-1",
667 kind: "work",
668 createdAt: "2026-03-17T19:12:28.000Z",
669 entry: {
670 id: "work-1",
671 createdAt: "2026-03-17T19:12:28.000Z",
672 label: "Glob",
673 tone: "tool",
674 toolLifecycleStatus: "failed",
675 detail: "No files found",
676 },
677 },
678 ]}
679 />,
680 );
681
682 expect(markup).toContain("lucide-x");
683 expect(markup).toContain('aria-label="Tool call failed"');
684 });
685});