Skip to content

Add postseason lines to the player page and postseason leaderboards - #16

Merged
VaalRL merged 2 commits into
mainfrom
claude/exciting-brown-osrche
Oct 19, 2026
Merged

VaalRL merged 2 commits into
mainfrom
claude/exciting-brown-osrche

Conversation

@VaalRL

@VaalRL VaalRL commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Player page: a Regular / Postseason switch, shown only for big league stats.
    • The existing Season / Career switch picks this postseason or the career postseason line.
    • The postseason request is sent only once the switch is used: /people/{id}?hydrate=stats(type=[season,career],gameType=P,season=…).
    • Postseason lines have no sabermetrics, so the advanced panel is hidden in that view. A player with no postseason games gets a message instead.
  • Leaderboards: a Regular / Postseason switch.
    • /stats/leaders ignores gameType=P (ADR 0004). Instead the page fetches every player's postseason line from /stats?stats=season&gameType=P&playerPool=ALL, trimmed with fields=, and ranks them in src/utils/postseasonLeaders.ts. The result has the same shape as /stats/leaders, so LeaderCard is unchanged.
    • Rate stats (AVG/OBP/SLG/OPS, ERA/WHIP/K9) use the regular season's bar: 3.1 PA or 1 inning per game the club played. A club's game count is the most games any of its hitters played, so clubs knocked out early need less to qualify.
    • Ties share a rank, and a zero count doesn't lead anything. The AL/NL filter uses each club's league from teams.json.
  • Which postseason is shown: this season's from late September, otherwise last season's (latestPostseasonSeason).
  • Also fixes the player stats title, which had the year 2026 hard-coded.
  • Version 1.10.0, with changelog and TODO Phase 43.

Verified against the live API (contract tests, run on this branch via workflow_dispatch: all pass)

  • Ohtani's 2025 postseason line has 8 HR in 17 games. His career postseason line has more games and more home runs than that one season.
  • The 2025 postseason player pool has more than 150 hitters. The Dodgers played 17 games. Every hitting and pitching category ranks at least 5 leaders, each with a value, a name and a team.

Test plan

  • npm test: 406 pass (12 new)
  • build, lint (0 errors)
  • Screenshots of the player page at 1280px and 390px: the switches wrap, and nothing overflows the page

Generated by Claude Code

@VaalRL
VaalRL merged commit 46549ac into main Oct 19, 2026
1 check passed
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.

2 participants