Repository navigation
Conversation
|
@TUNA-NOPE is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
1 issue found across 14 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/capture-kit/src/screenshot-density.ts">
<violation number="1" location="packages/capture-kit/src/screenshot-density.ts:76">
P2: A `--native-density` capture with no measured source density returns no `logicalWidth`/`logicalHeight`/`pixelDensity` and raises no error. The caller then cannot map pixels to taps, which is the purpose of native mode. Fail explicitly here instead of silently omitting the fields, or make the runner path report its density.</violation>
</file>
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
| const pixelDensity = params.nativeDensity | ||
| ? params.sourcePixelDensity | ||
| : resolveScreenshotPixelDensity(params.requestedPixelDensity); | ||
| if (pixelDensity === undefined) return result; |
There was a problem hiding this comment.
P2: A --native-density capture with no measured source density returns no logicalWidth/logicalHeight/pixelDensity and raises no error. The caller then cannot map pixels to taps, which is the purpose of native mode. Fail explicitly here instead of silently omitting the fields, or make the runner path report its density.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/capture-kit/src/screenshot-density.ts, line 76:
<comment>A `--native-density` capture with no measured source density returns no `logicalWidth`/`logicalHeight`/`pixelDensity` and raises no error. The caller then cannot map pixels to taps, which is the purpose of native mode. Fail explicitly here instead of silently omitting the fields, or make the runner path report its density.</comment>
<file context>
@@ -55,11 +63,17 @@ export async function readScreenshotResultMetadata(params: {
+ const pixelDensity = params.nativeDensity
+ ? params.sourcePixelDensity
+ : resolveScreenshotPixelDensity(params.requestedPixelDensity);
+ if (pixelDensity === undefined) return result;
return {
...result,
</file context>
| if (pixelDensity === undefined) return result; | |
| if (pixelDensity === undefined) { | |
| throw new AppError('COMMAND_FAILED', 'Native screenshot did not report its source pixel density'); | |
| } |
|
I read 80cdf2c. The change needs one more test before it is ready. The only failing check is Vercel, which asks a Callstack team member to authorize a fork deployment, so it is not a build failure and this diff touches no website code. Only two checks ran, so the repo gates (format, layering, closure budget, Fallow, wire ledger) have not run on this head yet. The behavior that makes the feature work has no test. That is the early return that skips the resample and reports the measured scale (https://github.com/callstack/agent-device/blob/80cdf2c/packages/platform-apple/src/core/screenshot.ts#L489), plus the route that carries the density to the command result. The new tests only call Not blocking, and you can take or leave these: the PR body gives live iPhone 17 Pro results without a tested SHA, commands or output ( One design question. Could native be a value of the existing density option end to end, as The open inline thread on the script flag round-trip test still stands (#4111 (comment)), and four lower-priority threads on the help text, the field description, the journal spec and I did not run a simulator or reproduce the 3005-passed unit run, so the live numbers, the tap-mapping claim and the refused flag combination are taken from the PR body. I read Before merge, please add the platform-apple and daemon-route tests that fail without the native branch, settle the single-spelling question, and run |
|
This conflicts with main now. Please rebase it so review can continue. |
80cdf2c to
a542688
Compare
|
Rebased onto main at c96a2d5 to resolve the conflict. New head a542688. Conflicts in:
One small added commit, "chore: adapt to main after rebase": the Revyl iOS screenshot now skips the density resample for a native capture (the type is now No other changes. |
|
a542688 is the rebase onto main. The earlier conflict is gone, but two routes still admit On an iOS simulator, Revyl iOS has the same gap. A Revyl iOS device is built as an Apple simulator (device.ts), so the daemon admits The earlier test request is still unanswered. The head adds The only live run is in the PR body for the pre-rebase head, with no SHA, command or output. This head re-applies the density change onto main's reworked simulator flow, which is device-facing. Please post a run at a542688 on a booted iPhone simulator through the default simctl route, with exact commands and JSON output. Could one The open inline threads still apply. Two are P2: the round-trip test for appendScreenshotScriptFlags and the undefined-density branch, which is now reachable through the runner backend and Revyl iOS, so please fix it at those owners instead of throwing generically. The four P3 threads also still apply: cliDetail and captureBackend help, nativeDensity description scope, journal projection and ScreenshotCommandResult type. None can be resolved yet. This review traced the head source only. I did not run a simulator, the unit suite or typecheck. I traced only Revyl, so other providers such as Limrun iOS may need the same check. |
iOS simulator screenshots default to 1x points, and --pixel-density needs the caller to know each device's scale. A caller that wants what the display shows would have to guess, and a wrong guess resamples the image. --native-density skips the density step and keeps the captured pixels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The command surface checks pixelDensity as an integer, so 'native' could not pass through it. A live simulator run caught this; unit tests did not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A caller maps native pixels to tap coordinates with the display's scale, so return the measured density and logical size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
a542688 to
aff9e50
Compare
|
Update on head
|
|
Thanks for the update. The code looks right at 38ec649, and the replay, help, journal and result-type gaps are fixed. The live simulator run from the earlier review is still missing, so this is not ready yet. The simctl capture path has no live run at this head. The earlier results predate two rebases onto main's reworked simulator flow, and unit stubs cannot show that a real capture keeps physical pixels or that a tap from native pixels lands. Please post a run at this commit on a booted iPhone simulator, on the default simctl route, with commands and
The unreachable-branch comment does not apply, because an admitted native request always gets a measured scale on the simctl path. These are fixed and can be resolved: replay, help text, simulator-only wording, journal field, result type. Not blocking: commits 1edaf2e and 38ec649 fix test problems unrelated to screenshot density, so a separate PR would keep this one focused. |
|
This branch now conflicts with main at 38ec649. Please rebase or merge main and resolve it. The live evidence my last review asked for still applies after the rebase. |
Summary
Add
--native-densityfor iOS simulator screenshots to retain captured pixels and report the scale and logical dimensions for tap mapping. Native density is admitted only by capture owners that report the scale; explicit runner and provider captures are refused. The option is carried consistently as a boolean.Validation
38ec6490; base:093341a60.pnpm check:affected --run --base origin/main --head HEADpassed all runnable local checks at the exact commit: format, lint, typecheck, layering, fallow, build, related tests and unit checks. Unit tests: 17,667 passed, 70 skipped; the unit check also ran its smoke and temporary-file checks.