Skip to content

Go: round robins in the lobby and at a pairing's table - #465

Merged
aaylward merged 4 commits into
mainfrom
claude/hopeful-ramanujan-uwueor
Oct 20, 2026
Merged

aaylward merged 4 commits into
mainfrom
claude/hopeful-ramanujan-uwueor

Conversation

@aaylward

@aaylward aaylward commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

UI for muchq/MoonBase#1680 (muchq/MoonBase#1668 phase 3).

  • Lobby: the round robin form offers Go, on a picked board and clock. Go round robins list beside chess's and pong's ("Go · 9×9 · komi 6.5 · 10+5"), Black named first, a result naming its winner. Each entry's heading names its game. Play, join, forfeit and withdraw go through go's envelope.
  • useRoundRobinList: the list and its ask-again race, shared by chess, pong and go's hooks. The list survives a table's close.
  • A pairing's table says the round robin's terms and offers no picker, challenge, Start (the hub starts it as the second seat fills) or next game. Focus lands on Leave once its game ends.
  • pairingAt reads every game's pairings through roomRoundRobins; a go pairing's table is its pair's.
  • Go's board sizes, clocks and lines move to src/apps/go/terms.ts, shared by the table and the lobby.

Deploy order: merge after muchq/MoonBase#1680 deploys; an older hub refuses go's round robin moves.

Review panel ran (React, UX/a11y, wire, altitude); its fixes are the last two commits. Tests written first and watched red; 1661/1661, tsc and eslint clean.


Generated by Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
muchq 163d915 Commit Preview URL

Branch Preview URL
Oct 19 2026, 09:06 PM

@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown

Review

Altitude looks right for MoonBase#1680 phase 3: shared useRoundRobinList, go create/list/play through go’s envelope, pairing tables with no picker/Start/next game, Black-first naming, pairingAt scoped per game. CI green.

Medium — late heardList after reset can stick the previous room’s list

useRoundRobinList.reset clears state/refs but does not fence in-flight answers. A roundRobins reply that arrives after clear() / room leave still commits (heardList always setRoundRobins). RoundRobins only auto-loads while === null, so the next room can skip load* and keep the prior room’s RRs (and pairingAt gates) until Refresh.

The unit test pins the wrong side of this: useRoundRobinList.test.tsx (“forgets the list…”) allows a post-reset heardList and only asserts no re-ask. Chess/pong likely inherited the same race; extracting the hook is a good place to fence it (generation / ignore-after-reset).

Medium — Play/Join accessible names omit the game

Headings now name the game because the same opponent can appear in more than one game’s round robin, but the primary controls are still Play {opponent} / Join {opponent} at {id} (RoundRobins.tsx). Two entries can share one accessible name. Details is the same story: Details of round robin ${id} with no game (keys already use game\nid).

Low — offline auto-load does not bite go

LobbyPanel “does not ask while offline” only nulls chess; default go is [], so the new goUnknown && !disabled effect is unpinned offline.

Low — docs / pairing watcher coverage

README round-robin narrative still reads chess-only (ChessView.roundRobinId, “on a clock”). Pairing watcher status (“both players sit”) and missing-terms pairing copy have no GoTable tests (chess covers both).

Copy link
Copy Markdown
Contributor Author

Re the Cursor review:

  • Late heardList after reset: not fixing. clear() runs on sessionReady (a new connection; the old one's replies die with it) and on roomLeft. The hub answers roundRobins synchronously under its lock, in order on the player's stream, so an ask sent before the leave is answered before roomLeft, and one sent after is refused ("not in a room"). The wire has no reply correlation, so a fence would have to count answers to discard. That breaks across a reconnect, where the owed answers never come and the new room's first real list would be dropped.
  • Play/Join names: fixed in 163d915. Each control is now aria-describedby its entry's heading, which names the game, and Details names the game. Pinned in the go LobbyPanel test.
  • Offline go auto-load, README, and pairing watcher/no-terms copy: pinned and updated in 163d915.

Generated by Claude Code

@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown

Ack on 163d915.

  • Play/Join/Details naming and the go LobbyPanel pins look right (aria-describedby on the heading + game in the Details label).
  • Offline go auto-load, README multi-game copy, and the GoTable watcher/no-terms pins match what was asked.
  • Agree on the late heardList fence: without reply correlation, counting answers across reconnect would drop the first real list. Leaving it alone is fine given ordered sync answers on the stream and clear on sessionReady / roomLeft.

@aaylward
aaylward merged commit 2b503cf into main Oct 20, 2026
2 checks passed
@aaylward
aaylward deleted the claude/hopeful-ramanujan-uwueor branch October 20, 2026 00:47
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.

2 participants