feat: add 10 UX improvements from interface review
CI / Lint (push) Failing after 10s
CI / Test (push) Has been skipped
CI / Build & Push (push) Has been skipped

- Stale data banner after 3 consecutive fetch failures, auto-clears on recovery
- Date navigation with left/right arrows (Yesterday/Today/Tomorrow labels),
  fetches from NHL API for non-today dates, disables auto-refresh on history
- Empty state message when no games are scheduled
- Series detail page auto-refreshes every 30s when a game is live
- Notification permission deferred until a playoff OT actually occurs
- Scroll position saved/restored when navigating to/from series detail
- Team records rendered with better contrast and tabular nums
- Active bracket round highlighted with gold heading + underline,
  completed rounds dimmed more aggressively, mobile accordion auto-opens
  current round
- Browser tab title shows live game count (e.g. "NHL Scoreboard (3 Live)")
- Service worker update shows a dismissable toast instead of force-reloading

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-23 20:22:03 -04:00
parent 58b27ddd20
commit 2da60e27ae
8 changed files with 313 additions and 39 deletions
+17 -4
View File
@@ -42,10 +42,23 @@ def build_bracket_view(year, bracket_payload, fetched_at=None):
west_cf = [slot(ltr) for ltr in WEST_CF]
cup = [slot(ltr) for ltr in CUP_FINAL]
all_rounds = [
(1, east_r1 + west_r1),
(2, east_r2 + west_r2),
(3, east_cf + west_cf),
(4, cup),
]
current_round = None
for r, matchups in all_rounds:
if any(m["state"] == "active" for m in matchups):
current_round = r
break
return {
"year": year,
"fetched_at": fetched_at,
"bracket_logo": (bracket_payload or {}).get("bracketLogo"),
"current_round": current_round,
"east_r1": east_r1,
"west_r1": west_r1,
"east_r2": east_r2,
@@ -54,10 +67,10 @@ def build_bracket_view(year, bracket_payload, fetched_at=None):
"west_cf": west_cf,
"cup": cup,
"rounds": [
{"label": ROUND_LABELS[1], "east": east_r1, "west": west_r1},
{"label": ROUND_LABELS[2], "east": east_r2, "west": west_r2},
{"label": ROUND_LABELS[3], "east": east_cf, "west": west_cf},
{"label": ROUND_LABELS[4], "cup": cup},
{"label": ROUND_LABELS[1], "round_num": 1, "east": east_r1, "west": west_r1},
{"label": ROUND_LABELS[2], "round_num": 2, "east": east_r2, "west": west_r2},
{"label": ROUND_LABELS[3], "round_num": 3, "east": east_cf, "west": west_cf},
{"label": ROUND_LABELS[4], "round_num": 4, "cup": cup},
],
}