WIP: Allow users to hide the heatmap
This is a replacement for https://github.com/openstreetmap/openstreetmap-website/pull/5853. That area of the code has changed enough that I think the original PR cannot be salvaged.
This PR adds a preference that allows users to hide the heatmap from their profiles, if they so choose. There was a question of whether this was necessary, privacy implications, LWG discussion, etc. As communicated to me, this is the decision:
- OSM have a legitimate interest to show the heatmap, so it's ok that users get it by default.
- The heatmap is not strictly necessary in order to use OSM, so users should have the ability to hide it.
At the moment this a WIP in order to gather feedback, as I'm not sure about what is a good way to implement this. Notes:
-
The option appears as a checkbox under the heatmap. At the moment, any preferences that affect the profile can be reached from the profile page, so filing this under Preferences didn't feel right.
-
Storing the preference as a
UserPreference. -
Since user preferences as stored as strings, there's a bit of mucking about with transforming strings into booleans, and back into strings. I use
ActiveModel::Type::Boolean.new.castandActiveModel::Type::String.new.castfor this. -
Admins can see the heatmap even if the user is hiding it. They will see a message "This user has chosen to hide their heatmap from public view" so that there's no confusion.
-
No tests yet.
Thoughts?
I'm happy to see this as an option.
The control should be on the "edit profile" page, not on the profile itself. I want to minimise the differences between what you see when you view your own profile, compared to what other people see. We have a page to control what is or is not shown on your own profile, so that's where the control should be.
I don't think it's worth storing a UserPreference. The UserPreference system is really just there as an API, for editors etc to store user-specific state between instances, or perhaps to read website preferences that might be useful for other apps to know via the API. But I admit that's not really borne out in practice, since we've been putting random website preferences in their regardless of whether they need to be exposed via the API.
I think there's no need for anything other than the website to read/write this particular option, so I don't think it needs to go into the UserPreference system, but I'd ask for feedback from other people on this point.
For admins - why do they need to see it? Should this be visible to moderators too? I would think moderators are more focussed on mapping behaviour than admins, but I don't know if either group use the heatmap as part of their tasks.
There was a question of whether this was necessary, privacy implications, LWG discussion, etc. As communicated to me, this is the decision:
- OSM have a legitimate interest to show the heatmap, so it's ok that users get it by default.
- The heatmap is not strictly necessary in order to use OSM, so users should have the ability to hide it.
Correct, this is an accurate description of what the LWG decided. I’ve updated https://github.com/openstreetmap/openstreetmap-website/issues/5804#issuecomment-3638311030 with more details.
The option appears as a checkbox under the heatmap. At the moment, any preferences that affect the profile can be reached from the profile page, so filing this under Preferences didn't feel right.
I’d agree with @gravitystorm that the actual preference should be under /profile somewhere. We don’t have a separate page for previewing your own profile as it appears to other users, so additional controls make the page pretty unwieldy. For consistency, I think the user would expect to see a button that takes them to the specific tab of the Edit Profile page. Unfortunately, this means yet another tab so we have something to link to.
(I wonder if we need to revisit the decision in #6084 to tie each of these tabs to a path rather than a named anchor and URL hash. Eventually we’ll have enough preferences that the tab bar will get pretty unwieldy. Or maybe we need to have a dedicated page for previewing the profile so we can make the default view more interactive…)
For admins - why do they need to see it? Should this be visible to moderators too? I would think moderators are more focussed on mapping behaviour than admins, but I don't know if either group use the heatmap as part of their tasks.
I vaguely recall comments that the heatmap would be useful to DWG members, but I can’t find them anymore, or maybe it was just speculation. In any case, if the administrators don’t see a need to always see the heatmap, then let’s hide it for them too. We can always revisit if the need arises.
For admins - why do they need to see it? Should this be visible to moderators too? I would think moderators are more focussed on mapping behaviour than admins, but I don't know if either group use the heatmap as part of their tasks.
I vaguely recall comments that the heatmap would be useful to DWG members, but I can’t find them anymore, or maybe it was just speculation. In any case, if the administrators don’t see a need to always see the heatmap, then let’s hide it for them too. We can always revisit if the need arises.
It's probably more useful for moderators that administrators but if we do enable it for moderators then we might as well include administrators as well.
The control should be on the "edit profile" page, not on the profile itself.
That makes sense, but I'm not sure what this would look like. Currently users arrive at the edit section via:
- "Edit Profile Details" which expands buttons that link to the respective edit interfaces.
- "Edit Description" which is in place of the description and also leads to the corresponding edit interface.
What would be a good way to adapt this convention to the heatmap? @1ec5 suggests a button. Perhaps a new "Edit heatmap" (?) button under the heatmap, linking to the a page showing this checkbox+submit?
The UserPreference system is really just there as an API, (...) (b)ut I admit that's not really borne out in practice
What I had in mind was the "dark mode" preferences as introduced at https://github.com/openstreetmap/openstreetmap-website/pull/6492. Do you think we should be introducing a new column in the users table? I guess columns are cheap but it feels strange to me, particularly if over time we continue adding/removing preferences.
I think there's no need for anything other than the website to read/write this particular option
There has been discussion on GDPR-adjacent topics about how the API is not able to provide access to certain things like confirmation of Terms of Use. I wonder if we should start designing things like this in a way that allows for API clients to access these in the future?
Should this be visible to moderators too?
~That makes sense. I'm going to change this to admins+moderators as per @tomhughes comment below.~ (Changed my mind, see next comment).
Correction. I'm going to simplify and make it so that admins/mods can't see a hidden heatmap either, as per @1ec5's comment:
let’s hide it for them too. We can always revisit if the need arises.
Currently I have it as a big button under the heatmap: