Skip to content

Conversation

Copy link

Copilot AI commented Oct 31, 2025

After completing a module, the award popup displays /belt/CURRENT.svg which 404s. The new emoji award style uses name="CURRENT" as an identifier, but the popup logic treats multi-character names as belt awards and attempts to load them as images.

Changes

  • Store emoji character in Awards.icon field when creating emoji awards, keeping name="CURRENT" for tracking purposes
  • Update popup logic to check for award.icon to distinguish emoji awards from belts, displaying the emoji character instead of attempting image load
  • Extract dojo name from description using regex to show meaningful message (e.g., "You have officially been awarded the Intro to Cybersecurity badge!")
  • Update feed to use icon field for user emoji display to avoid rendering "CURRENT" as text
  • Add constants EMOJI_CURRENT and EMOJI_STALE for maintainability

Key changes

# awards.py - Store emoji in icon field
db.session.add(Emojis(user=user, name=EMOJI_CURRENT, description=description, 
                     category=hex_dojo_id, icon=emoji))
// popup.js - Check for icon to distinguish emoji from belt
const isBelt = Array.from(award.name).length > 1 && !award.icon;
const image = isBelt
    ? `<img src="/belt/${award.name}.svg" class="belt-image">`
    : `<div class="emoji-display">${award.icon || award.name}</div>`;

Backward compatible with existing belt awards and legacy emoji awards (single character names without icons).

Original prompt

This section details on the original issue you should resolve

<issue_title>Award emoji 404</issue_title>
<issue_description>After completing a module, the award emoji link is https://pwn.college/belt/CURRENT.svg

db.session.add(Emojis(user=user, name="CURRENT", description=description, category=hex_dojo_id))

I think reverting it back to use emoji var would fix the issue but I dont know how to test it.</issue_description>

<agent_instructions>modify the alert logic to display the dojo name for the emoji instead of the "CURRENT" identifier</agent_instructions>

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

@zardus The new style is to use `CURRENT` as the name and look up the emoji itself from the dojo. The alert logic itself needs to be updated, though...

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix award emoji link to use dojo name Fix emoji award 404 by storing emoji in Awards.icon field Oct 31, 2025
Copilot AI requested a review from zardus October 31, 2025 05:35
Copilot finished work on behalf of zardus October 31, 2025 05:35
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.

Award emoji 404

2 participants