Add rodney viewport command for persistent viewport resizing#33
Open
matthewbjones wants to merge 1 commit into
Open
Add rodney viewport command for persistent viewport resizing#33matthewbjones wants to merge 1 commit into
rodney viewport command for persistent viewport resizing#33matthewbjones wants to merge 1 commit into
Conversation
Adds a new `viewport` command that uses CDP's EmulationSetDeviceMetricsOverride to set the browser viewport, enabling responsive testing with CSS media queries. - `rodney viewport` — print current viewport size - `rodney viewport 390 844` — set viewport (persists across commands) - `rodney viewport --reset` — reset to default Viewport dimensions are saved to the state file and re-applied on each command invocation, since CDP emulation overrides are scoped to the session. The screenshot command also respects the saved viewport when no explicit -w/-h flags are given. Closes simonw#32 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This would be great! Just ran into this using Rodney for the first time today. |
9 tasks
Author
|
@simonw are you looking for contributions and/or assistance with maintaining this project? The tool has been great to use so far, getting used daily on projects I'm working on. |
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
rodney viewportcommand to get/set/reset the browser viewport size using CDP'sEmulationSetDeviceMetricsOverridewithPage())rodney screenshotrespects the saved viewport when no explicit-w/-hflags are givenUsage
Motivation
When doing QA testing at different viewport sizes, I need to interact with the page at a specific viewport — not just take a screenshot. For example, clicking a mobile hamburger menu or testing mobile-only UI elements. The existing
screenshot -w/-hflags set the viewport only for the duration of the capture.Closes #32
Test plan
go test ./...passeswindow.innerWidthconfirms resize, CSS media queries trigger correctly,--resetrestores default, screenshot respects saved viewport