Add Gauntlet Race placement badges for pantheon and PGCR - #341
Open
owens1127 wants to merge 2 commits into
Open
Conversation
Show Gauntlet Race ranks on PGCR, profile pantheon cards, and share images; suppress Insurrection Prime Day One numbers and let gauntlet placements supersede Day One when both apply. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment on lines
+31
to
+38
| if (activity.isGauntletRace && rank) { | ||
| return [ | ||
| { | ||
| label: Tag.GAUNTLET_RACE, | ||
| placement: rank, | ||
| key: "gauntlet-race" | ||
| } | ||
| ] |
There was a problem hiding this comment.
Bug: The function getLeaderboardRaceBadges incorrectly requires a rank to show the "Gauntlet Race" badge, causing it to fall back to a "Day One" badge when rank is null.
Severity: MEDIUM
Suggested Fix
Update the conditional check from if (activity.isGauntletRace && rank) to if (activity.isGauntletRace). This will ensure the "Gauntlet Race" badge is correctly prioritized and displayed for all Gauntlet activities, even when a specific rank is not available.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: src/lib/pgcr/leaderboard-tag.ts#L31-L38
Potential issue: In the `getLeaderboardRaceBadges` function, the condition `if
(activity.isGauntletRace && rank)` requires a `rank` to be present to show a "Gauntlet
Race" badge. However, `leaderboardRank` can be `null` according to the API schema. When
`isGauntletRace` is true but `rank` is null, the logic incorrectly falls through to the
`isDayOne` check, causing a "Day One" badge to be displayed instead. This contradicts
the intended behavior where a Gauntlet Race badge should supersede a Day One badge,
regardless of whether a rank is available.
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#from version-first rankDepends on API PR merging first (new
isGauntletRace,isPantheon, profile fields).Test plan
Gauntlet Race #Nonly (notDay One #N)Day One #NDay Onewithout numberMade with Cursor