Autocapture: frustration signals for React Native - #447
Conversation
Update the React Native bridge to accept autocaptureOptions during initialization and pass them to both iOS and Android native SDKs. Enables walkUpToClickableParent(true) so native autocapture correctly resolves $el_id from accessibilityLabel on React Native view wrappers instead of leaf text views. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ions level Update the bridge to set walkUpToClickableParent on AutocaptureOptions instead of ClickOptions, matching the native SDK refactor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Read default values from RageClickOptions() and DeadClickOptions() instances instead of hardcoding 4, 1000, 44, 500. This ensures the bridge automatically picks up any default changes in the native SDK. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…APIs Add public methods for developers to manually track click, rage click, and dead click events with full element metadata (ClickEventData). This enables custom frustration signal detection in cases where the SDK's automatic detection cannot cover. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ocapture methods Move trackScreenView, trackScreenLeave, trackClick, trackRageClick, and trackDeadClick to pure JS implementations that call track() directly with the correct event names and property mappings. This eliminates 5 native bridge methods on each platform (Android + iOS) and their ObjC declarations, since none of these methods require native view access. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Expose walkUpToClickableParent as a top-level AutocaptureOptions field (default true) instead of hardcoding it in the native bridge. Developers can now disable it if their React Native app has proper accessibility identifiers on leaf views. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add missing documentation examples for trackScreenView, trackScreenLeave, trackClick, trackRageClick, trackDeadClick, and autocapture init options including walkUpToClickableParent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Confidence Score: 4/5The PR is not yet safe to merge because clean Android builds still cannot resolve the locally published beta dependency. The previously reported dependency issue remains: the Android module requires Files Needing Attention: android/build.gradle
|
| Filename | Overview |
|---|---|
| index.js | Normalizes autocapture configuration and adds pure-JavaScript frustration-signal and screen tracking. |
| index.d.ts | Defines the new autocapture options, click-event payload, and public tracking methods. |
| android/src/main/java/com/mixpanel/reactnative/MixpanelReactNativeModule.java | Converts bridged configuration into Android native autocapture options. |
| ios/MixpanelReactNative.swift | Converts bridged configuration into iOS native autocapture options. |
| android/build.gradle | Selects the Android SDK beta through Maven Local. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
JS[React Native configuration] --> N[Normalize autocapture options]
N --> A[Android native options]
N --> I[iOS native options]
API[Autocapture tracking APIs] --> T[Standard Mixpanel event tracking]
Reviews (5): Last reviewed commit: "Merge branch 'feat/autocapture' into rah..." | Re-trigger Greptile
| implementation 'com.facebook.react:react-native:+' | ||
| implementation 'com.mixpanel.android:mixpanel-android:8.9.0' | ||
| // Local mixpanel-android with autocapture support (publish locally with: ./gradlew :analytics:publishToMavenLocal -x signReleasePublication) | ||
| implementation 'com.mixpanel.android:mixpanel-android:9.0.0-beta' |
There was a problem hiding this comment.
…test screen Remove walkUpToClickableParent from AutocaptureOptions — it is now always-on in the native SDKs. Add WalkUpTestScreen to MixpanelStarter sample app. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…idden by clickable parent Walk-up always takes the nearest clickable ancestor's identity, even when the leaf has its own accessibilityLabel. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…havior Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-frustration-signals-react-native
| s.dependency "React-Core" | ||
| s.dependency "Mixpanel-swift", '6.5.0' | ||
| # Local mixpanel-swift with autocapture support | ||
| s.dependency "Mixpanel-swift", '~> 6.5' |
There was a problem hiding this comment.
I know this is local but we could miss this considering the actual release is 6.5.0 and the local testing is 6.5. Lets be careful with making sure we change to correct value.
| } | ||
| } | ||
|
|
||
| @ReactMethod |
There was a problem hiding this comment.
Why are these 2 methods removed?
Summary
trackClick,trackRageClick,trackDeadClickAPIs onAutocaptureclass as pure JS (no native bridge round-trips)trackScreenViewandtrackScreenLeaveto pure JS as wellwalkUpToClickableParentconfigurable (defaulttrue) at theAutocaptureOptionslevel@exampleJSDoc blocks to all public autocapture APIsClickEventData,AutocaptureOptions, andAutocaptureclassTest plan
trackClick,trackRageClick,trackDeadClicksend correct event names and propertieswalkUpToClickableParentis passed through to native SDKstrackScreenViewandtrackScreenLeavework as pure JS🤖 Generated with Claude Code