Files
Oleg Isonen bc29c51be8 fix: Recover Linux screenshots and fragment captures (#6589)
# 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.
2026-10-24 01:16:54 +02:00
..
2025-05-25 14:26:40 +03:00