Commit Graph

22 Commits

Author SHA1 Message Date
NilsBriggen 3d3267d803 Show the predicted scoreline, not decimal expected goals
Coming-up cards and the post-match comparison now use the model's most
likely score ('2-0') instead of decimal goal expectations ('2.3-0.4');
the pre-match model card keeps just the honesty note since the bar's
chip already carries the predicted scoreline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 13:14:08 +02:00
NilsBriggen e85053aa0a Predicted lineups, predicted-vs-actual goals, and goals on upcoming cards
- Scheduler now captures FotMob details for fixtures inside 48h, so the
  projected XIs exist before kickoff; the Lineups tab shows the pitch
  pre-match under a 'Predicted lineups' header with an honest note
  (official lineups ~1h before kickoff), switching to the confirmed
  view at kickoff
- Finished matches get their forecast back: the preview falls back to
  the prediction frozen <=15min before kickoff (the scoreboard's
  no-hindsight snapshot), with the most-likely-score chip rebuilt from
  the frozen expected goals; the model card now reads 'Model's
  pre-match expected goals: 1.60 - 1.02 · final score 2-1', and the
  market-movement chart returns to finished matches too
- Upcoming match cards append the model's expected goals to the hint:
  'Model: Brazil 64% · 1.3-0.9 goals'

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 13:04:13 +02:00
NilsBriggen 09c543b009 Lineup pitch with live substitution tracking + polish pass
- LineupPitch: both XIs on a vertical pitch at FotMob's per-player
  formation coordinates — shirt numbers, live ratings, goal badges,
  formation + coach labels. Substitutes take over the outgoing player's
  slot (paired through ESPN's 'X replaces Y' commentary with a unique
  same-minute fallback — the sources romanize names differently), with
  a subbed-off strip below; the page's live refetch keeps it current
  through the match. Falls back to the list view (and hides predicted
  pre-kickoff XIs) when no confirmed lineup is captured.
- /api/match-rich now serves the trimmed FotMob lineup (only complete,
  fully-positioned XIs)
- Fix: vs-Market label box was too narrow — the probability bar covered
  the end of 'DraftKings'
- Timeline spine no longer runs past the kick-off/full-time pills

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 12:02:49 +02:00
NilsBriggen 4faedd60c4 Surrounding screens refresh: live hero, row-style match cards, form bars, unified bracket
Design handoff steps 4-5:
- LivePage: headline live-match hero (gradient card, live ring, smallcaps
  stage/venue + minute, big mono score, 3-segment in-play win-prob bar);
  favorite team's live match takes the hero slot
- MatchCard: played matches as stacked team rows with the beaten side
  dimmed; scheduled matches as a centered 'vs' pairing (model hint and
  venue stay)
- GroupTable: Form column — tiny W/D/L bars (accent/gold/loss) computed
  from finished group matches
- BracketPage: one round-selector layout on every screen size (cards in
  a 2-col grid, losers dimmed), gold 'Projected champion' banner on the
  Final view; what-if mode, advance bars, R32 and the third-place
  play-off all unchanged
- Predict title race: leader bar, rank and percentage in gold

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 11:37:06 +02:00
NilsBriggen b9b79df51e Match center redesign: center-spine timeline + hero scoreboard + tabbed layout
Implements steps 1-3 of the Claude Design handoff:
- MatchTimeline: vertical center spine (home left, away right, minute
  pills on the rail), goal cards with parsed scorer/assist/running
  score, sub and booking chips, synthetic kick-off/half-time/full-time
  dividers; single left rail under the sm breakpoint
- matchEvents: pure ESPN commentary parser (scorer, assist, penalty,
  own goal, sub in/out, embedded score) with tests on real feed shapes
- Hero scoreboard: panel gradient + accent glow, smallcaps meta, mono
  score, stat chips (xG / POTM / attendance / referee; possession and
  shots while live); weather line stays for upcoming matches
- Sticky Summary/Timeline/Stats/Lineups sub-nav; all existing cards
  re-bucketed with no feature loss (in-play win prob, swing chart,
  xG race, shot map, momentum, odds movement, form, H2H, lineups)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 11:19:16 +02:00
