Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c91868c5e2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const sourceY = Math.floor((y * source.height) / height); | ||
| for (let x = 0; x < width; x += 1) { | ||
| const sourceX = Math.floor((x * source.width) / width); |
There was a problem hiding this comment.
Map resize samples to include image boundaries
The nearest-neighbor mapping uses Math.floor((coord * sourceSize) / targetSize), which never reaches the last source row/column when downscaling; for example, a 3→2 resize samples columns 0 and 1 but never 2. That means screenshot --max-size systematically drops right/bottom edge pixels and shifts content toward the top-left, which can hide edge UI details and skew visual artifacts. Use a boundary-preserving mapping (endpoint- or center-based) so both source edges are representable in the resized output.
Useful? React with 👍 / 👎.
46f632c to
ebc5f63
Compare
|
953b889 to
805df47
Compare
805df47 to
fe5e007
Compare
Summary
Add
screenshot --max-size <px>/maxSizesupport to downscale saved PNG screenshots by longest edge without new dependencies.The resize runs in the runtime screenshot path before artifact publishing, preserves aspect ratio, only downscales, and round-trips through CLI/client/daemon replay scripts. Docs and the agent-device verification skill now mention the agent-friendly screenshot size option.
Closes #426
Validation
pnpm formatpnpm test:unit -- src/__tests__/runtime-public.test.ts src/__tests__/cli-client-commands.test.ts src/utils/__tests__/args.test.ts src/daemon/__tests__/context.test.ts src/daemon/handlers/__tests__/session-replay-script.test.ts src/daemon/__tests__/session-store.test.tspnpm check:quickpnpm check:unit