Repository navigation
feat(screenshot): support selector crops on CoreDevice iPhones - #3839
Conversation
|
The code looks right at 7ffc88b. The change is small: a matrix flag, docs, help text and tests. The one CI check is green, and it covers these files. There are no conflicts. One question before this goes further: the ios-physical cell in https://github.com/callstack/agent-device/blob/7ffc88b/packages/daemon/src/execution/screenshot-crop-target.ts#L49 covers every physical iPhone and iPad, plus the XCTest-backed physical backend and the devicectl-to-runner fallback, but the live run covers one portrait iPhone 12 on the default devicectl route. On an iPad the largest viewport root can be the app window, so the crop could be wrong. Would you give iPadOS its own rejected cell, or word the help and docs as iPhone-only verified? Not blocking, and you can take or leave these: the matrix test in https://github.com/callstack/agent-device/blob/7ffc88b/packages/daemon/src/execution/__tests__/screenshot-crop-target.test.ts#L63 hard-codes the accepted cells in an inline if-chain, so one shared list would keep it in sync, and the new fractional fixture adds rounding coverage but repeats the 3x law that the simulator case already pins. I did not run the tests locally. I took the iPhone 12 numbers from the PR body and could not re-inspect that run. Landscape, iPad, Split View, the XCTest-backed backend, the devicectl-to-runner fallback and Appium-produced physical iOS trees were not exercised. |
|
Thanks. I took the iPad point and gave physical iPadOS its own rejected cell, I also replaced the if-chain in the matrix test with a shared
|
|
The iPad point from my 7ffc88b review is fixed in aa9dec2, thank you. The XCTest backend and the runner fallback from that review are still open, so the code is not ready to merge yet. The For those runs, please show a non-trivially placed All 14 checks pass. No device lane runs the physical iOS screenshot route, so CI says nothing about the xctest backend or the runner fallback. There are no known conflicts. The iPhone 12 numbers come from the PR body. Before merge, either narrow the accepted physical iOS cell to the CoreDevice backend with a rejected xctest cell, or add the live evidence above. |
|
Addressed in Retested the unmodified commit on the iPhone 12: all 7,009 crop pixels match the independent raw capture exactly, maximum channel difference 0. Updated evidence is in the PR body. Local validation passed, including 4,362 tests. |
|
This PR is ready. At 9cf6410, the XCTest and runner-fallback problems from the earlier review are fixed, and the live run covers the accepted portrait CoreDevice case. Help and docs claim only what ran. All 14 checks pass. No CI lane runs the physical iOS screenshot route, so CI says nothing about the devicectl or runner paths. I did not reproduce the iPhone 12 pixel-identity numbers; they come from the PR body. I did not run the new tests; I read the code and judge that they would fail before this change. Cloud-provider physical iOS routes (Limrun, BrowserStack, AWS) return no capture backend, so they are now refused after capture. That fails closed, but I did not exercise it live. Not blocking, and you can take or leave these: the No conflicts. |
Summary
Accept physical iPhone selector crops only when CoreDevice/devicectl produced the image. XCTest devices, runner fallback, and unknown physical capture provenance are refused with the pending-evidence reason. Physical iPadOS remains rejected. Ordinary screenshots retain fallback behavior.
14 files; scope narrowed to the verified capture route. Refs #2276; addresses review feedback.
Validation
9cf6410, clean checkout, Node 22.20:
pnpm check:affected --run --head 9cf64106: passed,exactCommit=true; 4,362 related tests passed. GitHub-owned coverage/native/device jobs and manual replay lanes remain separate obligations.aa9dec28plus new tests 7 failed/33 passed;9cf6410640 passed. Failures detect missing backend facts and wrongly accepted XCTest/unknown crops.Fresh unmodified-head run, 2026-10-20: wired iPhone 12, iOS 27.0.1, Xcode 26.6; rebuilt CLI and isolated daemon/session, subsequently cleaned up.
Both exit 0. Crop 163×43, raw 1170×2532, origin (767,221): 7,009/7,009 RGBA pixels identical, maximum channel difference 0. Offset controls differ; best ±4px offset (0,0).
Portrait CoreDevice only is live-verified. Landscape is unverified; XCTest/runner fallback crop refusal is unit-tested, without claiming live pixel evidence for those routes.