Skip to content

fix(remote): the rooms browser asks your name before seating you - #16

Open
sevensrig wants to merge 4 commits into
mainfrom
claude/github-issue-12-58da8c
Open

fix(remote): the rooms browser asks your name before seating you#16
sevensrig wants to merge 4 commits into
mainfrom
claude/github-issue-12-58da8c

Conversation

@sevensrig

Copy link
Copy Markdown
Owner

What was wrong

Joining from the rooms browser had a name field, but it was on the previous page. You'd land on /online, head straight for "browse open rooms", pick a room — and only find out you were "Player 2" once the draft had already started, with nothing anywhere to edit it.

Digging into it, the "it technically works if you fill the field first" path didn't actually work either. rememberName only ran inside create() and join(), so typing a name on /online and then pressing "browse open rooms" arrived at the room list with nothing saved — the one path the saved name exists for. Every rooms-browser join was anonymous, filled-in field or not.

The fix

The invite-link flow already solved this properly, so the prompt became a shared component — NamePrompt.svelte — and both nameless ways into a room now run it:

  • Rooms browser — tapping Join with no remembered name shows the prompt, headed by the room you picked (FOODS · $20 · 3 SLOTS). A remembered name still joins in one tap and is never asked again.
  • Invite link — same screen as before, now rendered from the shared component instead of inline markup.

Nothing is claimed on the server until the form is submitted, so losing the race for the last seat lands back on the prompt with the name still typed rather than at a dead end.

Two deliberate calls worth flagging:

  • The prompt refuses an empty or whitespace-only submit. This is new for the invite path too. A prompt that accepts nothing leaves you called "Player 2" exactly as not being asked did, so accepting nothing would have been theatre.
  • rememberName now fires on the browse control on the way out of /online, which is what makes the one-tap path real.

Riding along

  • "Or browse open rooms" is now a full-width button reading BROWSE OPEN ROOMS. As a text link under the code field it read as fine print rather than the second real way into a game. It's yellow.
  • Colour semantics are gone from the codebase. app.css carried rules like "Green, and never red: red reads as stop or delete" and "yellow is Player 2's identity" as comments on the tokens. Those were blocking ordinary styling choices, so the prescriptive parts are removed — the tokens themselves (--p1, --p2, --money) are wired up exactly as before, just no longer described as reservations. The accessibility rule stays: an accent has to carry black text at 4.5:1.
  • main merged in cleanly, no conflicts.

Verified

npm run check green on the merged state — 0 typecheck errors, deno check clean on the Edge Functions, lint and format clean, 204 tests: 124 unit, 46 component, 34 E2E.

New coverage:

  • Six component tests on NamePrompt — submit gating on empty and whitespace names, the busy state, the name surviving a refused join, and an axe scan. This is the first /online screen with component-level coverage; the rest of remote play needs two live devices and a server, but an isolated form doesn't.
  • Two E2E specs in remote.spec.ts — a nameless rooms-browser join (asserting the host's lobby is untouched until submit, plus an axe scan of the new screen) and the remembered-name one-tap path. Both assert both boards read "Alex" and that "Player 2" appears zero times.

Docker was up for the run, so the remote specs genuinely executed rather than skipping. Room creation is now eight rooms per suite run, still inside the 20/minute limit.

Fixes #12

🤖 Generated with Claude Code

sevensrig and others added 4 commits August 21, 2026 15:49
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
blind-draft Ready Ready Preview Aug 21, 2026 8:09pm

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.

Adding name when joining online games

1 participant