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

Contribution activity on user page #5298

Open
kcne opened this issue Oct 31, 2024 · 0 comments
Open

Contribution activity on user page #5298

kcne opened this issue Oct 31, 2024 · 0 comments

Comments

@kcne
Copy link
Contributor

kcne commented Oct 31, 2024

Problem

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.

Description

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.

Technical Proposal
The implementation will be split into multiple Pull Requests (PRs) for incremental development:

PR-1-1: Database Schema Setup

  • Add user_activities table:
    • Define columns: id, user_id (indexed), activity_type, object_type, object_id, metadata, created_at (indexed).
  • Tests:
    • Write tests to ensure the schema setup functions correctly.
  • Data Retention Policy:
    • Establish an archival policy for data older than a specified period (e.g., one year).

PR-1-2: Model Layer - UserActivity Model and Basic Tracking Logic

  • Create UserActivity Model:
    • Define core associations (belongs_to :user) and basic validations.
  • Model Callbacks for Logging:
    • Implement after_create and after_update callbacks in relevant models (Changeset, Note, DiaryEntry, GPSTrace) for logging actions.
  • Shared Logic:
    • Create an ActivityTrackable concern for models needing activity tracking logic.
  • Tests:
    • Ensure the concern and model validations are covered by comprehensive tests.

PR-2: Controller Layer - User Activity Controller

  • Create UserActivityController:
    • Implement an index action to fetch user activities with support for pagination, filtering, and sorting.
  • Querying:
    • Utilize scopes in the UserActivity model for efficient filtering and preloading of data.
  • Tests:
    • Write controller tests to validate that scoped queries return correct results.

PR-3: Frontend Layer - Activity Feed Display

  • Implement Activity Feed Partial:
    • Create a partial to display user activities in the profile section with a standardized format.
  • Integration Tests:
    • Conduct view tests to confirm the feed works as expected.
  • Pagination:
    • Implement infinite scroll or use cursor-based pagination to maintain consistency across the section.

Screenshots

Screenshot 2024-10-31 at 09 43 43

This is the fast mockup i came up with. Could be modified to fit our use case a bit better according to feedback. Thank you.

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

No branches or pull requests

1 participant