Swap and Play show the server's steps as they run, and nothing on the page moves (#163) #164
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/admin-action-progress"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #163.
Why
The owner pressed Swap and Play on a live game the day the Admin redesign shipped (Miami vs. Duke, 2026-11-14, #161). Every action worked on the server, but the page did not show it:
The server does real work in those seconds, in steps, and the page saw none of it.
What changes
The server
backend/app/operation.py): what was asked, the link it leaves and the one it goes to, each step with its seconds, the step in hand, and how it ended (done, failed with why, or replaced).GET /api/channels/{game_id}/operationserves the record; the admin view carries it on each channel. An ended action stays readable for a minute.The page
Specs: OpenSpec change
admin-action-progress, with deltas foradmin-pageandstream-supervision.Things to know
Testing
Lanes run locally, since CI runs by hand only:
make test: 1299 passed, 1 skipped.make e2e: passed.openspec validate admin-action-progress --strict: valid.Nothing moving was measured, not judged by eye: the place of the buttons, the fields, the timeline and the links was sampled every 100 ms through whole actions at desktop, mid and phone widths. That found two jumps beyond the banner (a state tag growing from "Playing" to "Not playing" pushed the buttons onto a second line, and "Pause checks" turning into "Resume checks" moved the box beside it), and none after the fixes.
Not yet run on the live app. The page was tried against a stand-in that replays saved answers and simulates the actions' timing on the server's own record, so the step lengths seen there are made up. The check after deploy is to press Swap and Play on a live game and compare "sent to players" with what the screen does.
🤖 Generated with Claude Code
The owner pressed Swap and Play on a live game the day the Admin redesign shipped (Miami vs. Duke, 2026-11-14). Every action worked, but the page showed a disabled button, nothing for seconds, then a banner that pushed the buttons down, and only the Log said what had happened. The server does real work in those seconds, in steps, and the page saw none of it. A channel now records an operator's action as it runs (operation.py): what was asked, the link it leaves and the one it goes to, each step with its seconds, and how it ended. A swap takes the standby, loads its playlist and first segments, waits behind what the buffer held, and is done when its first segment is in the playlist players read. A Play on any other link reads its page and checks the stream first. A swap with no standby says what the recovery it started is doing. GET /api/channels/{game_id}/operation serves the record, and the admin view carries it. A game's page reads the record a few times a second while an action runs and shows it beside the buttons, as a field: the action and where it goes, the step the server is on with its seconds, and a bar with one part per step. Only the buffer step has a known length, so only that part fills and says about how long is left. The result stays for a minute: when players were sent the new stream, or in red why it failed. The row the action goes to shows the step too, and "Did not play" with why. Nothing on the page moves. The banner above the page is gone on every Admin page; a control's answer is the same field in its own page's head, in a box that is always there. The head is a grid placed by the page's width alone (container queries), so a longer state word or a line of progress changes no box's place. Sampling every box's place each 100 ms through whole actions, at three widths, found two more jumps (a state tag and a button's words growing wider) and none after. Also: a Link field after Problem names the site playing and its stream letter, and marks itself when it changes. Stop re-encode moves from beside Swap into the Picture field, so the head's buttons are the same two at all times. Not yet run on the live app: the page was tried against a stand-in that replays saved answers and simulates the actions' timing. OpenSpec change: admin-action-progress. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>