Repository navigation
Conversation
Add a device.event breadcrumb when the hinge of a foldable device, such as iPhone Duo, moves between closed, partially open, and fully open. The breadcrumb carries the new and previous status and the hinge angle in degrees. Angle-only updates and the initial posture are ignored to keep the trail short. UIHingeInteraction only exists in the iOS 27.1 SDK, which is newer than the oldest supported Xcode, and the XCFramework is built with an older Xcode. The interaction is therefore created through the Objective-C runtime so the feature ships in every distribution and is a no-op on runtimes without the class.
Contributor
|
Size Analysis1 component analyzed iOS Builds
|
📲 Install BuildsiOS
|
Collaborator
Author
Replace the hinge angle in the breadcrumb with a direction of opening or closing. A breadcrumb is added once the hinge moved at least 45 degrees since the last breadcrumb, or once it reaches the fully open or closed position. The angle alone was hard to read in a trail and status transitions missed the direction of the movement.
itaybre
marked this pull request as ready for review
October 23, 2026 13:58
itaybre
requested review from
NinjaLikesCheez,
noahsmartin and
philprime
as code owners
October 23, 2026 13:58
4 of 9 tasks
The hinge can report the closed or fully open status before its angle settles. A later update with the same status and an angle change of 45 degrees or more passed the movement threshold and added a second breadcrumb for the same end position. Skip updates that repeat the last reported end position and only track their angle, so the next movement is measured from the settled position.
Report the current hinge status of foldable devices as hinge_status in the device context, using the same values as the hinge breadcrumbs: closed, partially_open, or fully_open. The key is omitted until UIKit reported a hinge, so devices without one and runtimes before iOS 27.1 are unchanged. Watchdog termination events drop the key together with orientation and battery, because it describes the current run. Move the hinge observer into the dependency container so the breadcrumb integration, which starts it, and the extra device context, which reads its latest state, share one instance.
This was referenced Oct 23, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add a
device.eventbreadcrumb when the hinge of a foldable device, such as iPhone Duo, opens or closes. The breadcrumb carries the direction of the movement (openingorclosing), the new status, and the previous status, so a crash or error after a fold shows the device posture leading up to it.Dynamic UIHingeInteraction lookup
UIHingeInteractiononly exists in the iOS 27.1 SDK, which is newer than the oldest supported Xcode, and the XCFramework is built with an older Xcode. The observer creates the interaction through the Objective-C runtime instead of referencing the symbols, so the feature ships in every distribution and is a no-op on runtimes without the class. One interaction is attached to each app window and to every window that later becomes key, because UIKit only delivers hinge updates inside a view hierarchy.Breadcrumb filtering
The hinge reports angle updates continuously while folding, so a breadcrumb is only added once the hinge moved at least 45 degrees since the last breadcrumb, or once it reaches the fully open or fully closed position. The first observed state only seeds the comparison. The end positions define the direction on their own, so reaching them with a negligible angle change still reports the correct direction.
Closes #9431