Skip to content

PANA-8613: View traversal and decomposition - #3728

Draft
jonathanmos wants to merge 1 commit into
jmoskovich/02-sr-new-pipelinefrom
jmoskovich/03-sr-new-pipeline
Draft

PANA-8613: View traversal and decomposition#3728
jonathanmos wants to merge 1 commit into
jmoskovich/02-sr-new-pipelinefrom
jmoskovich/03-sr-new-pipeline

Conversation

@jonathanmos

Copy link
Copy Markdown
Member

What does this PR do?

This is the third pr of the new pipeline.

Adds view traversal and decomposition for the new composition-based Session Replay capture pipeline: AndroidWindowTraversal recursively walks a window's native View hierarchy into CapturedLayer/CapturedWireframe trees (combining what were separately TreeViewTraversal and SnapshotProducer in the legacy pipeline), AndroidCapturedSnapshotProducer assembles all active windows into one CapturedFullSnapshot, and a new composition/mapper package provides Text/WebView/Hidden/generic-fallback view mappers plus a background-shape-style resolver, wired into DefaultRecorderProvider.

Motivation

PANA-8613 — next step in the composition-pipeline workstream (following PANA-8612's capture orchestration): the orchestrator needs a real CapturedSnapshotProducer that can actually decompose the live View hierarchy instead of a stub.

Additional Notes

  • Ancestor-clip bounds are threaded through recursion via a mutable stack (push/pop) rather than list concatenation, to avoid O(depth) allocation per view.
  • Masking/privacy is explicitly out of scope for this workstream; text and images are captured unmasked for now.
  • ComposeView hosts are detected by class name only (no compile-time androidx.compose dependency) and handed off to an optional composeHostCallback rather than traversed as native children.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@datadog-official

datadog-official Bot commented Aug 19, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 72.82% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 5ce8684 | Docs | View more details | Give us feedback!

@codecov-commenter

codecov-commenter commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.62040% with 79 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.39%. Comparing base (50400d0) to head (5ce8684).

Files with missing lines Patch % Lines
...ernal/composition/mapper/CapturedTextViewMapper.kt 40.96% 44 Missing and 5 partials ⚠️
...lay/internal/composition/AndroidWindowTraversal.kt 88.79% 2 Missing and 10 partials ⚠️
...nal/composition/AndroidCapturedSnapshotProducer.kt 83.33% 3 Missing and 4 partials ⚠️
...eplay/internal/composition/RumViewScopeProvider.kt 50.00% 5 Missing ⚠️
.../sessionreplay/internal/DefaultRecorderProvider.kt 92.86% 2 Missing and 1 partial ⚠️
...l/composition/mapper/CapturedViewMapperRegistry.kt 87.50% 1 Missing and 1 partial ⚠️
...ion/mapper/CapturedBackgroundShapeStyleResolver.kt 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                        Coverage Diff                        @@
##           jmoskovich/02-sr-new-pipeline    #3728      +/-   ##
=================================================================
+ Coverage                          73.35%   73.39%   +0.05%     
=================================================================
  Files                               1021     1032      +11     
  Lines                              37902    38221     +319     
  Branches                            6599     6659      +60     
=================================================================
+ Hits                               27800    28052     +252     
- Misses                              8183     8227      +44     
- Partials                            1919     1942      +23     
Files with missing lines Coverage Δ
...sessionreplay/internal/composition/CapturedTree.kt 100.00% <100.00%> (+9.76%) ⬆️
...nal/composition/mapper/CapturedHiddenViewMapper.kt 100.00% <100.00%> (ø)
...al/composition/mapper/CapturedMapperTypeWrapper.kt 100.00% <100.00%> (ø)
...position/mapper/CapturedViewGroupFallbackMapper.kt 100.00% <100.00%> (ø)
.../internal/composition/mapper/CapturedViewMapper.kt 100.00% <100.00%> (ø)
...ternal/composition/mapper/CapturedWebViewMapper.kt 100.00% <100.00%> (ø)
...ion/mapper/CapturedBackgroundShapeStyleResolver.kt 85.71% <85.71%> (ø)
...l/composition/mapper/CapturedViewMapperRegistry.kt 87.50% <87.50%> (ø)
.../sessionreplay/internal/DefaultRecorderProvider.kt 92.59% <92.86%> (+0.59%) ⬆️
...eplay/internal/composition/RumViewScopeProvider.kt 50.00% <50.00%> (ø)
... and 3 more

... and 37 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonathanmos
jonathanmos force-pushed the jmoskovich/02-sr-new-pipeline branch from 1dd5cfc to 50400d0 Compare August 19, 2026 10:38
@jonathanmos
jonathanmos force-pushed the jmoskovich/03-sr-new-pipeline branch from 92ae883 to 5ce8684 Compare August 19, 2026 10:46
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.

2 participants