mlb fix #87

Merged
chrisp merged 2 commits from claude/nice-goldberg-ub4bcy into main 2026-06-12 04:09:52 +00:00

2 commits

Author SHA1 Message Date
Claude
c97e90b3ac Fix divisionRank ordering and add warning for unknown teams
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m56s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m31s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Sort teams by win-loss within each division group before assigning
divisionRank so that the leader is always the best-record team, not
whichever team happened to appear first in ESPN's flat response.

Also warn to console when a team's displayName isn't in the hardcoded
MLB_TEAM_DIVISION map, surfacing renames or expansion teams immediately
instead of silently storing division="" and recreating the display bug.

https://claude.ai/code/session_01288dkXYwKJUfXrEhPd8rmo
2026-06-11 21:04:27 -07:00
Claude
a9acfba546
Fix MLB division leaders missing when ESPN returns flat standings structure
When ESPN's API returns teams directly on the conference group (no division
children), all teams got division="" so only one team globally received
divisionRank=1. Fix by resolving division from a hardcoded team-name map
as a fallback, and scoping divisionRank computation per conference+division
to prevent AL/NL teams from sharing a group.

https://claude.ai/code/session_01288dkXYwKJUfXrEhPd8rmo
2026-06-11 17:40:21 +00:00