Skip to content

Lan.nguyen/sr webview support#962

Draft
nguyexua wants to merge 6 commits intodevelopfrom
lan.nguyen/sr-webview-support
Draft

Lan.nguyen/sr webview support#962
nguyexua wants to merge 6 commits intodevelopfrom
lan.nguyen/sr-webview-support

Conversation

@nguyexua
Copy link

What and why?

What changes does this pull request introduce and why is it necessary?

How?

If needed, a description of how this PR accomplishes what it does.

Review checklist

  • This pull request has appropriate unit and / or integration tests
  • This pull request references a Github or JIRA issue

…ment

- Add `touchPrivacyLevel` to `TreeCapturePrivacy`; `performCapture` now
  discards pointer events unless the level is `show`
- Add `canHandle(Widget)` default method to `ElementRecorder` to support
  generic widget types (e.g. Radio<T>) that can't match by exact runtimeType
- Add `_fallbackRecorders` list and `_recorderFor()` to
  `SessionReplayRecorder` for O(1) type-map lookup with canHandle fallback
- Add `subKeyForElement(element, subIndex)` to `KeyGenerator` for compound
  widgets that emit multiple wireframes from a single Element
- Remove standalone `touchPrivacyLevel` constructor parameter from
  `SessionReplayRecorder`; propagate through `TreeCapturePrivacy` instead
- Fix `PrivacyRecorder` to carry `touchPrivacyLevel` into subtree privacy
- Add `createTestImage` helper to test_utils.dart
- Update all tests and golden tests for new `TreeCapturePrivacy` API
- SelectionControlRecorder: Checkbox (box + check), Radio<T> (ring + dot
  via canHandle), Switch and CupertinoSwitch (track + thumb compound)
- SliderRecorder: Slider (inactive track, active track, thumb),
  RangeSlider (two thumbs), CupertinoSlider
- ProgressRecorder: LinearProgressIndicator (track + fill),
  CircularProgressIndicator (background ring + arc fill)
- NavigationRecorder: TabBar (bg + underline indicator),
  BottomNavigationBar (bg + highlight), NavigationBar (bg + pill),
  NavigationRail (bg + pill)
- Register all four recorders in SessionReplayRecorder default constructor
Single-style paragraphs retain the existing fast path. For mixed-style
paragraphs, collect (text, effectiveStyle, charRange) per span, then use
getBoxesForSelection to obtain one TextElementCaptureNode per box with
accurate position and style. WidgetSpan offsets are treated as 1 char
(U+FFFC) to align with Flutter's plain-text representation.
…nfig

- DatadogSessionReplay.startRecording() / stopRecording(): public static
  API to pause and resume capture without disabling Session Replay
- startRecordingImmediately (default true): when false, recording is
  deferred until startRecording() is called explicitly
- _captureTimer stored on the recorder so stopRecording() can cancel the
  periodic capture; _isRecording guards against duplicate calls
- Add no-op default implementations of startRecording/stopRecording to
  DatadogSessionReplayPlatform so existing implementations don't break
Two caches added to KeyGenerator:
- _contentHashCache (hash → resourceKey): deduplicates same-pixel images
  across different ui.Image instances; hashImageBytes uses stride sampling
  to keep hashing O(1) regardless of image size
- _resourceIdStringCache (resourceKey → resourceId): caches the resolved
  native resourceId string so resourceIdForKey() is called at most once
  per image resource across the session

ResourceImageNode now holds a KeyGenerator reference and checks the Dart
cache before calling native in buildWireframes(). _captureImage skips
saveImageForProcessing entirely when a content-hash match exists.
- getCapabilities() now returns '["records"]' instead of '[]', matching
  the Android DatadogEventBridge contract
- getPrivacyLevel() is driven by a new privacyLevel constructor parameter
  (default 'mask') instead of being hardcoded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant