fix(cdp): scale FakeDriver viewport rects to configured target - #125
Merged
Conversation
Closes #121 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
aram-devdocs
added a commit
that referenced
this pull request
Apr 28, 2026
Add an end-to-end CLI regression for #121 against the JSON formatter: `plumb lint plumb-fake://hello --viewport mobile --format json` against a `[viewports.mobile]` config MUST emit `"width": 375 / "height": 812` rects, not the canned desktop `1280x800`. PR #125's fix is at the FakeDriver layer; this guards the symptom at the layer the issue was reported (CLI + JSON). Audit follow-up: PR #125 merged with the Claude review check failed (SDK max-turns infrastructure error, not a code finding) so no recorded approval verdict exists. All other gates passed. This PR adds the missing CLI-level regression test so the acceptance-criteria check is durable. Refs #121.
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.
Summary
FakeDriver::snapshotalready retargetedviewport/viewport_width/viewport_heightper request, but the per-noderectvalues fromPlumbSnapshot::canned()(html and body) stayed at the canned1280×800. Multi-viewport runs againstplumb-fake://hellotherefore reportedmobileviewports withdesktoprects.(0, 0, canned_w, canned_h)is rewritten to the requested target'swidth/height. Captured before the field assignments so there are no magic numbers.crates/plumb-cdp/tests/snapshot_all_default.rs::fake_driver_rewrites_viewport_sized_rects_to_targetrequestsmobile375×667 and asserts both html and body rects come back at 375×667.Test plan
cargo test -p plumb-cdp --test snapshot_all_default— both tests passcargo test -p plumb-cdp— crate suite passescargo test --workspace— workspace passescargo clippy -p plumb-cdp --all-targets -- -D warnings— cleancargo fmt --all -- --check— cleanCloses #121
🤖 Generated with Claude Code