| ... | ... | @@ -130,7 +130,9 @@ function matchMedia() { |
| 130 | 130 | }; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | | beforeAll(() => { |
| 133 | let MessagesTimeline: typeof import("./MessagesTimeline").MessagesTimeline; |
| 134 | |
| 135 | beforeAll(async () => { |
| 134 | 136 | const classList = { |
| 135 | 137 | add: () => {}, |
| 136 | 138 | remove: () => {}, |
| ... | ... | @@ -161,7 +163,9 @@ beforeAll(() => { |
| 161 | 163 | offsetHeight: 0, |
| 162 | 164 | }, |
| 163 | 165 | }); |
| 164 | | }); |
| 166 | |
| 167 | ({ MessagesTimeline } = await import("./MessagesTimeline")); |
| 168 | }, 30_000); |
| 165 | 169 | |
| 166 | 170 | const ACTIVE_THREAD_ENVIRONMENT_ID = EnvironmentId.make("environment-local"); |
| 167 | 171 | const MESSAGE_CREATED_AT = "2026-03-17T19:12:28.000Z"; |
| ... | ... | @@ -219,8 +223,7 @@ function buildUserTimelineEntry(text: string) { |
| 219 | 223 | } |
| 220 | 224 | |
| 221 | 225 | describe("MessagesTimeline", () => { |
| 222 | | it("uses the larger leading inset only when the top fade is enabled", async () => { |
| 223 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 226 | it("uses the larger leading inset only when the top fade is enabled", () => { |
| 224 | 227 | const timelineEntries = [buildUserTimelineEntry("Hello")]; |
| 225 | 228 | |
| 226 | 229 | const compactMarkup = renderToStaticMarkup( |
| ... | ... | @@ -236,8 +239,7 @@ describe("MessagesTimeline", () => { |
| 236 | 239 | expect(fadedMarkup).toContain("chat-timeline-scroll-fade"); |
| 237 | 240 | }); |
| 238 | 241 | |
| 239 | | it("keeps assistant changed-files headers sticky below the thread header", async () => { |
| 240 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 242 | it("keeps assistant changed-files headers sticky below the thread header", () => { |
| 241 | 243 | const assistantMessageId = MessageId.make("message-assistant-with-files"); |
| 242 | 244 | const turnId = TurnId.make("turn-with-files"); |
| 243 | 245 | const markup = renderToStaticMarkup( |
| ... | ... | @@ -349,8 +351,7 @@ describe("MessagesTimeline", () => { |
| 349 | 351 | expect(resolveTimelineMinimapInteractiveWidth(40, true)).toBe("22rem"); |
| 350 | 352 | }); |
| 351 | 353 | |
| 352 | | it("anchors a sent attachment message using its measured height", async () => { |
| 353 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 354 | it("anchors a sent attachment message using its measured height", () => { |
| 354 | 355 | const onAnchorReady = vi.fn(); |
| 355 | 356 | const onAnchorSizeChanged = vi.fn(); |
| 356 | 357 | const firstEntry = buildUserTimelineEntry("First prompt."); |
| ... | ... | @@ -398,8 +399,7 @@ describe("MessagesTimeline", () => { |
| 398 | 399 | expect(onAnchorSizeChanged).toHaveBeenCalledWith(secondEntry.message.id, 240); |
| 399 | 400 | }); |
| 400 | 401 | |
| 401 | | it("renders collapse controls for long user messages", async () => { |
| 402 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 402 | it("renders collapse controls for long user messages", () => { |
| 403 | 403 | const markup = renderToStaticMarkup( |
| 404 | 404 | <MessagesTimeline |
| 405 | 405 | {...buildProps()} |
| ... | ... | @@ -418,8 +418,7 @@ describe("MessagesTimeline", () => { |
| 418 | 418 | expect(markup).toContain('data-user-message-footer="true"'); |
| 419 | 419 | }); |
| 420 | 420 | |
| 421 | | it("does not render collapse controls for short user messages", async () => { |
| 422 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 421 | it("does not render collapse controls for short user messages", () => { |
| 423 | 422 | const markup = renderToStaticMarkup( |
| 424 | 423 | <MessagesTimeline |
| 425 | 424 | {...buildProps()} |
| ... | ... | @@ -431,8 +430,7 @@ describe("MessagesTimeline", () => { |
| 431 | 430 | expect(markup).toContain('data-user-message-collapsible="false"'); |
| 432 | 431 | }); |
| 433 | 432 | |
| 434 | | it("renders inline terminal labels with the composer chip UI", async () => { |
| 435 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 433 | it("renders inline terminal labels with the composer chip UI", () => { |
| 436 | 434 | const markup = renderToStaticMarkup( |
| 437 | 435 | <MessagesTimeline |
| 438 | 436 | {...buildProps()} |
| ... | ... | @@ -459,8 +457,7 @@ describe("MessagesTimeline", () => { |
| 459 | 457 | expect(markup).toContain("Show full message"); |
| 460 | 458 | }, 20_000); |
| 461 | 459 | |
| 462 | | it("renders chips for standalone element-pick context messages", async () => { |
| 463 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 460 | it("renders chips for standalone element-pick context messages", () => { |
| 464 | 461 | const markup = renderToStaticMarkup( |
| 465 | 462 | <MessagesTimeline |
| 466 | 463 | {...buildProps()} |
| ... | ... | @@ -486,8 +483,7 @@ describe("MessagesTimeline", () => { |
| 486 | 483 | expect(markup).not.toContain("<element_context"); |
| 487 | 484 | }); |
| 488 | 485 | |
| 489 | | it("keeps the copy button for collapsed long user messages", async () => { |
| 490 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 486 | it("keeps the copy button for collapsed long user messages", () => { |
| 491 | 487 | const markup = renderToStaticMarkup( |
| 492 | 488 | <MessagesTimeline |
| 493 | 489 | {...buildProps()} |
| ... | ... | @@ -500,8 +496,7 @@ describe("MessagesTimeline", () => { |
| 500 | 496 | expect(markup).toContain('data-user-message-footer="true"'); |
| 501 | 497 | }); |
| 502 | 498 | |
| 503 | | it("renders context compaction entries in the normal work log", async () => { |
| 504 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 499 | it("renders context compaction entries in the normal work log", () => { |
| 505 | 500 | const markup = renderToStaticMarkup( |
| 506 | 501 | <MessagesTimeline |
| 507 | 502 | {...buildProps()} |
| ... | ... | @@ -525,8 +520,7 @@ describe("MessagesTimeline", () => { |
| 525 | 520 | expect(markup).toContain("Work Log"); |
| 526 | 521 | }); |
| 527 | 522 | |
| 528 | | it("formats changed file paths from the workspace root", async () => { |
| 529 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 523 | it("formats changed file paths from the workspace root", () => { |
| 530 | 524 | const markup = renderToStaticMarkup( |
| 531 | 525 | <MessagesTimeline |
| 532 | 526 | {...buildProps()} |
| ... | ... | @@ -552,8 +546,7 @@ describe("MessagesTimeline", () => { |
| 552 | 546 | expect(markup).not.toContain("C:/Users/mike/dev-stuff/t3code/apps/web/src/session-logic.ts"); |
| 553 | 547 | }); |
| 554 | 548 | |
| 555 | | it("renders review comment contexts as structured cards instead of raw tags", async () => { |
| 556 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 549 | it("renders review comment contexts as structured cards instead of raw tags", () => { |
| 557 | 550 | const markup = renderToStaticMarkup( |
| 558 | 551 | <MessagesTimeline |
| 559 | 552 | {...buildProps()} |
| ... | ... | @@ -593,8 +586,7 @@ describe("MessagesTimeline", () => { |
| 593 | 586 | expect(markup).not.toContain("&lt;/review_comment&gt;"); |
| 594 | 587 | }); |
| 595 | 588 | |
| 596 | | it("renders file review comments as source code instead of diffs", async () => { |
| 597 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 589 | it("renders file review comments as source code instead of diffs", () => { |
| 598 | 590 | const markup = renderToStaticMarkup( |
| 599 | 591 | <MessagesTimeline |
| 600 | 592 | {...buildProps()} |
| ... | ... | @@ -631,8 +623,7 @@ describe("MessagesTimeline", () => { |
| 631 | 623 | expect(markup).not.toContain('data-testid="file-diff"'); |
| 632 | 624 | }); |
| 633 | 625 | |
| 634 | | it("renders a failure marker for failed tool lifecycle entries", async () => { |
| 635 | | const { MessagesTimeline } = await import("./MessagesTimeline"); |
| 626 | it("renders a failure marker for failed tool lifecycle entries", () => { |
| 636 | 627 | const markup = renderToStaticMarkup( |
| 637 | 628 | <MessagesTimeline |
| 638 | 629 | {...buildProps()} |