<p></p>
<h3 dir="auto">Problem</h3>
<p dir="auto">Currently, the OpenStreetMap user profile page lacks a comprehensive contribution activity feed similar to those seen on platforms like GitHub. This means users cannot easily track or showcase their activity across changeset edits, note interactions, diary entries, and GPS trace uploads. This gap limits the visibility of a user's contributions and engagement within the community.</p>
<h3 dir="auto">Description</h3>
<p dir="auto">This is proposal for adding a user activity feed to the OpenStreetMap profile page to provide a detailed view of contributions. This would enhance user interaction by showcasing a summary of recent actions in a structured and engaging format.</p>
<p dir="auto"><strong>Technical Proposal</strong><br>
The implementation will be split into multiple Pull Requests (PRs) for incremental development:</p>
<p dir="auto"><strong>PR-1-1: Database Schema Setup</strong></p>
<ul dir="auto">
<li><strong>Add <code class="notranslate">user_activities</code> table</strong>:
<ul dir="auto">
<li>Define columns: <code class="notranslate">id</code>, <code class="notranslate">user_id</code> (indexed), <code class="notranslate">activity_type</code>, <code class="notranslate">object_type</code>, <code class="notranslate">object_id</code>, <code class="notranslate">metadata</code>, <code class="notranslate">created_at</code> (indexed).</li>
</ul>
</li>
<li><strong>Tests</strong>:
<ul dir="auto">
<li>Write tests to ensure the schema setup functions correctly.</li>
</ul>
</li>
<li><strong>Data Retention Policy</strong>:
<ul dir="auto">
<li>Establish an archival policy for data older than a specified period (e.g., one year).</li>
</ul>
</li>
</ul>
<p dir="auto"><strong>PR-1-2: Model Layer - UserActivity Model and Basic Tracking Logic</strong></p>
<ul dir="auto">
<li><strong>Create <code class="notranslate">UserActivity</code> Model</strong>:
<ul dir="auto">
<li>Define core associations (<code class="notranslate">belongs_to :user</code>) and basic validations.</li>
</ul>
</li>
<li><strong>Model Callbacks for Logging</strong>:
<ul dir="auto">
<li>Implement <code class="notranslate">after_create</code> and <code class="notranslate">after_update</code> callbacks in relevant models (<code class="notranslate">Changeset</code>, <code class="notranslate">Note</code>, <code class="notranslate">DiaryEntry</code>, <code class="notranslate">GPSTrace</code>) for logging actions.</li>
</ul>
</li>
<li><strong>Shared Logic</strong>:
<ul dir="auto">
<li>Create an <code class="notranslate">ActivityTrackable</code> concern for models needing activity tracking logic.</li>
</ul>
</li>
<li><strong>Tests</strong>:
<ul dir="auto">
<li>Ensure the concern and model validations are covered by comprehensive tests.</li>
</ul>
</li>
</ul>
<p dir="auto"><strong>PR-2: Controller Layer - User Activity Controller</strong></p>
<ul dir="auto">
<li><strong>Create <code class="notranslate">UserActivityController</code></strong>:
<ul dir="auto">
<li>Implement an <code class="notranslate">index</code> action to fetch user activities with support for pagination, filtering, and sorting.</li>
</ul>
</li>
<li><strong>Querying</strong>:
<ul dir="auto">
<li>Utilize scopes in the <code class="notranslate">UserActivity</code> model for efficient filtering and preloading of data.</li>
</ul>
</li>
<li><strong>Tests</strong>:
<ul dir="auto">
<li>Write controller tests to validate that scoped queries return correct results.</li>
</ul>
</li>
</ul>
<p dir="auto"><strong>PR-3: Frontend Layer - Activity Feed Display</strong></p>
<ul dir="auto">
<li><strong>Implement Activity Feed Partial</strong>:
<ul dir="auto">
<li>Create a partial to display user activities in the profile section with a standardized format.</li>
</ul>
</li>
<li><strong>Integration Tests</strong>:
<ul dir="auto">
<li>Conduct view tests to confirm the feed works as expected.</li>
</ul>
</li>
<li><strong>Pagination</strong>:
<ul dir="auto">
<li>Implement infinite scroll or use cursor-based pagination to maintain consistency across the section.</li>
</ul>
</li>
</ul>
<h3 dir="auto">Screenshots</h3>
<a href="https://github.com/user-attachments/assets/14e22309-3410-460d-90d4-9e56ce59278a">Screenshot.2024-10-31.at.09.43.43.png (view on web)</a>
<p dir="auto">This is the fast mockup i came up with. Could be modified to fit our use case a bit better according to feedback:</p>

<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/issues/5298">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJ5S74HWFTLAX73MWDZ6HVUXAVCNFSM6AAAAABQ52G3T2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGYZDMMZSGIYDOMY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLM3AFNLCL7Z564PYD3Z6HVUXA5CNFSM6AAAAABQ52G3T2WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHJZCT6TE.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/issues/5298</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/issues/5298",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/5298",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>