Visual harness: stop print emulation wiping the color-scheme emulation - #2723
Merged
chalin merged 3 commits intoAug 18, 2026
Merged
Conversation
- Combines media type and prefers-color-scheme into one Emulation.setEmulatedMedia CDP call: Puppeteer's emulateMediaType and emulateMediaFeatures each send that command with only their own field, so the print call was erasing the scheme and print shots followed the machine's system appearance - Keeps the CDP session attached for the page's lifetime: detaching reverts its emulation overrides - Re-records the darwin print-dark goldens, the first genuine dark print renders (they were light-system shots); Linux CI goldens follow via the artifact updater
- Cuts the symptom replay (the commit/PR own the regression story), collapses the cause-consequence chain to one clause, and names the emulated feature (scheme) precisely
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
emulateMediaType('print')call wiped the preceding scheme emulation (it andemulateMediaFeaturesboth map to CDP's singleEmulation.setEmulatedMedia, each sending only its own field), so print shots followed the machine's system appearance: light-default Linux CI stayed green while macOS auto-dark broke local evening runs--force-dark-modeto simulate a dark system):