Skip to content

feat: a Sign in with Lichess button in the header, and a sign-in prompt after a game - #362

Merged
ashtonanderson merged 3 commits into
mainfrom
claude/sign-in-prompts
Nov 7, 2026
Merged

ashtonanderson merged 3 commits into
mainfrom
claude/sign-in-prompts

Conversation

@ashtonanderson

Copy link
Copy Markdown
Member

Stacked on #359 (it uses connectLichess(source) and its events). Merge #359 first; this PR then retargets to main.

Why

About 82% of people who play are guests (88% on phones). Only home-page sign-in clicks were measured, and most of those didn't end with the visitor playing signed in. Two changes, each with its own source, so #359's lichess_sign_in_completed can be counted for each.

1. Header: "Sign in with Lichess" button (source: header, header_menu)

The header's sign-in was small grey "Sign in" text: top right on a desktop, at the bottom of the phone menu. It was easy to miss and didn't say it meant Lichess. It's now a bordered Sign in with Lichess button with Lichess's logo, in both places. LichessSignInButton is shared.

2. After a game: a prompt for guests (source: game_over)

When a game against Maia ends, a guest sees this under Analyze game / Play again:

Sign in to keep your rating and games on any device, and to appear on the leaderboard.
[Sign in with Lichess]

Each claim matches the backend (auth/lichess_oauth.py, cron_update_leaderboards):

  • A first Lichess sign-in keeps the guest's account (its rating and games).
  • The account is then the same on any device.
  • The leaderboard lists only accounts with a lichess_id.

Someone who had already signed in elsewhere switches to that account; the wording doesn't promise a merge.

The sign-in comes back to /play (the setup dialog). The game's page, without its game, would start a new one. connectLichess takes that optional path. The prompt isn't shown to signed-in players or before the account has loaded.

Checked

Production build in Chromium (loadperf/tools/sign-in-prompts.mjs, account and game requests faked):

  • Desktop header: the button for a guest; the name menu when signed in. Phone menu: the button at the bottom.
  • Game over (a guest resigns), desktop 1440×900 and phone 390×844: the prompt shows under the buttons, on one line on the desktop's narrow panel. Its button goes to auth/lichess_login?redirect_url=…/play.
  • 3 new tests in PlayControls.test.tsx: guests only, after the game only, and the return path.
  • npm test (268), tsc and eslint pass.

Measuring it

Once #359 is live, compare lichess_sign_in_completed by source (game_over, header, header_menu, homepage, analysis_lichess_tab) with the week before.

🤖 Generated with Claude Code

ashtonanderson and others added 2 commits November 7, 2026 07:05
…n" text

The header's sign-in was small grey text ("Sign in" on a desktop, at the
bottom of the phone menu), easy to miss, and didn't say it was Lichess.
It's now a bordered "Sign in with Lichess" button with Lichess's logo
(LichessSignInButton, shared), in the desktop header and the phone menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a game against Maia ends, a guest now sees, under Analyze game and
Play again: "Sign in to keep your rating and games on any device, and to
appear on the leaderboard." with a Sign in with Lichess button (source
game_over). Each claim is what the backend does: a first Lichess sign-in
keeps the guest's account (rating and games), the account is then the
same on any device, and the leaderboard lists only Lichess accounts.

The sign-in comes back to /play rather than the game's page, which
without its game would start a new one. connectLichess takes that
optional path. Signed-in players, and pages before the account has
loaded, don't see the prompt.

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

vercel Bot commented Nov 7, 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 7, 2026 7:09am UTC

Request Review

@ashtonanderson
ashtonanderson changed the base branch from claude/sign-in-analytics to main November 7, 2026 07:07
…claude/sign-in-prompts

# Conflicts:
#	src/lib/analytics.ts
@ashtonanderson
ashtonanderson merged commit 73f4bc2 into main Nov 7, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — 87b651f8 Deployed Nov 7, 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