Skip to content

Extract text children from touchable components for breadcrumb labels #6097

@antonis

Description

@antonis

Walk props.children at runtime to extract text content from touched components. This is the only option that catches dynamic text like <Text>{t('save')}</Text>.

Rough approach:

  • Walk memoizedProps.children up to depth 2
  • If children are strings or <Text> with string children, use as label fallback (after sentry-label, accessibilityLabel, testID)
  • Cap string length (e.g. 64 chars)

Must be gated on replay masking settings. If maskAllText is enabled, extracting text children into breadcrumbs would leak content the user asked us to mask. Options:

  • Gate on masking setting (don't extract when masking is on)
  • Require opt-in via a TouchEventBoundary prop (e.g. extractTextChildren: true, default off)
  • Both

Scope: touchevents.tsx — child walk logic + masking gate + tests.

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions