From d7d42ec1fab6f90660384b010e817681da8c1b6f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 19 Apr 2026 21:54:37 +0000 Subject: [PATCH] fix(leaderboard): only warn on penalties, not plain adjustments The public leaderboard previously rendered a warning icon for any score with either a minor/major penalty or a plain organizer adjustment. Plain adjustments typically correct data-entry issues and a warning icon next to those scores reads as if something is wrong, which can confuse athletes. The penalty indicator (desktop and online/mobile variants), the row-level warning icon, and the expanded-view "Score adjusted by organizer" notices now gate on penaltyType alone. hasExpandableContent and the expanded-row filter likewise stop expanding rows solely because of a plain adjustment. --- .../competition-leaderboard-table.tsx | 11 +++--- .../online-competition-leaderboard-table.tsx | 36 +++++-------------- .../leaderboard-page-content.test.tsx | 19 +++++----- lat.md/domain.md | 2 ++ 4 files changed, 23 insertions(+), 45 deletions(-) diff --git a/apps/wodsmith-start/src/components/competition-leaderboard-table.tsx b/apps/wodsmith-start/src/components/competition-leaderboard-table.tsx index 0381ef070..cad7bf372 100644 --- a/apps/wodsmith-start/src/components/competition-leaderboard-table.tsx +++ b/apps/wodsmith-start/src/components/competition-leaderboard-table.tsx @@ -174,22 +174,19 @@ function CappedRoundsIndicator({ ) } -/** Clickable icon for any score modification (penalty or direct adjust) */ +/** Clickable icon shown only for minor/major penalties */ function PenaltyIndicator({ result, }: { result: CompetitionLeaderboardEntry["eventResults"][number] }) { - if (!result.penaltyType && !result.isDirectlyModified) return null - - const label = result.penaltyType - ? `${result.penaltyType === "major" ? "Major" : "Minor"} Penalty` - : "Score Adjusted" + if (!result.penaltyType) return null + const label = `${result.penaltyType === "major" ? "Major" : "Minor"} Penalty` const detail = result.penaltyPercentage != null ? `${result.penaltyPercentage}% deduction applied` - : "This score was modified by an organizer." + : "A penalty was applied to this score." return ( diff --git a/apps/wodsmith-start/src/components/online-competition-leaderboard-table.tsx b/apps/wodsmith-start/src/components/online-competition-leaderboard-table.tsx index e0a9837c3..cd04bdc7e 100644 --- a/apps/wodsmith-start/src/components/online-competition-leaderboard-table.tsx +++ b/apps/wodsmith-start/src/components/online-competition-leaderboard-table.tsx @@ -217,20 +217,18 @@ function CappedRoundsIndicator({ ) } -/** Subtle warning icon indicating a penalty or score adjustment */ +/** Subtle warning icon shown only for minor/major penalties */ function PenaltyIndicator({ result, }: { result: CompetitionLeaderboardEntry["eventResults"][number] }) { - if (!result.penaltyType && !result.isDirectlyModified) return null + if (!result.penaltyType) return null - const label = result.penaltyType - ? `${result.penaltyType === "major" ? "Major" : "Minor"} Penalty${result.penaltyPercentage != null ? ` (${result.penaltyPercentage}%)` : ""}` - : "Score Adjusted" + const label = `${result.penaltyType === "major" ? "Major" : "Minor"} Penalty${result.penaltyPercentage != null ? ` (${result.penaltyPercentage}%)` : ""}` return ( - + ) @@ -304,7 +302,7 @@ function hasExpandableContent( return entry.eventResults.some( (r) => r.trackWorkoutId === selectedEventId && - (r.videoUrl || r.penaltyType || r.isDirectlyModified), + (r.videoUrl || r.penaltyType), ) } @@ -412,11 +410,9 @@ function ExpandedVideoRow({ ? entry.eventResults.filter( (r) => r.trackWorkoutId === selectedEventId && - (r.videoUrl || r.penaltyType || r.isDirectlyModified), - ) - : entry.eventResults.filter( - (r) => r.videoUrl || r.penaltyType || r.isDirectlyModified, + (r.videoUrl || r.penaltyType), ) + : entry.eventResults.filter((r) => r.videoUrl || r.penaltyType) if (resultsToShow.length === 0) return null @@ -436,7 +432,7 @@ function ExpandedVideoRow({ )} - {/* Penalty / adjustment notices */} + {/* Penalty notice */} {result.penaltyType && (
@@ -445,12 +441,6 @@ function ExpandedVideoRow({ ` · ${result.penaltyPercentage}% deduction`}
)} - {!result.penaltyType && result.isDirectlyModified && ( -
- - Score adjusted by organizer -
- )} {/* Video content */} {result.videoUrl && result.videoSubmissionId && ( @@ -651,9 +641,7 @@ function MobileOnlineLeaderboardRow({ {entry.eventResults.some((r) => r.videoUrl) && (