From cbad0910c1a0ad9f116c0504c1bad4ceb5cd2ede Mon Sep 17 00:00:00 2001 From: Alexis Yushin Date: Sat, 17 Oct 2026 10:47:37 -0400 Subject: [PATCH] Tests: the inbox transcript fixture sizes elements by client box too @tanstack/virtual-core 3.19.6 (TanStack/virtual#1326) measures the scroll viewport with clientWidth/clientHeight instead of offsetWidth/offsetHeight. The inbox attachments test gave happy-dom elements a 640 x 640 viewport through the offset box only, so under 3.19.6 the transcript measured 0 x 0, rendered no rows, and "an attachment in the conversation previews in Related" could not find the attachment. The stack lane resolves dependencies fresh (pnpm 11's one-day minimum release age made 3.19.6 eligible on 2026-10-17 ~11:20 UTC), so the lane went red on main and on every open PR from then on. The fixture now sizes both boxes, so it models a viewport whichever one the virtualizer measures. Browsers report real client sizes; product code is unaffected. Claude-Session: https://claude.ai/code/session_01VvRPgo3mVuL9ULgDSeZGBV --- .../angee/nexus/web/src/inbox/attachments.native.test.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/angee/nexus/web/src/inbox/attachments.native.test.tsx b/addons/angee/nexus/web/src/inbox/attachments.native.test.tsx index 1f62953b1..9cdd024bf 100644 --- a/addons/angee/nexus/web/src/inbox/attachments.native.test.tsx +++ b/addons/angee/nexus/web/src/inbox/attachments.native.test.tsx @@ -21,8 +21,12 @@ import type { InboxNavigation, InboxScope } from "./state"; const { Provider, createClient, clearClients } = createUiTestProviders({ apiUrl: "test://inbox-files", providerNames: [] }); // The transcript virtualizes its rows over the measured viewport, which happy-dom -// reports as zero-sized; give elements a viewport so the rows render. +// reports as zero-sized; give elements a 640 x 640 viewport so the rows render, +// whichever box the virtualizer measures (@tanstack/virtual-core reads the client +// box since 3.19.6, the offset box before). beforeEach(() => { + vi.spyOn(HTMLElement.prototype, "clientHeight", "get").mockReturnValue(640); + vi.spyOn(HTMLElement.prototype, "clientWidth", "get").mockReturnValue(640); vi.spyOn(HTMLElement.prototype, "offsetHeight", "get").mockReturnValue(640); vi.spyOn(HTMLElement.prototype, "offsetWidth", "get").mockReturnValue(640); });