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

fix(list): make clicking on list items trackable by analytics apps #3339

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

Kiarokh
Copy link
Contributor

@Kiarokh Kiarokh commented Dec 2, 2024

fix #3338

Review:

  • Commits are atomic
  • Commits have the correct type for the changes made
  • Commits with breaking changes are marked as such

Browsers tested:

(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)

Windows:

  • Chrome
  • Edge
  • Firefox

Linux:

  • Chrome
  • Firefox

macOS:

  • Chrome
  • Firefox
  • Safari

Mobile:

  • Chrome on Android
  • iOS

Copy link

github-actions bot commented Dec 2, 2024

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-3339/

Comment on lines 142 to 143
data-text={item.text}
data-secondary-text={item.secondaryText}
Copy link
Contributor Author

@Kiarokh Kiarokh Dec 2, 2024

Choose a reason for hiding this comment

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

@magnusfagerlund this change reflects that text and secondaryText props of the list items on the <li /> element, as data-text and data-secondary-text like below:
image

Important

These could be different based on the language. Is it OK for you and your Heap? Or do you need some static thing like id which is the same for each language.

I should just say that if we go that way, you don't get any information from Heap, unless we update all lists everywhere, and add some id to their items manually.

That we could still do probably in future. But I think this should be enough for now. Right?

Choose a reason for hiding this comment

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

It would be great if we could use id. It will be too much admin work in Heap to keep track of the different languages otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jgroth also raised a concern about leaking personal info, if we use the data itself. While that could be the case for anything clickable. I still think it's a valid concern, and an important thing to mitigate if we can.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adrianschmidt has some idea using some keys, but don't do it during the cycle if that takes too much time Adrian

Copy link

@magnusfagerlund magnusfagerlund Dec 3, 2024

Choose a reason for hiding this comment

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

If there is a risk of leaking personal information using text and secondaryText, then we shouldn't do it. Then we should only use íd.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect! I've updated the commit 👌

Copy link
Contributor

Choose a reason for hiding this comment

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

But Lime Go are applying data-intercom-target in some places of the app. In this case to make it easier to user Intercom when creating Product Tours and such, but could we apply something similar?

That's basically what we are doing here, but the problem is knowing what value to put in there. Go has probably hard-coded a few values on their main menu items specifically. We could also do that for the select few places where we know exactly what the menu option is going to be, because it's not configurable. But for any other place, where configuration, user role, or anything else, can affect what options are available, we need some automatic way.

Going with only the main text, and only on menu items, not on list items, seems like a very good solution for now 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah… now I think I understood the comments about using id. We don't have a property called id on menuItem, but we do have a property called value, which I think is the one that should be used if you need to identify the menu option in a language independent way. So perhaps we should simply use that one instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

value can be anything so it's hard to use that. If an object is used it will just say [Object object] everywhere. You could of course implement toString() to get something else, but it also makes it a bit unclear that it will be used for this, and if you do it on let's say a LimeObject we are back at sending personal information since we have no control over what value is.
Using something like id is probably a lot safer since it should be used to identify things 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, crap. Good point!

Then I think using only text and only for menus is the way to go for now.

…oftware like Heap

-CHANGELOG-
This change adds the value of the menu item's `text` property
under the attribute `data-text`, to make it possible to distinguish
which menu option was selected, in analytics apps like Heap.
Note that if you are putting any kind of sensitive data in the
`text` property of menu items, and you are using a service for
analysing user behaviour, such data could be sent to your analytics
service, which may be a violation of GDPR and other regulations.
If including such data in the menu item is absolutely necessary,
we recommend including it in the menu item's `data-secondary-text`
property instead.
adrianschmidt
adrianschmidt previously approved these changes Dec 5, 2024
@adrianschmidt adrianschmidt dismissed their stale review December 5, 2024 13:34

We might want to make some changes…

@adrianschmidt adrianschmidt enabled auto-merge (rebase) December 6, 2024 08:08
@adrianschmidt adrianschmidt merged commit 010c5d8 into main Dec 6, 2024
12 checks passed
@adrianschmidt adrianschmidt deleted the list-item-tracking branch December 6, 2024 08:11
@lime-opensource
Copy link
Collaborator

🎉 This PR is included in version 37.75.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List: make clicking on list items trackable by analytics apps like Heap
5 participants