Swap and Play show the server's steps as they run, and nothing on the page moves (#163) #164

Merged
cmoriarty merged 1 commit from fix/admin-action-progress into main 2026-11-14 13:05:21 -05:00
Owner

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:

  • Swap: "You click it, the button gets disabled, and nothing happens for a few seconds, and then a banner appears and jerks the button down (the banner should not jerk the button positions), and you have to look at the Log to know what happened."
  • Play: the row says Reading, "which is useful, but it seems like the current playing stream should be in the top summary somewhere."
  • Overall: "perhaps a progress bar or some other indicator showing ACCURATE information about what is happening (not just an infinite spinner)."

The server does real work in those seconds, in steps, and the page saw none of it.

What changes

The server

  • A channel records an operator's action as it runs (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).
    • Swap: the standby is taken, its playlist and first segments are loaded, it waits behind what the buffer held, and it is done when its first segment is in the playlist players read.
    • Play on any other link: its page is read (waiting for a free reader first) and its stream checked, then the same steps.
    • Swap with no standby, and Wrong game with none: the link is dropped or rejected, and the record says what the recovery it started is doing: the ladder link it is on, or the wait for the next round.
  • During the buffer step the record says how many older segments are still ahead of the new stream and about how long until players are sent it.
  • GET /api/channels/{game_id}/operation serves the record; the admin view carries it on each channel. An ended action stays readable for a minute.

The page

  • The action is shown beside the buttons, as a field: the action and where it goes as the label, the step the server is on with its seconds as the value, and a bar with one part per step. Only the buffer step has a known length, so only that part fills and counts down. No spinner.
  • The result stays in the same place: when players were sent the new stream and how long ago, or in red why the action failed.
  • The row the action goes to shows the step in place of "Reading", and "Did not play" with why when it failed.
  • A Link field after Problem names the site playing and its stream letter, and marks itself for a moment when it changes.
  • Nothing 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 on the page): one row when wide, the box under the name and the buttons when narrower, three rows on a phone.

Specs: OpenSpec change admin-action-progress, with deltas for admin-page and stream-supervision.

Things to know

  • Stop re-encode moved from beside Swap into the Picture field, beside the Re-encoded tag. A third button appearing in the head during a swap would have moved the box beside it. The owner has not seen this.
  • "Sent to players" means listed in the playlist players read. The picture changes after each player's own delay, which the server cannot see; the "N s ago" beside it is there to watch the screen against.
  • A Play that fails leaves no trace on its row after a minute: the row says "Did not play" for as long as the server tells of the action, then goes back to its own state. The ladder does not record a hand-picked read, as before.
  • On a window narrower than about 1,230 px the box sits on its own line under the name, and that line is blank while nothing is happening.
  • A merge deploys: the publish job restarts the app a few minutes later.

Testing

Lanes run locally, since CI runs by hand only:

  • make test: 1299 passed, 1 skipped.
  • Frontend: 265 passed, build clean.
  • 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

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: - **Swap:** "You click it, the button gets disabled, and nothing happens for a few seconds, and then a banner appears and jerks the button down (the banner should not jerk the button positions), and you have to look at the Log to know what happened." - **Play:** the row says Reading, "which is useful, but it seems like the current playing stream should be in the top summary somewhere." - **Overall:** "perhaps a progress bar or some other indicator showing ACCURATE information about what is happening (not just an infinite spinner)." The server does real work in those seconds, in steps, and the page saw none of it. ## What changes **The server** - A channel records an operator's action as it runs (`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). - **Swap:** the standby is taken, its playlist and first segments are loaded, it waits behind what the buffer held, and it is done when its first segment is in the playlist players read. - **Play on any other link:** its page is read (waiting for a free reader first) and its stream checked, then the same steps. - **Swap with no standby, and Wrong game with none:** the link is dropped or rejected, and the record says what the recovery it started is doing: the ladder link it is on, or the wait for the next round. - During the buffer step the record says how many older segments are still ahead of the new stream and about how long until players are sent it. - `GET /api/channels/{game_id}/operation` serves the record; the admin view carries it on each channel. An ended action stays readable for a minute. **The page** - **The action is shown beside the buttons, as a field:** the action and where it goes as the label, the step the server is on with its seconds as the value, and a bar with one part per step. Only the buffer step has a known length, so only that part fills and counts down. No spinner. - **The result stays in the same place:** when players were sent the new stream and how long ago, or in red why the action failed. - **The row the action goes to shows the step** in place of "Reading", and "Did not play" with why when it failed. - **A Link field after Problem** names the site playing and its stream letter, and marks itself for a moment when it changes. - **Nothing 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 on the page): one row when wide, the box under the name and the buttons when narrower, three rows on a phone. Specs: OpenSpec change `admin-action-progress`, with deltas for `admin-page` and `stream-supervision`. ## Things to know - **Stop re-encode moved** from beside Swap into the Picture field, beside the Re-encoded tag. A third button appearing in the head during a swap would have moved the box beside it. The owner has not seen this. - **"Sent to players" means listed in the playlist players read.** The picture changes after each player's own delay, which the server cannot see; the "N s ago" beside it is there to watch the screen against. - **A Play that fails leaves no trace on its row after a minute:** the row says "Did not play" for as long as the server tells of the action, then goes back to its own state. The ladder does not record a hand-picked read, as before. - On a window narrower than about 1,230 px the box sits on its own line under the name, and that line is blank while nothing is happening. - A merge deploys: the publish job restarts the app a few minutes later. ## Testing Lanes run locally, since CI runs by hand only: - `make test`: 1299 passed, 1 skipped. - Frontend: 265 passed, build clean. - `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](https://claude.com/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>
cmoriarty deleted branch fix/admin-action-progress 2026-11-14 13:05:21 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/sports-breaker!164
No description provided.