sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

SwiftUI user interaction tracing

Open jvanderwee opened this issue 6 months ago • 3 comments

Problem Statement

Capture transactions for clicks when using SwiftUI

https://docs.sentry.io/platforms/apple/guides/ios/tracing/instrumentation/automatic-instrumentation/#user-interaction-tracing

Solution Brainstorm

No response

Are you willing to submit a PR?

No response

jvanderwee avatar Jun 17 '25 07:06 jvanderwee

Hi @jvanderwee, can you please add some more context to this issue?

Are you requesting us to add the tracking of taps on iOS or clicks on macoS? Is the documentation outdated or are you missing a specific functionality? While our docs do state that "User Interaction Tracing" is unavailable for SwiftUI, views which are backed by UIKit should be traceable using options.enableUserInteractionTracing. Did you try this, and if yes, which interactions where missing?

Giving us more context and usage examples helps us tremendously to add new features.

philprime avatar Jun 17 '25 07:06 philprime

Hey @philprime 👋 tracking of taps on iOS primarily, though tracking of taps on macOS would be great too. Our app is fully SwiftUI, we currently only see ui.action taps on our TabView items (presumably this is backed by UITabBar).

jvanderwee avatar Jun 17 '25 07:06 jvanderwee

From Cocoa Sync 06/18:

At this point in time the user interaction tracing collects events and attaches them to any upcoming event (e.g. a crash). Without any further event (e.g. a file operation), they are not actually reported like other spans (visible in "Discover").

We are currently working on span streaming, which will make user interaction tracing obsolete. We need to rethink the concept because it's confusing to send user interactions as transactions and instead wait for span streaming.

At this point in time we only have limited resources available to investigate this, unless the amount of requests for user interaction tracing in SwiftUI rises we'll have to push this back.

philprime avatar Jun 18 '25 13:06 philprime