Uh oh!
There was an error while loading. Please reload this page.
feat(core): Extract text from children of touched components for breadcrumb labels - #6106
Conversation
…dcrumb labels Walks the React fiber tree downward (child/sibling) to extract text content from touched components as a lowest-priority label fallback. Gated on Session Replay's maskAllText setting and respects per-view Sentry.Mask boundaries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
antonis
commented
May 7, 2026
@sentry review |
antonis
commented
May 7, 2026
@cursor review |
Uh oh!
There was an error while loading. Please reload this page.
…raction Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The prop defaults to true but effective behavior depends on maskAllText, which defaults to true in mobileReplayIntegration, disabling extraction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…child fibers In real React Native fiber trees, <Text>Hello</Text> has both memoizedProps.children = 'Hello' on the Text fiber and a child HostText fiber with memoizedProps = 'Hello'. Skip child recursion when props.children is a string to avoid collecting the same text twice. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f14d1f9. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
lucas-zimerman
commented
May 8, 2026
Would it be possible to add a depth limit & sibling limit test? |
…perty Address review feedback: default to not extracting text when the MobileReplay integration exists but has no options, consistent with the safe-by-default masking behavior. Fix misleading test name/assertion and add @default JSDoc tag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
antonis
commented
May 8, 2026
Good idea 👍 Added with 6fdacc4 |
📲 Install BuildsAndroid
|
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3817909+dirty | 1183.90 ms | 1187.50 ms | 3.60 ms |
| 23598c3+dirty | 1207.00 ms | 1209.90 ms | 2.90 ms |
| 890d145+dirty | 1223.59 ms | 1231.37 ms | 7.78 ms |
| bc0d8cf+dirty | 3830.33 ms | 1220.52 ms | -2609.81 ms |
| 8929511+dirty | 1216.42 ms | 1219.02 ms | 2.60 ms |
| 4b87b12+dirty | 1212.90 ms | 1222.09 ms | 9.19 ms |
| 7ac3378+dirty | 1213.37 ms | 1218.15 ms | 4.78 ms |
| 5c1e987+dirty | 1204.30 ms | 1222.15 ms | 17.85 ms |
| 5569641+dirty | 3839.22 ms | 1231.30 ms | -2607.91 ms |
| c004dae+dirty | 3850.32 ms | 1227.79 ms | -2622.53 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3817909+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 23598c3+dirty | 3.38 MiB | 4.80 MiB | 1.42 MiB |
| 890d145+dirty | 3.38 MiB | 4.77 MiB | 1.38 MiB |
| bc0d8cf+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 8929511+dirty | 3.38 MiB | 4.80 MiB | 1.42 MiB |
| 4b87b12+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
| 7ac3378+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
| 5c1e987+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 5569641+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| c004dae+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4953e94+dirty | 442.02 ms | 456.52 ms | 14.50 ms |
| 04207c4+dirty | 459.19 ms | 518.54 ms | 59.35 ms |
| 2c735cc+dirty | 414.09 ms | 438.47 ms | 24.38 ms |
| 44c8b3f+dirty | 414.20 ms | 457.28 ms | 43.08 ms |
| d2eadf8+dirty | 414.64 ms | 454.56 ms | 39.92 ms |
| c004dae+dirty | 412.86 ms | 481.50 ms | 68.64 ms |
| ad66da3+dirty | 468.46 ms | 533.56 ms | 65.10 ms |
| 8929511+dirty | 405.33 ms | 452.16 ms | 46.83 ms |
| 100ce80+dirty | 463.66 ms | 539.56 ms | 75.90 ms |
| df5d108+dirty | 527.06 ms | 603.58 ms | 76.52 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4953e94+dirty | 43.75 MiB | 48.08 MiB | 4.33 MiB |
| 04207c4+dirty | 43.75 MiB | 48.12 MiB | 4.37 MiB |
| 2c735cc+dirty | 43.75 MiB | 48.08 MiB | 4.33 MiB |
| 44c8b3f+dirty | 48.30 MiB | 53.46 MiB | 5.15 MiB |
| d2eadf8+dirty | 48.30 MiB | 53.48 MiB | 5.18 MiB |
| c004dae+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| ad66da3+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| 8929511+dirty | 43.75 MiB | 48.16 MiB | 4.41 MiB |
| 100ce80+dirty | 48.30 MiB | 53.46 MiB | 5.15 MiB |
| df5d108+dirty | 43.75 MiB | 48.08 MiB | 4.33 MiB |
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3817909+dirty | 1210.76 ms | 1215.64 ms | 4.89 ms |
| 23598c3+dirty | 1223.59 ms | 1229.13 ms | 5.53 ms |
| 890d145+dirty | 1212.98 ms | 1220.10 ms | 7.12 ms |
| bc0d8cf+dirty | 3834.64 ms | 1223.91 ms | -2610.73 ms |
| 8929511+dirty | 1223.41 ms | 1222.49 ms | -0.92 ms |
| 4b87b12+dirty | 1199.49 ms | 1199.78 ms | 0.29 ms |
| 7ac3378+dirty | 1202.35 ms | 1198.31 ms | -4.04 ms |
| 5c1e987+dirty | 1208.43 ms | 1220.72 ms | 12.29 ms |
| 5569641+dirty | 3824.35 ms | 1210.78 ms | -2613.57 ms |
| c004dae+dirty | 3857.82 ms | 1224.87 ms | -2632.95 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 3817909+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 23598c3+dirty | 3.38 MiB | 4.80 MiB | 1.42 MiB |
| 890d145+dirty | 3.38 MiB | 4.77 MiB | 1.38 MiB |
| bc0d8cf+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 8929511+dirty | 3.38 MiB | 4.80 MiB | 1.42 MiB |
| 4b87b12+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
| 7ac3378+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
| 5c1e987+dirty | 3.38 MiB | 4.73 MiB | 1.35 MiB |
| 5569641+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| c004dae+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8929511+dirty | 469.49 ms | 502.65 ms | 33.16 ms |
| 23598c3+dirty | 371.92 ms | 420.65 ms | 48.74 ms |
| d2eadf8+dirty | 468.02 ms | 530.37 ms | 62.35 ms |
| 5c1e987+dirty | 444.71 ms | 475.13 ms | 30.42 ms |
| c004dae+dirty | 404.60 ms | 430.67 ms | 26.07 ms |
| ad66da3+dirty | 411.49 ms | 449.38 ms | 37.89 ms |
| 2c735cc+dirty | 435.20 ms | 459.48 ms | 24.28 ms |
| 7ac3378+dirty | 410.67 ms | 442.60 ms | 31.92 ms |
| 4953e94+dirty | 398.80 ms | 431.81 ms | 33.01 ms |
| 5fe1c6c+dirty | 365.84 ms | 408.62 ms | 42.78 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 8929511+dirty | 43.94 MiB | 49.02 MiB | 5.08 MiB |
| 23598c3+dirty | 43.94 MiB | 49.02 MiB | 5.08 MiB |
| d2eadf8+dirty | 48.30 MiB | 53.48 MiB | 5.18 MiB |
| 5c1e987+dirty | 43.94 MiB | 48.94 MiB | 5.00 MiB |
| c004dae+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| ad66da3+dirty | 48.30 MiB | 53.49 MiB | 5.19 MiB |
| 2c735cc+dirty | 43.94 MiB | 48.94 MiB | 5.00 MiB |
| 7ac3378+dirty | 43.94 MiB | 48.99 MiB | 5.05 MiB |
| 4953e94+dirty | 43.94 MiB | 48.94 MiB | 5.00 MiB |
| 5fe1c6c+dirty | 43.94 MiB | 49.00 MiB | 5.06 MiB |
Uh oh!
There was an error while loading. Please reload this page.
) ## DESCRIBE YOUR PR Documents new touch breadcrumb label features in the React Native SDK (v8.12.0): - **Automatic `sentry-label` injection** — build-time label injection from static text via the Babel plugin, enabled by default with `annotateReactComponents` ([sentry-react-native#6141](getsentry/sentry-react-native#6141)) - **Runtime text extraction from children** — `extractTextFromChildren` prop extracts text from child fiber nodes as a label fallback ([sentry-react-native#6106](getsentry/sentry-react-native#6106)) - **Session Replay masking interaction** — `sentry-label` and text extraction respect `maskAllText` and `Sentry.Mask` boundaries ([sentry-react-native#6142](getsentry/sentry-react-native#6142)) - **Updated label priority chain** — now 6 steps including text extraction and masking notes ### Files changed - `docs/platforms/react-native/configuration/touchevents.mdx` — new h2 sections for automatic label injection, text extraction, masking interaction; updated label priority; added `extractTextFromChildren` to options - `docs/platforms/react-native/integrations/component-names.mdx` — new section for `autoInjectSentryLabel` with disable examples Closesgetsentry/sentry-react-native#6113 ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.) - [ ] Other deadline - [x] None: Not urgent, can wait up to 1 week+⚠️ Should be merged after the above implementation is shipped in 8.12.0 ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…breadcrumbs (#17665) ## DESCRIBE YOUR PR Document the new text extraction from children feature for React Native touch breadcrumbs. - Add text content from children as item 6 in the label priority list - Document the `extractTextFromChildren` option - Add Alert about masking behavior (disabled when `maskAllText` is on, respects `Sentry.Mask`) - Update user interaction instrumentation docs to mention text children fallback **Depends on #17650** (label fallbacks docs) — based on that branch. **Companion SDK PR:** getsentry/sentry-react-native#6106 ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): - [ ] Other deadline: - [x] None: Not urgent, can wait up to 1 week+⚠️ Should be merged after getsentry/sentry-react-native#6106 is released ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

