feat: match history — real data from DB with opponent names, result colors, rating changes
New API: /api/match-history.php
- Fetches completed matches where player was white OR black
- Enriches with opponent display names from profiles
- Returns: result, time_control, bot_id, rating changes, move count, date
- Supports game_key filter and limit parameter
History scene rewritten:
- Shows real matches with colored left border (green=win, red=loss, gold=draw)
- Opponent name (or bot name if vs bot)
- Rating change (+12 / -8) in matching color
- Time control label (5+0, 10+0, etc.)
- Relative time (5د, 2س, 3ي)
- Proper result detection for all match_result enum values
- Empty state with helpful message
Co-Authored-By:
Claude Opus 4.6 <noreply@anthropic.com>
Showing
api/match-history.php
0 → 100644
119 KB
screenshots/menu-chess.png
0 → 100644
101 KB
screenshots/menu-ludo.png
0 → 100644
102 KB