Skip to content

fix: report the unfolded screen size in device.info on foldables - #91

Merged
gmegidish merged 1 commit into
mainfrom
fix-device-info-unfolded-size
Sep 29, 2026
Merged

gmegidish merged 1 commit into
mainfrom
fix-device-info-unfolded-size

Conversation

@gmegidish

Copy link
Copy Markdown
Member

Summary

device.info returned the cover display's size on foldables even when unfolded, because SpringBoard reports the cover display's frame regardless of the hinge.

  • device.info now uses the inner display's size when the foreground app is on it
  • Added OrientationGeometry.secondaryDisplaySize(), reusing the window-based size logic from fix: taps on folded foldables and unfolded springboard #89
  • Single-display devices keep the old path and skip the foreground app lookup

Result on iPhone Duo simulator (iOS 27.1)

Posture Before After
folded 466x678 466x678
half-open 466x678 669x951
open 466x678 669x951

Test plan

  • Build for the iPhone Duo simulator
  • device.info in folded, half-open and open postures
  • RPC test suite (tests/rpc.test.ts)
  • device.info on a non-foldable simulator
  • device.info on a real device

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 3116e91a-a044-45d4-a349-1fd387627fa8

📥 Commits

Reviewing files that changed from the base of the PR and between 59620a3 and 0aab855.

📒 Files selected for processing (2)
  • DeviceKitTests/JSONRPC/Handlers/DeviceInfo.swift
  • DeviceKitTests/XCTest/OrientationGeometry.swift
 ___________________________________________________
< Vibe code cleanup in progress... Expect swearing. >
 ---------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@gmegidish
gmegidish merged commit 5d499ae into main Sep 29, 2026
4 of 5 checks passed
@gmegidish
gmegidish deleted the fix-device-info-unfolded-size branch September 29, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant