<h3 dir="auto">Description</h3>
<p dir="auto">This PR introduces a user preference to toggle the visibility of the contribution heatmap on their profile page. Users can now enable or disable this feature through the edit profile section. Referencing <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2921894706" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5804" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/5804/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/5804">#5804</a></p>
<p dir="auto"><strong>Changes include:</strong></p>
<ul dir="auto">
<li>Added <code class="notranslate">show_contribution_heatmap</code> boolean field to the <code class="notranslate">users</code> table (default: <code class="notranslate">true</code>)</li>
<li>Added a checkbox in the profile edit form to manage heatmap visibility</li>
<li>Updated the <code class="notranslate">users</code> controller to respect this preference when rendering profile data</li>
<li>Added a test to ensure the feature works as expected</li>
</ul>
<h3 dir="auto">How has this been tested?</h3>
<p dir="auto">The changes have been verified through:</p>
<ol dir="auto">
<li>Automated tests</li>
<li>Manual testing by creating a new user and toggling the setting in the edit profile form</li>
</ol>
<h3 dir="auto">Screenshots:</h3>
<a href="https://github.com/user-attachments/assets/d775daf1-fef6-4070-ad55-423dc23bb571">Screenshot.2025-03-27.at.09.02.05.png (view on web)</a>

<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/5853'>https://github.com/openstreetmap/openstreetmap-website/pull/5853</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/commits/bd47f57a89b6d790534f811e76ea9af11289e41a" class="commit-link">bd47f57</a>  Add show_contribution_heatmap to the table via migration and update the profile controller</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/commits/6316b1b5d9bca4a582d6112e5242fe83e71cf23b" class="commit-link">6316b1b</a>  Add checkbox for contribution heatmap visibility on edit profile</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/commits/5dd0b4356705541f4fe66192b140ac73fdde6fde" class="commit-link">5dd0b43</a>  Include heatmap data in user controller response based on preference</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/commits/df47378907b18257a283d6b376f2d6fc47c36213" class="commit-link">df47378</a>  Add tests for heatmap visibility according to user preference</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/files">8 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/files#diff-7a47d335107fc35c2e79cc9c2b0a195c863594dd2343bcd48a4c770ac4af673c">app/controllers/profiles_controller.rb</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/files#diff-cfdccd0a9d5df5a43aaad2a35d36ebbe187c52ad5fdc9846fa189d04537adb6e">app/controllers/users_controller.rb</a>
    (38)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/files#diff-9802ca3c9c4cf89904fd44bc114e35ebdf2c5dd3d5b645491e2b253e1afef29b">app/models/user.rb</a>
    (63)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/files#diff-6091542e4570d68ca546a4a893b0d0202a75b9aa6fabf4e8aa0b4122ae6a3544">app/views/profiles/edit.html.erb</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/files#diff-44438ce218f5287c58d0017f965d888715635d94280669896f75841fbd7b4cd7">config/locales/en.yml</a>
    (3)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/files#diff-b32d8d580f0dd398194ac2e4fe6cd0f9ad7f0d0324a848c48bb7953cfe4bbf14">db/migrate/20250317000001_add_show_contribution_heatmap_to_users.rb</a>
    (5)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/files#diff-1dd5a8f580b9615769ddc19a64a98f455d9d20eb149c443f41d9d3c797d39b12">db/structure.sql</a>
    (88)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5853/files#diff-2719d3c650da3c587f727ca3c105e6bc93a7113f85717bb15983543cf4f85ae5">test/controllers/users_controller_test.rb</a>
    (18)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5853.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5853.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5853.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5853.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/5853">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLSHQF7CBTNIHT6EPT2WOPU5AVCNFSM6AAAAABZ4I66BGVHI2DSMVQWIX3LMV43ASLTON2WKOZSHE2TEMBQG4YTQMY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLNXKW6YJRKXFDWWTYD2WOPU5A5CNFSM6AAAAABZ4I66BGWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHK75AOB4.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/5853</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/5853",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5853",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>