feat(core): Extract text from children of touched components for breadcrumb labels#6106
Open
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>
Contributor
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. |
Contributor
|
6 tasks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
@sentry review |
Contributor
Author
|
@cursor review |
…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
antonis
commented
May 8, 2026
…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.
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.

📢 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