mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-10-24 20:17:07 +09:00
# Screenshot failures on Linux and fragment captures On the reported Linux host, Chrome aborted before screenshot capture. This PR keeps the normal launch unchanged and makes the existing second attempt use Chrome's shared-memory fallback on Linux. The original host is unavailable, so this is a best-effort recovery, not a proven fix for that host. On #6580's project, a fragment URL made Webstudio mark a navigation link active in the browser while the server rendered it inactive. That mismatch caused a React hydration warning, which the current MCP screenshot tool correctly rejected. The link now renders consistently during hydration and becomes active afterward. The exact project's managed MCP responsive capture then succeeded twice at desktop and mobile sizes; both PNG files existed. Closes #6587 Closes #6580 ## Work - [x] Add a Linux-only fallback on the existing browser startup retry. - [x] Add a regression test that fails without the Linux fallback. - [x] Make initial fragment-link rendering match server and browser during hydration; preserve active-link behavior afterward. - [x] Add a hydration regression test that fails before and passes after the fix. - [x] Verify the exact-project managed MCP fragment capture at 1440×900 and 390×844, `waitUntil: load`, `waitForSelector: img`. - [x] Review `docs/`: the existing link and screenshot instructions remain accurate; no docs edit is needed. - [x] Run focused Vision/CLI, link and router-link tests; relevant typechecks, formatting, lint, builds, and diff checks. - [x] Independently review the complete diff. - [x] Review required CI checks: all checks on `e79053414e` passed (visual regression was skipped by its workflow). Remaining costs and limits: a Linux browser still makes the first startup attempt before the fallback. The fragment capture still needs the generated preview and browser startup. The original CLI 0.306.0 second-viewport timeout and the Linux reporter's host were not retested with this patch. This PR does not add a diagnostic PNG on readiness timeout or a new section-scroll control. We are closing these reports on merge with those limits understood; if the symptoms recur, they need a new report.
Vision
@webstudio-is/vision provides source-agnostic browser capture, screenshot
comparison, OCR analysis, caching primitives, and portable visual reports.
Import the smallest relevant entry point:
import { createBrowserScreenshotSession } from "@webstudio-is/vision/browser";
import { captureVisualEntries } from "@webstudio-is/vision/capture";
import { diffPngFiles } from "@webstudio-is/vision/diff";
import {
classifyScreenshotComparisonReport,
writeScreenshotComparisonReport,
} from "@webstudio-is/vision/report";
import { selectRepresentativeViewports } from "@webstudio-is/vision/viewports";
Consumers own their source-specific orchestration. The visual regression runner, for example, handles Git revisions and Storybook CSF rendering while this package handles capture batches, image comparison, and reports.