Skip to content

Document touch breadcrumb label improvements #6113

Description

@antonis

Once all PRs have landed, we need docs covering the full touch breadcrumb label story:

Build-time label injection (autoInjectSentryLabel)

  • The autoInjectSentryLabel option in @sentry/babel-plugin-component-annotate (enabled by default when annotateReactComponents is set)
  • How it auto-injects sentry-label from static JSX text children at build time
  • Constraints: only static strings, 64-char cap, skips when sentry-label already exists
  • The textComponentNames option for custom text components
  • How to disable: annotateReactComponents: { autoInjectSentryLabel: false }

Related: #6141

Runtime text extraction from children

  • The extractTextFromChildren prop on TouchEventBoundary / Sentry.wrap (default true)
  • Extracts text from child fiber nodes as a label fallback when no explicit label is set
  • Limits: 3 levels deep, 5 siblings, 64-char truncation
  • Automatically disabled when Session Replay's maskAllText is enabled (the default)
  • sentry-label (build-time) takes priority over runtime extraction

Related: #6106

Masking interaction

  • sentry-label is skipped when maskAllText is enabled or the element is inside a Sentry.Mask boundary
  • Runtime text extraction is also skipped inside Sentry.Mask boundaries
  • Fallback labels (accessibilityLabel, aria-label, testID) always work regardless of masking
  • To enable both sentry-label and text extraction with replay, set maskAllText: false in mobileReplayIntegration

Related: #6142

Label priority chain

  1. sentry-label prop (build-time injected or manually set) — skipped when masked
  2. Custom labelName prop
  3. accessibilityLabel
  4. aria-label
  5. testID
  6. Text extracted from children — skipped when masked

Docs locations to update

  • docs/platforms/react-native/configuration/touchevents.mdx — runtime extraction, masking interaction, label priority
  • docs/platforms/react-native/integrations/component-names.mdxautoInjectSentryLabel option alongside existing data-sentry-component docs

Repo: getsentry/sentry-docs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions