Session 24: Connect everything — Slate wired to all sources, copy fixed, nav fixed, startup prefetch, language button removed (1571 tests)

This commit is contained in:
Kev
2026-06-12 15:45:19 -04:00
parent 0538205fab
commit 433e827103
15 changed files with 586 additions and 99 deletions
+73 -1
View File
@@ -4,7 +4,79 @@
2026-06-12
## Current Phase
SHIP BUILD v23.0 — All-Day Intelligence Layer: schedule, game lines, streaks, hot lists, stat filtering (Session 23)
SHIP BUILD v24.0 — Connect Everything: wired the all-day intelligence layer into the live UI + killed stale copy (Session 24)
## Session 24 (2026-06-12) — SHIPPED
Connected Session 23's backend to what users actually see. The Ferrari
engine got wheels. Frontend-heavy: the Slate now fetches every free/cheap
layer, the site shows content even with odds-api at 0 credits, and every
piece of stale copy is gone.
Backend 1567 → **1571 tests** (+4), 125 suites, zero regressions.
Web build clean.
### PHASE 1 — Slate wired to ALL sources
- `fetchSlate` now fetches odds + schedule (ESPN) + gamelines (Tank01)
per sport in parallel. `mergeSlate()` makes the SCHEDULE the foundation
(always shows), overlays odds props (matched by nickname token) and
Tank01 lines (matched by team abbreviation). Unmatched odds games are
appended so props are never dropped. Schedule empty → odds-only fallback.
- `GameCard` extended with optional `status`/`score` (LIVE/FINAL badge +
score) and `gameLines` (book-by-book ML / spread / total strip).
- Odds-down-but-schedule-up → soft inline notice, NOT a wall-of-error.
### PHASE 2 — Stat filter pills
- Pills hidden on the ALL tab (filtering by "points" across mixed sports
is meaningless). Sport-specific categories on a single-sport tab.
- Switching sport resets `activeStat` to 'all' (stale filter would blank
the panels).
### PHASE 3 — Copy
- Hero badge "NBA · MLB · WNBA" → "EVERY SPORT · EVERY PROP"; subhead
de-listed the three leagues. Features "Three sports, one engine" →
"Every sport, one engine". FAQ updated. LivePropsStrip "TONIGHT'S
GRADES LOAD AT 5 PM ET" → "LIVE GRADES APPEAR HERE AS BOOKS POST LINES".
Removed the developer-facing "odds endpoint not configured yet" footer.
No BetonBLK references existed.
### PHASE 4 — Nav for paid users
- Paid (analyst/desk) users see "Account" where free/anon see "Pricing".
- `/account` page created → redirects to `/profile` (canonical plan +
subscription-management surface; no duplicate UI).
### PHASE 5 — Cache population
- `src/startupPrefetch.js` — non-blocking, crash-safe Tank01 cache warm
scheduled 5s after boot (`server.js`). Skips when RAPID_API_KEY unset;
prefetch failure never crashes the server. Bounded by prefetch's budget.
### PHASE 6 — Language switcher
- Removed `<LocaleSwitcher />` from the Nav (no translations behind it).
i18n infrastructure (LocaleContext, useT, react-i18next, the
LocaleSwitcher component file) kept for when translations land.
### PHASE 7 — Empty states
- Dashboard falls back to the free ESPN schedule when the odds slate is
empty, so it shows today's matchups instead of "NO SLATE". "NO SLATE"
now appears only when BOTH odds and schedule are genuinely empty.
- "Tonight's slate is loaded. 0 games across 3 sports." → honest,
sport-aware count (or "Your ledger starts here." when zero).
### Files created
- `src/startupPrefetch.js`
- `web/src/app/account/page.tsx`
- `tests/unit/startupPrefetch.test.js`
### Files modified
- `web/src/components/Slate.tsx` (parallel fetch + merge, notice, pills)
- `web/src/components/GameCard.tsx` (status/score/game-lines layers)
- `web/src/components/Nav.tsx` (paid→Account, locale switcher removed)
- `web/src/components/Hero.tsx`, `Features.tsx`, `FAQ.tsx`,
`LivePropsStrip.tsx` (copy)
- `web/src/app/dashboard/page.tsx` (schedule fallback + copy)
- `src/server.js` (startup prefetch hook)
---
## Session 23 (2026-06-12) — SHIPPED