Skip to content

feat(breadcrumbs): Add hinge state breadcrumbs - #9426

Open
itaybre wants to merge 4 commits into
mainfrom
feat/hinge-breadcrumbs
Open

itaybre wants to merge 4 commits into
mainfrom
feat/hinge-breadcrumbs

Conversation

@itaybre

@itaybre itaybre commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Add a device.event breadcrumb when the hinge of a foldable device, such as iPhone Duo, opens or closes. The breadcrumb carries the direction of the movement (opening or closing), 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

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 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

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.
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against fdd09a6

@itaybre itaybre added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Oct 22, 2026
@sentry

sentry Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Size Analysis

1 component analyzed

iOS Builds

Name Configuration Version Download Size Install Size
SDK-Size (iOS)
io.sentry.sample.SDK-Size
Release 9.31.0 (1) 1.2 MB (+6.9 KB) 3.1 MB (0 B)

Configure sentry-cocoa status check rules

@sentry

sentry Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
SDK-Size io.sentry.sample.SDK-Size 9.31.0 (1) Release

⚙️ sentry-cocoa Build Distribution Settings

@itaybre

itaybre commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

Example
image

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.
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 branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(breadcrumbs): Add hinge state breadcrumbs

1 participant