Skip to content

fix: Ticker + Scoreboard empty in offseason / past-season leagues#67

Open
brandonpham13 wants to merge 10 commits intomainfrom
feat/widgetize-dashboard-light
Open

fix: Ticker + Scoreboard empty in offseason / past-season leagues#67
brandonpham13 wants to merge 10 commits intomainfrom
feat/widgetize-dashboard-light

Conversation

@brandonpham13
Copy link
Copy Markdown
Owner

The dashboard was always querying useLeagueMatchups(selectedLeagueId, week) with week derived from the live NFL state. Right now (May 2026, NFL preseason) that resolves to "preseason 2026 week 1" — Sleeper returns empty/stale data for any selected league, so Ticker and Scoreboard render blank.

Fix

Scope the display week to the selected league's season:

  • Use the live NFL week only when selectedLeague.season === nflState.season AND nflState.season_type === "regular" (i.e. the selected league is the active current-season league).
  • Otherwise default to week 17 — the regular-season finale, which guarantees real matchup data for any finished season and the most-recent-meaningful window during current-season offseason.

Also tightens two follow-on derivations so they stay consistent with the new week:

  • nextWeek only advances when the league is current; otherwise stays equal to week (so MyTeamSection's "Next · Week N Preview" doesn't try to query a non-existent week 18 for finished leagues — the existing Schedule TBD fallback already handles the empty case).
  • season for usePlayerStats now prefers selectedLeague.season over nflState.season, so Top Performers shows stats from the league's own season instead of the live (likely empty) preseason window.

Test plan

  • Pick a finished past season → Ticker and Scoreboard populate with that season's week-17 matchups.
  • Pick the current in-season league during regular season → Ticker / Scoreboard / matchup widgets still show the live current week.
  • During offseason of the current year, current-season league → falls back to week 17, shows last regular-season's matchups.
  • Top Performers shows stats consistent with the selected league's season.

🤖 Generated with Claude Code

Butter and others added 4 commits May 9, 2026 21:41
Each newspaper-style dashboard section now lives in its own file under
widgets/dashboard/, with shared helpers (Eyebrow, SectionHead, SortHeader,
MatchupResult, teamName, teamAvatar, ordinal) consolidated in _shared.tsx.
DashboardPage becomes a thin orchestrator that fetches data and composes
widgets.

Also drops the dead widgets/registry.ts + /widgets/{LeagueStandings,
PowerRankings,RecentScoreboard}/ tree — nothing imported from it after
the dashboard rewrite.

No behavior or visual changes intended.
The dashboard was using the live NFL state's current week to query
useLeagueMatchups for the selected league. In May 2026 with a 2025
league selected, that resolves to "preseason 2026 week 1" — Sleeper
returns empty/stale data, so Ticker and Scoreboard render blank.

Scope the display week to the selected league:
- Current real-time week only when selectedLeague.season matches the
  live NFL season AND nflState.season_type === "regular".
- Otherwise default to 17 (regular-season finale), so finished leagues
  and current-season offseason both surface the most recent meaningful
  matchup data.

Also scopes nextWeek (no preview for past seasons) and uses the league's
own season for usePlayerStats so Top Performers stays consistent.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
huddle Ready Ready Preview, Comment May 9, 2026 11:12pm

brandonpham13 and others added 2 commits May 9, 2026 17:15
When the user switched seasons, useLeagueMatchups and useLeagueRosters
re-fetched independently for the new leagueId. If matchups arrived
before rosters repopulated, Scoreboard's rosters.find(...)! returned
undefined, the subsequent teamName(undefined, users) threw, and the
whole dashboard crashed to a white page (no error boundary).

Drop the non-null assertions in Scoreboard and TopPerformers; skip pairs
/ rows where the roster lookup hasn't resolved yet. Once rosters
populate the next render fills them in.
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.

1 participant