📢 Type of change
📜 Description
Walks the React fiber tree downward (
child/siblingpointers) to extract text content from children of touched components. This text is used as a lowest-priority label fallback when no explicit label (sentry-label, customlabelKey) is set.For example, a button like:
will now produce a breadcrumb with label
"Save workout"instead of just"TouchableOpacity".Masking behavior
maskAllTextis enabled (the default for replay users): text extraction is automatically disabled to avoid leaking masked content via breadcrumbs. No behavior change for these users.maskAllTextis explicitlyfalse: text extraction is enabled.extractTextFromChildren: falseonTouchEventBoundary.Sentry.Maskboundaries are respected: text inside<Sentry.Mask>is never extracted.Safety limits
...)New prop
extractTextFromChildren(defaulttrue) — set tofalseto opt out entirely.Label priority (lowest to highest)
labelKeyprop valuesentry-labelprop💡 Motivation and Context
Touch breadcrumbs currently produce unhelpful labels like
"Touch event within element: View"which makes Session Replay AI summaries and issue debugging less useful. This change automatically extracts meaningful labels from component text content.Closes#6097
💚 How did you test it?
maskAllText: true,false, undefined),Sentry.Maskboundary, priority over extracted text,extractTextFromChildren: falseopt-out, raw text fiber nodes, integration without options📝 Checklist
sendDefaultPIIis enabled🔮 Next steps