From d2892b11c533955b15a4f493f80d8f42bca1a1e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Berg=C3=A9?= Date: Fri, 7 Aug 2026 15:38:01 +0200 Subject: [PATCH 1/2] fix(vitest): size the Vitest iframe from the settled layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Screenshots taken through `@argos-ci/vitest` and the `@argos-ci/storybook` Vitest plugin were cut off, with the bottom of the page left blank. Both SDKs grow the Vitest tester iframe to fit the content, because anything overflowing the iframe box is never painted. They did that from `beforeScreenshot`, which the Playwright SDK runs *before* it waits for images and fonts. An `` that has not loaded takes no space, so the iframe was sized from a partially-loaded layout and everything below that height was never painted. Run the stabilization first, so the content has reached its final size before it is measured. The iframe was also never restored afterwards. The `"initial"` branch of `setIframeViewportSize` was guarded on the backed-up width being truthy, but the original inline width is an empty string, and the default (non-`viewports`) path never asked for a restore at all. Vitest reuses the same iframe for every test in a file, so each screenshot inherited the largest previous one — a single `