<p dir="auto">This is a replacement for <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2952007183" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5853" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/5853/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/5853">#5853</a>. That area of the code has changed enough that I think the original PR cannot be salvaged.</p>
<p dir="auto">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:</p>
<ul dir="auto">
<li>OSM have a legitimate interest to show the heatmap, so it's ok that users get it by default.</li>
<li>The heatmap is not strictly necessary in order to use OSM, so users should have the ability to hide it.</li>
</ul>
<p dir="auto">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:</p>
<ul dir="auto">
<li>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.</li>
</ul>
<a href="https://github.com/user-attachments/assets/eab78cab-a72e-438c-a049-aa96efe118b8">heatmap-inline-form.png (view on web)</a>
<ul dir="auto">
<li>Storing the preference as a <code class="notranslate">UserPreference</code>.</li>
<li>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 <code class="notranslate">ActiveModel::Type::Boolean.new.cast</code> and <code class="notranslate">ActiveModel::Type::String.new.cast</code> for this.</li>
<li>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.</li>
<li>No tests yet.</li>
</ul>
<p dir="auto">Thoughts?</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/6606'>https://github.com/openstreetmap/openstreetmap-website/pull/6606</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/6606/commits/b71686789ca13f5d7fe27ff3d6860f5d4a6e3b80" class="commit-link">b716867</a> First stab at hiding the heatmap</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6606/files">6 files</a>)</p>
<ul>
<li>
<strong>A</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6606/files#diff-9af90a950359b694c7785f53665e54a79ac31fe2a953d7a7db074d218982b986">app/controllers/profiles/heatmaps_controller.rb</a>
(23)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6606/files#diff-cf052730cf41d61f4b60c135bb6ec49aa13124a5a99cf45c0822fa5c6b34af40">app/controllers/users/heatmaps_controller.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6606/files#diff-cfdccd0a9d5df5a43aaad2a35d36ebbe187c52ad5fdc9846fa189d04537adb6e">app/controllers/users_controller.rb</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6606/files#diff-9802ca3c9c4cf89904fd44bc114e35ebdf2c5dd3d5b645491e2b253e1afef29b">app/models/user.rb</a>
(12)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6606/files#diff-78ff736409d758722403cce31873ba803b3fb526d37398ca21caa557b54dfd95">app/views/users/show.html.erb</a>
(12)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/6606/files#diff-959bc9abc46a55332bb64d5155a79323afa75a50ec1a2137ddd22d926f62c6c5">config/routes.rb</a>
(1)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/6606.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/6606.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/6606.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/6606.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6606">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLNHF7V2OFJYRQYAJKD4BAPPXAVCNFSM6AAAAACOTYJFYGVHI2DSMVQWIX3LMV43ASLTON2WKOZTG4YTKMRWGQYDONQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOZBKVIHFVU7DOBGYT4BAPPXA5CNFSM6AAAAACOTYJFYGWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHN24TOJQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/6606</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/6606",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/6606",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>