Skip to content

feat(examples/tournament): round list on phones and move a match with points to another court - #4624

Open
icedevera wants to merge 2 commits into
mainfrom
feat/tournament-phone-rounds-move-match
Open

icedevera wants to merge 2 commits into
mainfrom
feat/tournament-phone-rounds-move-match

Conversation

@icedevera

@icedevera icedevera commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Problem

The tournament example had two gaps:

Change

Fixes #4582
Fixes #4583

Round list on phones. Below 560px wide, the Bracket tab shows:

  • a strip of round tabs (WR16 … GF, LR1 … LF), with a live dot on each round that has a live match
  • under it, the same match cards as the canvas, listed at full size for the selected round

It opens on the first round with a live match. Opening a match from elsewhere switches to that match's round. The Map button brings back the canvas, and Round list returns to the list. The tabs use roving focus with the arrow, Home, and End keys. Wider screens still show only the canvas. Both views use the same snapshot data, and this adds no operation.

moveMatch. A new operation moves a live match to a free court. It:

  • keeps the score, the server, the games, and the start time
  • takes the version the scorekeeper saw, and refuses a stale one with conflict
  • refuses a busy court with court_busy, and the match's own court with invalid_input
  • writes a move row to match_events with who did it, so the match history and the recent feed show "Moved to Court 3"

The match panel shows a Move to button for each free court, or "All courts busy". The button, the CLI, and MCP all call this one operation. Like the other scoring operations, it is open to the owner and helpers and refused for spectators.

The schema adds move to the allowed event kinds. The example is ordinary workspace source with no shipped data to migrate. A workspace that already holds a copy picks the change up when the Collection is approved again.

Outside examples/tournament. The tests live in packages/app-backend-runtime/src/tournament-example.test.ts. It is the only test file for this example, so the new test is added there. Nothing else in that package changed.

Verification

Tested commit 515a13ea1 on Windows 11.

  • Tests: the tournament example tests pass, 15 of 15. The new test fails on the base commit with "Unknown operation moveMatch". It checks that:
    • a waiting match is refused with match_not_live
    • a scored match (2–1, server B) moved to the busy court is refused with court_busy
    • a stale version is refused with conflict
    • spectators are refused
    • a move to the free court keeps the status, score, server, and start time, bumps the version by one, frees the old court, and writes a move history row with the court, the score, the players, and the scorekeeper
  • Static checks: the example's typecheck, pnpm lint, and pnpm fmt all pass.
  • Real app: a throwaway Playwright script published the example in the desktop app, opened it in a browser at 390×844, and loaded the 16-player demo. The script was not committed. It saw:
    • Tabs WR16, WQF, WSF, WF, GF, GF2, LR1–LR5, LF, with 2 live dots
    • The list opened on "Winners semifinals, 1 live", with 2 cards and no canvas
    • ArrowRight selected and focused "Winners final"
    • With reduced motion, the live dot has no animation
    • Map showed the canvas with aria-pressed="true"
    • Moving the live 9–7 match from Center Court to Court 3 kept 9–7, and the history showed "Moved to Court 3"
    • Through the CLI dataset path: the busy court was refused with court_busy ("Court 2 is already playing M19 (Losers round 2). Complete that match first."), a stale version with conflict, and a move to free Court 4 kept the score 9–7, games 1–0, the server, and the start time
    • At 1280px wide there are no round tabs and the canvas shows
    • The page logged no errors

Not checked:

  • macOS and Linux
  • a real phone, or the apps/mobile shell
  • the spectator share link served through the relay
  • MCP directly (it uses the same dataset invoke as the CLI)

Screenshots

Phone, 390px, light: round tabs with a live dot on WSF, and the round's match cards
Phone, 390px, dark: the same round list
Phone, 390px: the Map button brings back the canvas
Phone, 390px: the match panel before the move, with Move to Court 3 and Court 4
Phone, 390px: after the move, the match is live on Court 3 at 9–7 and the history shows the move
Desktop, 1280px: the canvas with no round tabs, after the CLI moved the match to Court 4

🤖 Generated with Claude Code

icedevera and others added 2 commits November 25, 2026 16:33
A live match with points could not change courts. Returning it to the
queue only works at 0-0, so a broken net or a wet court meant losing the
score.

moveMatch moves a live match to a free court. It keeps the score, the
server, and the start time, checks the match version, refuses a busy
court, and writes a "move" row to the match history. The match panel
shows a Move to button for each free court, and the CLI and MCP call the
same operation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a phone the bracket canvas needs a lot of panning and zooming to find
a match.

Below 560px wide, the Bracket tab now shows a strip of round tabs, with
a dot on rounds that have a live match, and a list of that round's match
cards. It opens on the first round with a live match. The Map button
brings back the pan-and-zoom canvas. The tabs follow the arrow, Home,
and End keys. Wider screens still show the canvas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T08:38:40.813373Z 515a13e PR opened
🔒 Security Review ✅ Completed 2026-11-25T08:40:22.040037Z 515a13e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant