Add rodney viewport command for viewport and mobile emulation#40
Open
johnwards wants to merge 2 commits into
Open
Add rodney viewport command for viewport and mobile emulation#40johnwards wants to merge 2 commits into
rodney viewport command for viewport and mobile emulation#40johnwards wants to merge 2 commits into
Conversation
Adds viewport/mobile emulation via Chrome's EmulationSetDeviceMetricsOverride CDP call: - `rodney viewport <w> <h> [--scale N] [--mobile]` — set viewport size - `rodney viewport --reset` — restore browser defaults - `rodney start --viewport WxH [--mobile] [--scale N]` — configure viewport at launch Viewport settings are persisted in state.json and re-applied on each subsequent command, matching rodney's ephemeral-process architecture. Also fixes a pre-existing bug where `rodney start --show` would hit the unknown flag error before reaching the headless flag parser. All start flags are now parsed in a single pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Previously, `rodney screenshot` always overrode the viewport to 1280x720 (scale 1), clobbering any viewport set via `rodney viewport`. Now it only applies its default viewport when no viewport override is active or when -w/-h are explicitly passed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Related to older PR #33 |
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 viewport <width> <height> [--scale N] [--mobile]command that sets the browser viewport size via Chrome'sEmulationSetDeviceMetricsOverrideCDP callrodney viewport --resetto clear the override and restore browser defaults (EmulationClearDeviceMetricsOverride)--viewport WxH,--mobile, and--scale Nflags torodney startfor configuring viewport at launch timestate.jsonand re-applied on each subsequent command, consistent with rodney's ephemeral-process architecturerodney screenshotnow respects the active viewport by default instead of always overriding to 1280x720 — pass-w/-hto explicitly overrideBug fix
Also fixes a pre-existing bug where
rodney start --showwould hit thedefault: fatal("unknown flag: ...")case in the flag-parsing loop before the--showflag was checked in a separate loop below. Allstartflags are now parsed in a single pass.Usage examples
Test plan
formatViewportDesc(basic, mobile, scale, combined, omission of scale 1/0)json.Marshal/Unmarshal)omitemptyverification — zero-value viewport fields excluded from JSONEmulationSetDeviceMetricsOverridesetsinnerWidthanddevicePixelRatioEmulationClearDeviceMetricsOverriderestores defaultsgo buildpasses🤖 Generated with Claude Code