Goal
Add a first season-comparison view that overlays the same team's hitting trend for two seasons in one chart.
Start small: one team, exactly two seasons, Hits only.
Scope
- Select one team
- Select Season A and Season B
- Use the same rolling-window setting for both seasons
- Align the x-axis by season game number, not calendar date
- Overlay the two seasons in one readable chart
- Keep each season visually distinct
- Show each season's team average
- Show each season's MLB Hits/Game average when that season has COMPLETE league coverage
- Gate the two MLB averages independently; one unavailable season must not break the comparison
- Preserve shareable query parameters
- Browser stays DB-only
Prefer the rolling trends as the main visual comparison. Raw game values may be retained in a de-emphasized form if they remain readable; do not let the chart become trace soup.
Semantics
The comparison answers:
How did this team's hitting trend at the same point in the season differ between two years?
Game 40 in one season should align with game 40 in the other season even though the calendar dates differ.
MLB averages remain season-specific. Do not combine the two seasons into one league baseline.
Preserve
- Existing Hits analytics and M5 league-average rules
- COMPLETE coverage semantics
- In-progress season support
- Empty/missing-data handling
- Server-rendered FastAPI/Jinja architecture
- Local Plotly rendering
Out of scope
- Comparing two different teams
- More than two seasons
- Strikeouts or Runs comparison in this first version
- Normalized indexes
- Correlation or causal claims
- New frontend framework
Testing
Cover at minimum:
- two full seasons for one team
- unequal season lengths / in-progress season
- game-number alignment
- season-specific MLB averages
- one COMPLETE and one unavailable league comparison
- missing team-season data
- query-parameter preservation
- zero MLB API calls during browser rendering
Completion
The user can choose one team and two stored seasons and see a clear, trustworthy Hits comparison on one chart without changing the underlying statistics.
Goal
Add a first season-comparison view that overlays the same team's hitting trend for two seasons in one chart.
Start small: one team, exactly two seasons, Hits only.
Scope
Prefer the rolling trends as the main visual comparison. Raw game values may be retained in a de-emphasized form if they remain readable; do not let the chart become trace soup.
Semantics
The comparison answers:
Game 40 in one season should align with game 40 in the other season even though the calendar dates differ.
MLB averages remain season-specific. Do not combine the two seasons into one league baseline.
Preserve
Out of scope
Testing
Cover at minimum:
Completion
The user can choose one team and two stored seasons and see a clear, trustworthy Hits comparison on one chart without changing the underlying statistics.