NilsBriggen b823bef2d0 Match center v2: xG race, shot map, attack momentum, weather, officials
The captured FotMob/FIFA/Open-Meteo data becomes visible. Match pages
now carry: a cumulative xG race with goal dots and team totals, a full-
pitch shot map (each side attacking its own end, dots sized by xG,
goals filled), the 90-minute attack-momentum chart, player-of-the-match
with rating, the official info line (stadium · attendance · referee),
and a kickoff-hour weather line for upcoming matches with an altitude
chip above 1,000m. All hand-rolled SVG on the existing token
conventions — design-ready for the upcoming visual overhaul. EN/DE
included, with an honest 'xG and ratings are FotMob estimates' note.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 10:10:35 +02:00
NilsBriggen 74b6b7b77f Best-thirds race: the cross-group table nobody can track by eye
All twelve third-placed teams ranked by points/GD/goals under the
group grid — top 8 highlighted (they reach the Round of 32), the rest
dimmed. Appears once group play has started.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 08:24:49 +02:00
NilsBriggen 03b0fa734e Web Push: goal, kickoff and full-time alerts for a followed team
Fully progressive: without VAPID keys in the environment the API says
404, the bell never renders, and the service worker addition (a push
handler via workbox importScripts — no SW strategy change) is inert.
With keys: a bell on each team page requests permission, subscribes
(one team per device) and the server diffs fixture states on every
broadcast to push Kickoff / Goal / Full time to that team's followers.
Dead endpoints (404/410) self-clean. Round-trip verified locally with
dev VAPID keys; disabled mode verified too.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 08:21:55 +02:00
NilsBriggen ce83d4dbc4 Golden Boot race from structured ESPN scoring plays
ESPN's keyEvents carry participants[].athlete for goals — no text
parsing needed. The normalizer now extracts scorer/scoring/shootout
(payload versioned, with a boot backfill that re-stores summaries
saved by the old normalizer), /api/goldenboot aggregates per-player
goals (own goals and shootout kicks excluded), and the Teams page
leads with the top-10 race. Verified against tonight's real goals.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 08:18:19 +02:00
NilsBriggen 7882c9af01 Offline banner: say how old the data is instead of failing silently
When the live connection drops, a slim notice under the header shows
the timestamp of the last snapshot — the page keeps working from it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:20:18 +02:00
NilsBriggen 17ec56bceb Model diary: a transparency log of every model update
The Methodology page lists each recompute (the finished match that
triggered it) with the biggest title-odds move it caused — the model's
thinking made visible, feeding the openness story.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:19:37 +02:00
NilsBriggen 343a3e1829 Compare page: any two teams, model matchup + 150-year record
/compare (also in the mobile More sheet): pick any two of the 48 —
defaults to the top title favourites — and get the model's
neutral-ground matchup plus the full head-to-head from the historical
archive (wins/draws/goals and the last six meetings).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:18:07 +02:00
NilsBriggen b61d839c8e Daily digest on the Live tab: yesterday's results + title-odds movers
A compact card up top: yesterday's scores at a glance and the teams
whose championship odds moved most over the last day (from the model's
recompute history), with up/down trends linking through to team pages.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:14:56 +02:00
NilsBriggen a91f7902e4 Global search: Cmd/Ctrl-K palette for teams and matches
A keyboard-first palette (plus a header button) that jumps to any team
page or match page — arrow keys, enter, esc; flags and kickoff days in
the results. Pure client, searches the snapshot already in memory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:13:57 +02:00
NilsBriggen 047e9f8767 Elo trajectories: a century of strength on every team page
buildRatings samples each WC team's rating along the full walk (yearly
historically, monthly since 2022) into elohistory.json (~72KB, 48
teams). Team pages plot it as a clean SVG line with year and rating
gridlines — Germany's century, 1908 → today, in one glance.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:12:36 +02:00
NilsBriggen f58d6566fb Upset meter: the results the model found least likely
The scoreboard gains a Biggest surprises card — finished matches whose
actual outcome the frozen model priced under 30%, sorted by shock
value, each linking to its match page. Pure client derivation from
data the scoreboard already had.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:10:02 +02:00
NilsBriggen 005b4d72ca Group qualification scenarios: who's through, who needs what
Once a group reaches its closing stretch (≤3 open matches), every
remaining win/draw/loss combination is enumerated and ranked with the
real tiebreaker logic. Under each table: Top 2 secured / Top 2 with a
win / Still possible (n of N outcomes) / Can't reach the top 2 — with
an honest footnote that tight cases hinge on goal difference and third
place runs through the cross-group best-thirds race. Pure, tested
enumeration in src/lib/scenarios.ts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 01:01:42 +02:00
NilsBriggen 8e6c9416fa Favorite team: star a side, get its next match pinned on Live
A star on the team page (localStorage, no accounts) pins that team's
next or running match in a My team section at the top of the Live tab.
EN/DE strings + aria-pressed on the toggle.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 00:59:15 +02:00
NilsBriggen c2f4b4be83 Bracket what-if mode: pick winners, watch the tree fill
A wand toggle turns the bracket interactive: tap a side to send that
team through; W/L placeholders resolve down the tree (pure, tested
logic in src/lib/whatif.ts). Real results always override picks; picks
that stop making sense after an upstream change are pruned. Each open
pairing shows the model's advance probability (ratings.json fetched
lazily), and once your final resolves, a summary banner names your
champion with the model's chance of exactly that run. EN/DE included.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 00:58:01 +02:00
NilsBriggen ec185b5918 Market-movement chart: the bookmaker line vs our model, per match
The odds history we have been capturing every 3h finally gets a face:
de-vigged DraftKings probabilities drift as solid lines toward
kickoff, with the model's numbers as dashed references — the honest
benchmark framing, right on the match page. Renders only when at least
two pre-kickoff lines exist. EN/DE copy included.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 00:53:42 +02:00
NilsBriggen cbc5ff0468 In-play win-probability timeline: the momentum curve on match pages
While a match runs, every poll records the in-play model probability
per game state (insert-if-new on minute+score) into inplay_history.
The match page draws it as a stacked area chart — home fills from the
bottom, away from the top, the gap is the draw — with minute ticks and
a 50% guide. Shows live (under the win-probability bar) and after full
time as its own card. EN/DE strings included.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 00:50:56 +02:00
NilsBriggen 05010771a3 German language option + a full wording-clarity pass
A tiny typed i18n layer (no library): en.ts is the single source of UI
copy and the clarity rewrite lives there — shorter sentences, plain
words, the dense Methodology/Scoreboard copy untangled. de.ts mirrors
its shape exactly, enforced by the compiler, with placeholder parity
covered by tests. Every page now reads from the dictionary via useT();
dates flip locale through useFormat() (en-GB/de-DE); raw server values
(status, outcome, stage) map through total records.

The header gains an EN/DE toggle (persisted, defaults from the
browser language); <html lang> stays in sync.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 00:20:07 +02:00