Skip to content

Show an unnamed imported player by colour, not "?" - #389

Merged
ashtonanderson merged 1 commit into
mainfrom
claude/pgn-unknown-names
Nov 11, 2026
Merged

ashtonanderson merged 1 commit into
mainfrom
claude/pgn-unknown-names

Conversation

@ashtonanderson

Copy link
Copy Markdown
Member

Why

Backend CSSLab/maia-platform-backend#308 (Discord bug B15) makes an imported game keep its PGN's own players. Today they're replaced with the uploader's Lichess id and "unknown". When the PGN names nobody, each player comes back as ?, PGN's "unknown". The analysis page shows names exactly as they arrive, so it would read "? vs ?", in the tab title too.

What changes

  • pgnNameOr treats ? as no name, alongside empty, None, null and undefined.
  • New playerLabel(name, color, gameType): an unnamed player shows as Guest in games played on the site (play, Hand & Brain), as PGN export already does, and as White or Black in any other game.
  • On the analysis page, the desktop player list, the phone header and the tab title all use it, through formatAnalysisPlayerName.
  • PGN export still writes ? for an unnamed player in an imported game, as the PGN standard says.

Checked

  • New tests for pgnNameOr and playerLabel; jest src/lib/pgn passes 18/18. Lint and tsc are clean.
  • On the dev server, a named game (Gukesh D vs Ding, Liren) shows exactly as before in the player list and the tab title. The ? case can't be seen on the live site until backend Add premoves against Maia #308 is deployed.

This is safe to merge before or after the backend PR.

🤖 Generated with Claude Code

Once the backend keeps an imported PGN's own players (backend #308), a PGN
that names nobody comes back with "?" for each, PGN's "unknown". The
analysis page showed names as they came, so it would have read "? vs ?".
An unnamed player is now shown as White or Black, or as Guest in a game
played here, and pgnNameOr treats "?" as no name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
maia-platform-frontend Ready Ready Preview Nov 11, 2026 6:49am UTC

Request Review

@ashtonanderson
ashtonanderson merged commit 727df60 into main Nov 11, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — e3790cec Deployed Nov 11, 2026 by vercel[bot]
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