Skip to content

Conversation

Copy link

Copilot AI commented Oct 14, 2025

Problem

Currently, hidden users cannot see their own emojis and scoreboard placement, which is inconsistent with the fact that they can view their own profile. This creates a poor user experience where hidden users lose visibility into their own achievements.

Solution

This PR makes minimal changes (7 lines total) to allow hidden users to see their own data while maintaining their invisibility to other users.

Changes Made

1. Modified emoji visibility filter (dojo_plugin/utils/awards.py)

Updated get_viewable_emojis() to include the current user's emojis even if they are hidden:

# Before: Filtered out ALL hidden users
.filter(~Users.hidden, ...)

# After: Filters out hidden users EXCEPT the current user
.filter(db.or_(~Users.hidden, Users.id == (user.id if user else None)), ...)

2. Enhanced scoreboard to show hidden user's own placement (dojo_plugin/api/v1/scoreboard.py)

  • Modified get_scoreboard_page() to remove the restriction preventing hidden users from seeing their "me" entry
  • Added inline query to calculate hidden user's solve count and rank when not found in main results
  • Rank is calculated by counting visible users with more solves

This allows hidden users to see their rank, solve count, and badges in the scoreboard while remaining absent from the public standings.

Behavior

Hidden users can now see:

  • ✅ Their own emojis when viewing their profile
  • ✅ Their rank and placement in the scoreboard ("me" entry)
  • ✅ Their badges/emojis in the scoreboard view

Privacy maintained:

  • ✅ Hidden users do NOT appear in public standings lists
  • ✅ Other users still get 404 when trying to view hidden user profiles
  • ✅ Hidden users' emojis remain hidden from other users

Implementation Notes

  • Minimal changes: Only 7 lines of code changed across 2 files
  • No breaking changes: Existing functionality unchanged for non-hidden users
  • Performance: Minimal impact - inline query only executed for hidden users viewing their own data
  • Edge cases handled: Anonymous users, hidden users with no solves, pagination

Fixes issue where hidden users couldn't see their own achievements, making the hidden status feel like a punishment rather than a privacy feature.

Fixes #938

Original prompt

This section details on the original issue you should resolve

<issue_title>Let hidden users see their own emojis and scoreboard placement</issue_title>
<issue_description>Currently hidden users can't see their own emojis and scoreboard placement, which seems pretty weird (just like they can view their own profile, they should be able to see everything else about themselves).</issue_description>

<agent_instructions>absolute minimal code changes</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #938


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits October 14, 2025 22:33
Co-authored-by: zardus <3453847+zardus@users.noreply.github.com>
Co-authored-by: zardus <3453847+zardus@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix visibility of emojis and scoreboard for hidden users Allow hidden users to see their own emojis and scoreboard placement Oct 14, 2025
Copilot AI requested a review from zardus October 14, 2025 22:38
Copilot finished work on behalf of zardus October 14, 2025 22:38
Copy link
Member

@zardus zardus left a comment

Choose a reason for hiding this comment

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

WAY too much code. See what you can do with under 10 lines of changes total.

@zardus
Copy link
Member

zardus commented Oct 15, 2025

@copilot ???

Co-authored-by: zardus <3453847+zardus@users.noreply.github.com>
Copy link
Author

Copilot AI commented Oct 15, 2025

WAY too much code. See what you can do with under 10 lines of changes total.

Simplified to 7 lines of code changes total (down from 158). Removed the helper function, inlined the query, and removed test file. Changes in commit 9f8b7c5.

@copilot ???

Addressed the feedback - reduced to 7 lines of code changes. See commit d9c824c.

Copilot AI requested a review from zardus October 15, 2025 01:28
Copilot finished work on behalf of zardus October 15, 2025 01:28
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

Successfully merging this pull request may close these issues.

Let hidden users see their own emojis and scoreboard placement

2 participants