Skip to content

chess: next game at the table, score notepad - #396

Merged
aaylward merged 2 commits into
mainfrom
claude/chess-match
Oct 1, 2026
Merged

aaylward merged 2 commits into
mainfrom
claude/chess-match

Conversation

@aaylward

@aaylward aaylward commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

UI for muchq/MoonBase#1623. Chess tables now persist across games.

  • Between games (phase ended):
    • Next game sends startGame with the table's clock, and sides swap on the hub.
    • Leave table sends leaveGame, which closes the table for both players.
    • Either player can press Next game, so the opponent no longer has to find a new table in the lobby.
  • After the opponent leaves (phase closed):
    • The status says " left the table", or gives the result if they left mid-game.
    • Play again opens a new table, and Back to the room clears this one.
  • Score notepad: rummy's notepad style, shown beside the header once a game has finished.
    • One line per game, with a 1 in the winner's column or "draw".
    • The total row counts wins.
    • It shows the last 5 games, while the totals count every game.

scoreSheet is optional on the wire, so an older hub still renders. Deploy this after #1623: an older hub deletes the table when a game ends, so Leave table would be refused while the finished view stays on screen.

Tests:

  • Hook: next game uses the same clock, leaving an open table versus a closed one, and play again after close.
  • Component: the ended and closed states, focus, and the notepad rows and totals.
  • Vitest, typecheck and lint all clean.
  • Checked visually at 390×844.

Generated by Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 1, 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 965898a Commit Preview URL

Branch Preview URL
Oct 01 2026, 01:04 AM

@cursor

cursor Bot commented Oct 1, 2026

Copy link
Copy Markdown

Blocking

None on the code. Wire matches MoonBase#1623 (ended / closed, optional scoreSheet for older hubs, startGame between games). Next game resends the table’s clock as seconds; Leave table on an open table goes to the hub; closed clears locally; abandoned mid-game reuses describeResult; between-games leave says who left. Notepad hides until there is a line, pages five, totals wins. CI green.

Do not merge until MoonBase#1623 is deployed. An older hub deletes the table when a game ends, so Leave table would be refused while the finished view stays up.

Nits

  • playAgain for Next game never sets opening (or a dealing-style latch). The button stays clickable while startGame is in flight, so a double tap can send a second start and draw a refusal once the first lands. Latch until the next gameState, the way rummy gates Deal.
  • Score sheet has no “last five on the page, totals all” case (rummy pins that). Worth one row if PAGE stays 5.
  • ChessTable.tsx was rewritten with semicolons while ScoreSheet.tsx and the rest of the app mostly omit them — style-only churn that makes the real delta harder to read.

Fine

Ended → Next game / Leave table; closed → Play again / Back; focus on the primary action; notepad beside the header. Merge after MoonBase#1623 is live.


Review of #396

aaylward commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

All three nits are fixed in 965898a:

  • Next game latch: Next game now sets opening until the next gameState arrives or the start is refused. The hook test pins the latch.
  • Score sheet paging: a 7-game sheet shows games 3–7 and the totals count all 7.
  • Semicolons: that was an unconfigured prettier --write. ChessTable.tsx is back to main's style, and its diff is now 31+/19−.

Merge order stands: #396 merges after MoonBase#1623 is deployed.


Generated by Claude Code

@aaylward
aaylward merged commit 2eebe76 into main Oct 1, 2026
2 checks passed
@aaylward
aaylward deleted the claude/chess-match branch October 1, 2026 01:43
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