MAUI: Label tap breadcrumbs the same way as React Native

Aperta
#5,884 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend

Direzione di ricerca

Read the MAUI breadcrumb creation path, especially OnBreadcrumbCreateCallback, and compare it with the React Native behavior described in the issue. The scope depends on resolving the listed questions about defaults, masking, breadcrumb shape, and coordination with Flutter; there is no agreed acceptance criteria yet. Done means those behavior choices are settled and MAUI tap breadcrumbs follow them without exposing input text.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

.NET Feature Framework: MAUI State: Needs Discussion
Problem Statement

MAUI tap breadcrumbs often don't say which control was tapped. Button.Clicked carries the control's AutomationId and name if they're set, but not its text. The only way to get the text is IncludeTextInBreadcrumbs, which also captures the contents of Entry, Editor and Label controls.

Solution Brainstorm

After discussing this internally, we want to implement the same solution as React Native, instead of adding a MAUI-only option like the IncludeButtonTextInBreadcrumbs proposed in #5870. This comment compares what the other SDKs do.

What React Native does

From touchevents.tsx (getsentry/sentry-react-native#6106, getsentry/sentry-react-native#6142):

Session Replay Text from the tapped component's children, and sentry-label
Not installed Used
Installed, maskAllText on (the default) Skipped
Installed, maskAllText: false Used, except inside Sentry.Mask
  • Developer-set identifiers (custom labelName, accessibilityLabel, aria-label, testID) are used in every case.
  • Priority: sentry-label, custom labelName, accessibilityLabel, aria-label, testID, then child text.
  • Child text is limited to 64 characters, 3 levels deep and 5 siblings per level.
  • It isn't tied to sendDefaultPii. extractTextFromChildren: false opts out.
Mapping it to MAUI

Replay state:

  • Native.ExperimentalOptions.SessionReplay.IsSessionReplayEnabled and MaskAllText (default true) exist on Android and Cocoa. Windows has no Replay, so the "Not installed" row always applies there.
  • The per-element masks, SessionReplay.Mask and MaskControlsOfType<T>, only work on Android. MaskProperty defaults to Mask, so an ancestor check has to use IsSet, not GetMask.

Two places where a direct port would leak text:

  • Only label user-action breadcrumbs. React Native only labels touches. AddElementInfo also serves focus, child-added and page breadcrumbs, so changing it would put an Entry's typed text on Focused/Unfocused. The label belongs on the OnBreadcrumbCreateCallback path.
  • Exclude input controls. React Native collects child text nodes, which doesn't include a TextInput's value. MAUI's IText includes Entry and Editor, so they need excluding explicitly.
Open questions
  1. Default. React Native is on by default, which it called out as a behaviour change. This repo's convention is that new features are opt-in, and on by default means existing apps without Replay start sending control text, including every Windows app. Should this be on by default on version7, or opt-in on main?
  2. IncludeTextInBreadcrumbs. It captures all text regardless of Replay. Does it stay as it is?
  3. iOS masks. MAUI exposes no per-element mask on iOS, so nothing there matches Sentry.Mask. Is MaskAllText enough, or does MAUI need an iOS mask first?
  4. Breadcrumb shape. React Native puts the label in the message (Touch event within element: Save) and in data.path[].label. MAUI uses the message Button.Clicked and the key Button.Text. Which do we use, and do we need an equivalent of sentry-label?
  5. Flutter. getsentry/sentry-dart#3770 proposes the same approach, so it's worth agreeing the shape with that team.
Related
  • #3130 asks for button text in breadcrumbs. This would resolve it.
  • #5814 tracks password text in breadcrumbs.
Lingua principale
C#
Stelle
775
Fork
262
Merge medio
1g 16h
PR unite (30g)
118

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di getsentry/sentry-dotnet

Tutte le issue di getsentry/sentry-dotnet

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.