fix(server): select the active iPhone Duo display for screenshots#24912

merged3
main
GitHub fork: issue-watch/24900
opened22d agobySshivam
View on GitHubTwo-way sync enabledPR last imported 21d ago

This PR is only for the iPhone Duo fold and its screenshot bug. Unproven: the Xcode 27.2 HTTP 500 itself. Both of our Macs run Xcode 27.1 with no iOS 27.2 runtime, so the captures below show the 27.1 form of the same bug (a black image of the wrong display).

Refs #24900

What broke

T3 pins expo-device-hub 0.15.3. Its bundled serve-sim takes screenshots with xcrun simctl io <udid> screenshot <file> and never passes --display. The iPhone Duo simulator has two displays, and simctl picks one without looking at the fold. On Xcode 27.1 the Device panel's camera button then saves an all-black image whenever the Duo is in a different fold state from the one it booted in. On Xcode 27.2, simctl refuses to pick, exits with code 22, and T3 shows "Screenshot capture failed (500)".

What changed

One line in apps/server/src/device/deviceToolVersions.json: expo-device-hub 0.15.3 → 0.19.0-canary-20261023-1357114. That build's serve-sim passes --display=<active display> (expo/expo-device-hub#384 and #388) and reads the Duo's pose from the simulator.

The pin is a prerelease because no stable release has the fix. npm latest is still 0.18.0, which still calls simctl without --display (checked 2026-10-25). Once 0.19.0 stable ships, the pin should move to it.

Fold and unfold

A new iPhone Duo booted closed, then taken through every fold and stand button in the Device panel. Each column shows the T3 panel and the PNG the camera button saved.

  • main: once the Duo is opened, every saved screenshot is black, through Book, Laptop and Tent. Closing it again leaves the 3D view showing the phone edge-on, and Tent stand fails with an error.
  • This PR: every saved screenshot is the display that is on (1398×2034 cover when closed, 2853×2007 inner when open). All five fold and stand states work.

Recordings

Device panel open on a folded iPhone Duo that booted open. Each recording shows the hub pin in use, clicks the camera button (the red outline marks it), then shows the saved PNG.

main, hub 0.15.3: the saved image is 2007×2853 and all black, the inner display that is switched off.

https://github.com/user-attachments/assets/d9858fe5-0849-45be-8390-541e5fb58a0a

This PR: the saved image is 1398×2034, the cover display that is on screen.

https://github.com/user-attachments/assets/b7d142f9-cf4e-4a5f-89f0-4f7499c053df

Rest of the Device panel

The newer hub also carries the other upstream hub changes since 0.15.3. I ran the same checks on main and on this PR: iPhone (video, tap, typing, swipe, Home, appearance, text size, accessibility toggles, element frames, event log, screenshot, reconnect), the Android tablet emulator (video, tap, typing, Back, Home, Recents, orientation, appearance, text size, element frames, screenshot), and a remote SSH device host, including an existing host moving from 0.15.3 to this version. All behaved the same, with one difference: rotating an iPhone.

On main, rotate did nothing on the home screen. With this PR the phone frame turns like a real phone, and screens that stay upright (home screen, Settings) show sideways inside it, as in Xcode's Simulator window. Taps still land on the right spot while turned.

Testing

  • Head 8c20cdfbe (main merged in), run on shiv (Mac mini, macOS 27.0.1, Xcode 27.1 build 27A9275) with node scripts/dev-runner.ts dev --home-dir <tmp> --no-seed, so T3 installed the pinned hub into its own folder. For main, deviceToolVersions.json was set back to 0.15.3 and the dev server restarted the hub; nothing else differed.
  • Remote host: a dev server on a Linux machine with shiv added as an SSH device host.
  • No tests added, since the change is a version string. Required CI is green.

Implemented and tested with Claude Opus 5.5 in Claude Code; first investigation and review by gpt-6.1-sol in Codex.

🤖 Generated with Claude Code

Checks

1 pending · 20 successful · 16 skipped
Checks in progress

In progress1

a48bb6a

Added 1 commit

  • fix(server): update Device Hub so iPhone Duo screenshots pick a display54aa2ab
Synced from GitHub

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — This focused dependency pin changes the default Device Hub used by existing local-device installations and screenshot requests, including a canary release with additional intervening changes. Because it changes a product default, the change warrants human review despite the two-line diff.

No code changes detected at a48bb6a. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review.

External image Recent review info
External image Run configuration
External image Commits

Reviewing files that changed from the base of the PR and between 5b35402623d7d1d88eaa472807272a6c2e78012a and 54aa2ab2788b804ad28dc03433f8a24c3a2ee1bf.

External image Files selected for processing: 1
  • apps/server/src/device/deviceToolVersions.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The configured expo-device-hub version changes from 0.15.3 to 0.19.0-canary-20261023-1357114.

Changes: Device tool version

Layer / File(s)Summary
Update the expo-device-hub pin
apps/server/src/device/deviceToolVersions.json
The configured expo-device-hub version changes to 0.19.0-canary-20261023-1357114.

Priority: External image Normal

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • pingdotgg/t3code#24900 — The issue reports screenshot failures on two-display devices with Xcode 27.2 when using version 0.15.3. This change pins the version identified in the issue as fixed; runtime verification is not established.

Suggested labels: size:XS

Merge Risk: External image Minimal · up to 54aa2

The PR changes only the managed Device Hub version pin, with no established merge-blocking defect.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check nameStatusExplanationResolution
Description checkWarningThe description clearly explains the problem, the version-pin change, test environment, verification steps, observed results, limitations, and agent usage. It does not include the required Scope and a…Add a link to the triaged issue or approval discussion, including the maintainer approval comment. If this is an obvious focused fix or established-capability configuration that does not require prior approval, explain why it qualifies unde…
Passed Passed checks: 3 passed
Check nameStatusExplanation
Title checkPassedThe title clearly identifies the intended fix: selecting the active iPhone Duo display for screenshots. This matches the pull request objective, although the implementation uses a Device Hub dependenc…
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title clearly identifies the intended fix: selecting the active iPhone Duo display for screenshots. This matches the pull request objective, although the implementation uses a Device Hub dependency pin.

Full details: Description check

Explanation

The description clearly explains the problem, the version-pin change, test environment, verification steps, observed results, limitations, and agent usage. It does not include the required Scope and approval information: the reference to #24900 does not show explicit maintainer approval of the direction and scope.

Resolution

Add a link to the triaged issue or approval discussion, including the maintainer approval comment. If this is an obvious focused fix or established-capability configuration that does not require prior approval, explain why it qualifies under the template.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Added 1 commit

  • fix(server): keep current device tools with the Duo screenshot fix8c20cdf

Note

Written by gpt-6.1-sol on behalf of Maria

Preserved @shivamhwp's commit and merged current main at 34ead566d448. Resolved the version-file conflict by keeping main's agent-device 0.21.31 and this PR's Device Hub canary. The final change against main remains one line; nothing from the original fix was dropped.

Verification at 8c20cdfbea5bd151c7d7a7761c20a3c9351415b7:

  • Blacksmith: vp run check:changed passed (format, generated GraphQL, affected server/scripts typechecks); device-directory lint passed; all 28 existing toolchain/local-host/maintenance tests passed.
  • T3's real installer downloaded the canary into a disposable directory, reported the correct version, and reused the completed install. Its CLI help ran successfully.
  • Compared both published bundles: 0.15.3 omits display selection; the canary selects the active display and retries when folding changes it. Two independent source/artifact reviews found no actionable compatibility issues in the local/SSH CLI flags, proxy routes, client capture, or MCP capture paths.
  • Latest CI completed without failures. CodeRabbit's latest review was rate limited; its original review had no actionable findings.

Still waiting on human approval for the canary default and integrated iPhone Duo toolbar verification. This Linux VM has no Xcode/CoreSimulator or connected Mac, so I could not reproduce the real before/after capture, inspect fresh evidence, or verify Xcode 27.2. The author's existing Xcode 27.1 recordings remain in the PR body; they are not verification from this takeover. No new test files or synthetic screenshot evidence were added for this version-only change.

Added 1 commit

  • Merge branch 'main' into issue-watch/24900a48bb6a