Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RUMF-1280] collect click position #1566

Merged
merged 13 commits into from
Jun 7, 2022
Merged

Conversation

amortemousque
Copy link
Contributor

@amortemousque amortemousque commented May 24, 2022

Motivation

To build clickmaps, the browser SDK needs to collect the action click position.

Changes

  • Created a getSelectorFromElement to build the CSS path selector. It uses strategies the same way we have in getActionNameFromElement
  • Every newClick of trackClickActions:
    • adds action.position: Contains x and y click coordinates
    • adds action.target.selector: CSS selector path of the target element
    • adds action.target.width and action.target.height: Dimension of the target element used to compute relative coordinate in the backend

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

@codecov-commenter
Copy link

codecov-commenter commented May 25, 2022

Codecov Report

Merging #1566 (284bc7d) into main (56d5b2f) will increase coverage by 0.00%.
The diff coverage is 91.30%.

@@           Coverage Diff           @@
##             main    #1566   +/-   ##
=======================================
  Coverage   90.75%   90.76%           
=======================================
  Files         119      121    +2     
  Lines        4468     4537   +69     
  Branches     1001     1018   +17     
=======================================
+ Hits         4055     4118   +63     
- Misses        413      419    +6     
Impacted Files Coverage Δ
...ain/rumEventsCollection/action/actionCollection.ts 95.45% <ø> (ø)
packages/core/src/tools/utils.ts 85.29% <57.14%> (-1.76%) ⬇️
...mEventsCollection/action/getSelectorFromElement.ts 100.00% <100.00%> (ø)
...in/rumEventsCollection/action/trackClickActions.ts 97.95% <100.00%> (+0.08%) ⬆️
packages/rum-core/test/createIsolatedDom.ts 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@amortemousque amortemousque force-pushed the aymeric/collect-click-position branch 2 times, most recently from 26f350e to 6b9c21c Compare May 25, 2022 08:59
@amortemousque amortemousque marked this pull request as ready for review May 25, 2022 09:01
@amortemousque amortemousque requested a review from a team as a code owner May 25, 2022 09:01
@amortemousque amortemousque force-pushed the aymeric/collect-click-position branch from 2841f13 to 140df55 Compare May 25, 2022 09:06
@amortemousque amortemousque force-pushed the aymeric/collect-click-position branch from 140df55 to 08c981f Compare May 30, 2022 15:24
@amortemousque amortemousque force-pushed the aymeric/collect-click-position branch from ae3c764 to 2aef5d2 Compare May 30, 2022 19:20
@amortemousque amortemousque merged commit 8577823 into main Jun 7, 2022
@amortemousque amortemousque deleted the aymeric/collect-click-position branch June 7, 2022 14:16
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