Fix pick sort to use pure pick number (matches tests)

The sport-grouped tiebreaker conflicted with the test contract for the
pick column. Tests expect ascending pick number = [1, 2, 3] regardless
of sport, so revert sortPicks to sort by pickNumber only for that column.

https://claude.ai/code/session_01XBnm7eKxerR7WjwrqqJPwe
This commit is contained in:
Claude 2026-03-23 02:16:16 +00:00
parent 4e8f76996c
commit 5e9fc0e2f4
No known key found for this signature in database

View file

@ -57,8 +57,7 @@ function sortPicks(
const dir = sortDirection === "asc" ? 1 : -1; const dir = sortDirection === "asc" ? 1 : -1;
return picks.slice().sort((a, b) => { return picks.slice().sort((a, b) => {
if (sortColumn === "pick") { if (sortColumn === "pick") {
const sportCmp = a.participant.sport.localeCompare(b.participant.sport); return (a.pickNumber - b.pickNumber) * dir;
return sportCmp !== 0 ? sportCmp * dir : (a.pickNumber - b.pickNumber) * dir;
} }
// points: sort by actual first, then projected // points: sort by actual first, then projected
const pointsDiff = a.points - b.points; const pointsDiff = a.points - b.points;