Skip to content

Add highlighting for comments made by users with Regular Commenter achievement #66

@emreutkan

Description

@emreutkan

Description

This feature adds highlighting for comments made by users with the "Regular Commenter" achievement badge.

Changes needed:

  1. Modify the comment retrieval endpoint to check if a commenter has the "Regular Commenter" achievement
  2. Add a should_highlight boolean flag to comment data in the API response
  3. Maintain privacy by not exposing any personal user information

Implementation Details

  • In restaurant_routes.py, modify the /restaurants/<int:restaurant_id>/comments GET endpoint
  • For each comment, check if its author has the "Regular Commenter" achievement
  • Add a should_highlight flag to the comment JSON data
  • The frontend will use this flag to highlight the comment in the UI

Technical Approach

  1. Query UserAchievement table to check if the comment's author has the "Regular Commenter" achievement
  2. Add the highlight flag to the comment data structure
  3. Update API documentation to reflect this new field

Benefits

  • Enhanced user experience by visually distinguishing comments from experienced users
  • Creates a gamification feature that incentivizes users to submit more comments
  • Maintains user privacy by not exposing which specific user made which comment

Testing

  • Verify that comments from users with the achievement are properly flagged
  • Confirm that no PII or user-specific data is leaked in the process
  • Test with various combinations of users with and without achievements

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions