Skip to content

RUM-9345: Add Compose custom attributes for actions tracking#2661

Merged
ambushwork merged 1 commit into
developfrom
yl/actions-view-tracking-enrichment
May 21, 2025
Merged

RUM-9345: Add Compose custom attributes for actions tracking#2661
ambushwork merged 1 commit into
developfrom
yl/actions-view-tracking-enrichment

Conversation

@ambushwork

@ambushwork ambushwork commented May 20, 2025

Copy link
Copy Markdown
Member

What does this PR do?

In this PR, we try to provide as much as possible about the action target information in Jetpack Compose actions tracking.

Two attributes is added for compose semantics node:

 // If it is available
action.target.role = Button/Image/RadioButton/Image
 // If it is selectable
action.target.selected = true/false

Motivation

RUM-9345

Additional note

Also enable compose auto-instrumentation for sample app

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)

@ambushwork
ambushwork force-pushed the yl/actions-view-tracking-enrichment branch 2 times, most recently from 0a7a014 to 36f0888 Compare May 20, 2025 09:32
@ambushwork
ambushwork marked this pull request as ready for review May 20, 2025 09:36
@ambushwork
ambushwork requested review from a team as code owners May 20, 2025 09:36
@codecov-commenter

codecov-commenter commented May 20, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.51724% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.95%. Comparing base (131a0a2) to head (3645230).
⚠️ Report is 209 commits behind head on develop.

Files with missing lines Patch % Lines
.../android/compose/internal/utils/LayoutNodeUtils.kt 36.36% 5 Missing and 2 partials ⚠️
...internal/instrumentation/gestures/GesturesUtils.kt 0.00% 0 Missing and 1 partial ⚠️
...lin/com/datadog/android/rum/tracking/ViewTarget.kt 83.33% 0 Missing and 1 partial ⚠️
.../compose/internal/ComposeActionTrackingStrategy.kt 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2661      +/-   ##
===========================================
+ Coverage    69.95%   69.95%   +0.01%     
===========================================
  Files          820      820              
  Lines        30636    30650      +14     
  Branches      5155     5158       +3     
===========================================
+ Hits         21429    21441      +12     
- Misses        7769     7770       +1     
- Partials      1438     1439       +1     
Files with missing lines Coverage Δ
...id/rum/internal/domain/event/RumEventSerializer.kt 100.00% <100.00%> (ø)
...ernal/instrumentation/gestures/GesturesListener.kt 92.52% <100.00%> (ø)
...internal/instrumentation/gestures/GesturesUtils.kt 78.57% <0.00%> (-7.14%) ⬇️
...lin/com/datadog/android/rum/tracking/ViewTarget.kt 84.62% <83.33%> (+4.62%) ⬆️
.../compose/internal/ComposeActionTrackingStrategy.kt 48.48% <80.00%> (+1.61%) ⬆️
.../android/compose/internal/utils/LayoutNodeUtils.kt 42.86% <36.36%> (-5.92%) ⬇️

... and 30 files with indirect coverage changes

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

0xnm
0xnm previously approved these changes May 20, 2025
Comment on lines +220 to +228
/**
* The touch target selection state if it is selectable.
* This is only available for Jetpack Compose components
*/
const val ACTION_TARGET_SELECTED: String = "action.target.selected"

/**
* The touch target semantics role if it is available.
* This is only available for Jetpack Compose components

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.

Suggested change
/**
* The touch target selection state if it is selectable.
* This is only available for Jetpack Compose components
*/
const val ACTION_TARGET_SELECTED: String = "action.target.selected"
/**
* The touch target semantics role if it is available.
* This is only available for Jetpack Compose components
/**
* The touch target selection state if it is selectable.
* This is only available for Jetpack Compose components.
*/
const val ACTION_TARGET_SELECTED: String = "action.target.selected"
/**
* The touch target semantics role if it is available.
* This is only available for Jetpack Compose components.

ACTION_TARGET_SELECTED to selected,
ACTION_TARGET_ROLE to role
)
} ?: mapOf()

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.

Suggested change
} ?: mapOf()
}.orEmpty()

* @property name the name of the target node.
* @property customAttributes the custom attributes that the target node may have.
*/
data class Node(

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.

probably to annotate with @InternalApi?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

updated

@ambushwork
ambushwork force-pushed the yl/actions-view-tracking-enrichment branch from 36f0888 to 3645230 Compare May 20, 2025 14:48
@ambushwork
ambushwork requested a review from 0xnm May 21, 2025 07:23
@ambushwork
ambushwork merged commit b9f6fc2 into develop May 21, 2025
@ambushwork
ambushwork deleted the yl/actions-view-tracking-enrichment branch May 21, 2025 09:41
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