Skip to content

RUM-8906: Improve StateListDrawable support in session replay#2531

Merged
aleksandr-gringauz merged 2 commits into
developfrom
aleksandr-gringauz/rum-8906/improve-statelistdrawable-support
Mar 7, 2025
Merged

RUM-8906: Improve StateListDrawable support in session replay#2531
aleksandr-gringauz merged 2 commits into
developfrom
aleksandr-gringauz/rum-8906/improve-statelistdrawable-support

Conversation

@aleksandr-gringauz

@aleksandr-gringauz aleksandr-gringauz commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

Now LegacyDrawableToColorMapper attempts to capture the color of the StateListDrawable instead of logging an error and returning null. Now for example if a Button contains a StateListDrawable as its background the drawable will be properly captured in session replay in case it contains <shape> items.

demo [internal]:

before - https://mobile-integration.datadoghq.com/rum/replay/sessions/42b5235f-634d-4312-aeea-aa0086934210?seed=f99dff80-5d8f-4525-b85a-272b546575ac&ts=1741350614133

after - https://mobile-integration.datadoghq.com/rum/replay/sessions/3bfeecaa-e265-4f89-9e1f-3948ec72bd3e?seed=fc287316-ecbe-4d62-af59-4c51bcc0e82c&ts=1741350708487

Motivation

Properly capture the color of StateListDrawable if its child color can be captured.

Additional Notes

Anything else we should know when reviewing?

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)

@aleksandr-gringauz
aleksandr-gringauz marked this pull request as ready for review March 7, 2025 13:08
@aleksandr-gringauz
aleksandr-gringauz requested review from a team as code owners March 7, 2025 13:08
@codecov-commenter

codecov-commenter commented Mar 7, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.99%. Comparing base (8c7108d) to head (f9f9395).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2531      +/-   ##
===========================================
- Coverage    70.04%   69.99%   -0.05%     
===========================================
  Files          797      797              
  Lines        29990    29992       +2     
  Branches      5018     5019       +1     
===========================================
- Hits         21004    20990      -14     
- Misses        7583     7599      +16     
  Partials      1403     1403              
Files with missing lines Coverage Δ
...sessionreplay/utils/LegacyDrawableToColorMapper.kt 48.86% <100.00%> (+1.19%) ⬆️

... and 32 files with indirect coverage changes

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

@aleksandr-gringauz
aleksandr-gringauz force-pushed the aleksandr-gringauz/rum-8906/improve-statelistdrawable-support branch from ac0f57d to f9f9395 Compare March 7, 2025 13:25

@0xnm 0xnm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm code-wise, but it would be nice to have another pair of eyes from SR folks to check Drawable logic handling.

@ambushwork

Copy link
Copy Markdown
Member

LGTM, well done!

@aleksandr-gringauz
aleksandr-gringauz merged commit 8e81eff into develop Mar 7, 2025
@aleksandr-gringauz
aleksandr-gringauz deleted the aleksandr-gringauz/rum-8906/improve-statelistdrawable-support branch March 7, 2025 14:29
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.

4 participants