Skip to content

Conversation

@Mert-Kirman
Copy link
Contributor

Overview

Implemented user anonymization feature allowing users to appear anonymous in leaderboards, posts, and comments throughout the platform.

Changes

API Integration (src/services/api.ts)

  • Added getPrivacySettings() - Fetch user privacy settings
  • Added updatePrivacySettings() - Update anonymization status
  • Integrated with existing /api/profile/privacy/ backend endpoint

Profile Screen (src/screens/ProfileScreen.tsx)

  • Added "Privacy Settings" section with Anonymous Mode toggle
  • Implemented state management for isAnonymous flag
  • Added fetchPrivacySettings() to load settings on mount
  • Added updatePrivacySetting() with success/error feedback
  • Enhanced UI with proper spacing and responsive text wrapping

Translations (src/i18n/locales/en.json)

  • Added privacy-related translation keys
  • Supports multiple languages (en, tr, es, ar, fr)

Features

  • Single Toggle Control: Enable/disable anonymization with one switch
  • Real-time Updates: Changes sync immediately with backend
  • Error Handling: Alert feedback for success/failure cases
  • Optimistic UI: Instant visual feedback with rollback on error
  • Accessibility: Meets WCAG 2.1 AA standards (MIN_TOUCH_TARGET compliance)

Backend Integration

The backend automatically handles anonymization:

  • Users appear with anonymous identifier (e.g., "anon_abc123...") instead of username
  • Profile images hidden for anonymous users
  • Applied across leaderboards, posts, and comments
  • Users always see their own real username

Testing

  • Toggle switches between on/off states
  • Success alerts display correctly
  • Settings persist after app restart
  • UI layout renders properly on different screen sizes
  • Text wrapping works correctly
  • No TypeScript errors

Related Issues

Closes: #463

@Mert-Kirman Mert-Kirman self-assigned this Dec 15, 2025
@Mert-Kirman Mert-Kirman added enhancement New feature or request pr:high High-Priority task 3-6 hours Expected time of the task labels Dec 15, 2025
Copy link
Contributor

@berkayak13 berkayak13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the additions

@berkayak13 berkayak13 merged commit d5eb52d into main Dec 15, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3-6 hours Expected time of the task enhancement New feature or request pr:high High-Priority task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Displaying an anonymous identifier - Requirement Coverage: RQ-6

3 participants